• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your 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