It feels like an if-then-else trigger does the same thing as two triggers with their respective conditions. Is this true or do if-then-else triggers have some other quality that I don't know about?
an if then else checks the conditions specified and runs actions under Then if the conditions are met and runs the conditions under Else if the conditions are not met.
I dont believe so. What you can do is have the trigger use an event like "Every 0.5 seconds" (or less) and have a condition check that variable you want.
Beware of using too many periodic events. The game drops a bit of lag every time an event is called and with a lot of events happening at once you could see major performance problems with your map. I recommend using While loops instead and running the trigger from your initialization trigger.
The problem with putting while loops in the map initialization trigger (from my novice understanding) is that if the conditions are not met on map initialization, the while loop ends.
It would be great if Blizzard would make a variable change able to be used as an event.
I don't mean putting the loop IN your initialization trigger. I mean putting it in a new trigger and then using the Run Trigger action from your initialization trigger.
For the conditions in the while loop, create a boolean variable called TRUE and set the default to true. Then for your conditions do TRUE = true. Once you run your trigger, the while loop will repeat infinitely. You also need to add a "wait 0.1 seconds" action to the end of your loop or the trigger stack will overflow.
i.e. can I make the event for a trigger "variable x <0"?
@dubo863: Go
why can't you use an if then else in the trigger(s) where you change the variable?
@Usernameisntworkingright: Go
I'll try that.
@Usernameisntworkingright: Go
It feels like an if-then-else trigger does the same thing as two triggers with their respective conditions. Is this true or do if-then-else triggers have some other quality that I don't know about?
@dubo863: Go
an if then else checks the conditions specified and runs actions under Then if the conditions are met and runs the conditions under Else if the conditions are not met.
I don't know if that answers your question.
@dubo863: Go
I dont believe so. What you can do is have the trigger use an event like "Every 0.5 seconds" (or less) and have a condition check that variable you want.
@TheAlmaity: Go
That sounds like it would work just as well, thank you.
@Usernameisntworkingright: Go
What I meant was, afaik, this trigger:
Event:
Conditions:
Actions: General- If: [condition x} == true
Then: [do action x]
Else: [do action y]
does the same thing that these two triggers do:
Event:
Conditions: [condition x] == true
Action: [action x]
Event:
Conditions: [condition x] != true
Actions: [action y]
@TheAlmaity: Go
Just wanted to tell you that was extremely helpful, that really simplified my "trigger system".
Beware of using too many periodic events. The game drops a bit of lag every time an event is called and with a lot of events happening at once you could see major performance problems with your map. I recommend using While loops instead and running the trigger from your initialization trigger.
@BasharTeg: Go
The problem with putting while loops in the map initialization trigger (from my novice understanding) is that if the conditions are not met on map initialization, the while loop ends.
It would be great if Blizzard would make a variable change able to be used as an event.
@dubo863: Go
I don't mean putting the loop IN your initialization trigger. I mean putting it in a new trigger and then using the Run Trigger action from your initialization trigger.
For the conditions in the while loop, create a boolean variable called TRUE and set the default to true. Then for your conditions do TRUE = true. Once you run your trigger, the while loop will repeat infinitely. You also need to add a "wait 0.1 seconds" action to the end of your loop or the trigger stack will overflow.
What would I use for the event in the new trigger, or would I not need one?
@dubo863: Go
It doesn't need one. The Run Trigger action takes care of that.