• 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.

[Trigger] How does If, then, else multiple functions work?

Status
Not open for further replies.
Level 8
Joined
Oct 19, 2008
Messages
168
I dont get why the "else" is there. Is it there so if all conditions ARE NOT true then it does else actions and if it is true it does then actions?



Yes i know this is noob question but small things matter
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
That's kind of a weird comparison, but ok. To give you an in-game example: If you got you map 'split up' in 2 regions (Region1 and Region2) and you want units it Region1 to have health regeneration and unit in region 2 to have mana regeneration. Then you'll get a trigger like this:
  • If/Then/Else
    • Events
      • Time - Every 2.50 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region1 <gen> contains (Position of YourUnit)) Equal to True
        • Then - Actions
          • Unit - Set life of YourUnit to ((Life of YourUnit) + 35.00)
        • Else - Actions
          • Unit - Set mana of YourUnit to ((Mana of YourUnit) + 1.00)
 
Level 2
Joined
Jul 27, 2007
Messages
24
@all
IF : checks the condition. If the conditions listed in this category are true, then it triggers the THEN codes.
THEN : lists of the trigger code(s) if the condition(s) that I've mentioned is/are true.
ELSE : lists of the trigger code(s) if the condition(s) that I've mentioned is/are false.

BTW, sorry for my bad language...
 
Status
Not open for further replies.
Top