• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

WE ignores condition.

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
how come my WE ignores conditions about checking unit's life or is unit dead or alive?

  • (Life of (Picked unit)) Greater than 0.41
this condition simply doesn't works lol neither is unit dead or is unit alive.

  • Mor Guld Crumble
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mor'Guld Crumble (Hero Ability)
    • Actions
      • -------- --------------- Set Variables --------------- --------
      • Set TrigUnit = (Triggering unit)
      • Set TempPoint = (Position of TrigUnit)
      • Set TempUnitGroup = (Units within 500.00 of TempPoint)
      • -------- --------------- Actions --------------- --------
      • Unit - Create 1 Dummy Caster for (Owner of TrigUnit) at TempPoint facing Default building facing degrees
      • Set TempDummyUnit[1] = (Last created unit)
      • Unit - Add a 0.30 second Generic expiration timer to TempDummyUnit[1]
      • Unit - Add Dummy Mor'Guld Crumble to TempDummyUnit[1]
      • Unit - Set level of Dummy Mor'Guld Crumble for TempDummyUnit[1] to (Level of Mor'Guld Crumble (Hero Ability) for TrigUnit)
      • Unit - Order TempDummyUnit[1] to Human Mountain King - Thunder Clap
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • (Life of (Picked unit)) Greater than 0.41
              • ((Picked unit) belongs to an enemy of (Owner of TrigUnit)) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempUnitGroup = null
Here the effect is created no matter is unit dead, alive or it's life is greater or less than 0.41...

Anyone else had similar problem?
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
You're going to try to delete those conditions and redo them again.
Try that, that resolved a problem of mine that when i set a unit variable and then use it to do stuff it didn't work:
  • Untitled Trigger 001
    • Events
      • // some stuff
    • Conditions
    • Actions
      • Set AUnit = Footman 0002 <gen> // THIS BULLSH*T didn't work. had to delete this variable, create the variable again and do this ._.
      • Unit - Order AUnit to Attack Someone
 
Level 18
Joined
May 11, 2012
Messages
2,103
it doesn't even behaves like there's any condition.

effect is created on every unit (regardless alive/dead check)

If there's a condition checking if unit is dead equal to false, meaning don't create effect is unit is dead, it still create effect on dead units

So, it ignores condition like there's no one
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
sorry I didnt reply, it worked for me perfectly with 2 conditions, so I dont know where the problem is


  • fhfgfh
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Kill Rifleman 0003 <gen>
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: (Name of (Picked unit))
            • Else - Actions
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
sorry I didnt reply, it worked for me perfectly with 2 conditions, so I dont know where the problem is


  • fhfgfh
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Kill Rifleman 0003 <gen>
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: (Name of (Picked unit))
            • Else - Actions
I tested the spell almost the same as this one of the blood, no bugs.
The problem is that WE has some weird bugs related to these things, which can be fixed by replacing the part of the problem, ridiculous.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Yep, my WE is known to have some dark, undiscovered bugs.

Just a few minutes ago, custom spell that has been working normally all the time suddenly started to create special effect on units that wasn't ever related to that spell at all. I didn't even touch the spell ever since I created it.

So I had to make new custom ability and replace it and it works normally now.
Satan is here, he's the one screwing with me.

Still, spell is creating SE's on dead units tho and not just that, every action that moves units or something regarding units is applied to dead unit too, with or without condition..
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
to filter out dead units u check if there unit type is dead. then u check if there unit type id is 0. if both are true the unit is dead. u might need custom scripts for these.
Why would he check unit type instead going directly by "unit is dead"? Btw when I only read your sentence for the 10th time I understood it. You could be more specific with your english, it's "their unit type is..." not there. :slp:
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
thats right i meant to say if one is true. and it should be an or in the example.

You also said this in a different post:
then check there unit type id and check if it is not equal to 0. if it isnt 0 then it is still alive.

What leads me to believe that you just didn't know what you were talking about. Dead units do have the same unit type id as alive units of the same unit type.

Why would he check unit type instead going directly by "unit is dead"?

It is said that in some cases, unit groups can have "phantom" units, units that have been removed from the game. But that is not an issue in instant abilities, that create a new group for every cast so there is no need to check unit type id necessarily.
 
Status
Not open for further replies.
Top