• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Turn off trigger, do something, turn on trigger. Is this a safe method to avoid infinite loops?

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 76
Joined
Aug 10, 2018
Messages
8,351
So, my trigger is working fine. I'm just curious if turning off a trigger, then doing something that would run the trigger's Events, then turning the trigger back on is a safe method to avoid a crash/infinite loop.

  • Destructible Death
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Occlusion height of (Picked destructible)) Greater than 0.00
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Destructible - Remove (Picked destructible)
          • Trigger - Turn on (This trigger)
        • Else - Actions
      • Else - Actions
In my trigger's case, removing the picked destructible causes the trigger to run again, thus it tries to remove itself over and over again and crashes the game. However, turning the trigger on and off like I did prevents that problem. Is this a safe practice?
 
Status
Not open for further replies.
Back
Top