• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] What is the point of "Turn off" and "Turn on" within the same trigger?

Status
Not open for further replies.
Level 12
Joined
May 16, 2020
Messages
660
Hi guys,

I see sometimes triggers that use "Turn off" and "Turn on" within the same trigger in sequence. What is the reason behind this?

  • Example spell
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) has buff Berserker's Call Target) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Attack BerserkerCall_Caster[BerserkerCall_Index]
      • Trigger - Turn on (This trigger)
Thanks!
 
Level 10
Joined
Dec 11, 2009
Messages
234
This needs to be done to prevent infinite loops.
Giving order through trigger will make this same trigger react to given order, unless it's turned off for this instant moment.

Same could be said about damage event triggers, where you deal extra damage (the same trigger will react to this again, so it needs to be turned off for a moment).
 
Status
Not open for further replies.
Top