• 🏆 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!

Infinite Trigger Execution

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
Why do the below triggers cause an infinite execution? Turning off the opposing trigger temporarily while the unit is moved should prevent infinite executions should it not? Can anyone point out my mistake and how I can fix it? I'd rather not create 2 regions for entrances and exits.

  • Oaks Lab Exit
    • Events
      • Unit - A unit enters Oaks Lab Entrance <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pokemon Trainer
    • Actions
      • Trigger - Turn off Pallet Oaks Lab <gen>
      • Set TempPoint1 = (Center of Pallet Town Oaks Lab <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Trigger - Turn on Pallet Oaks Lab <gen>
  • Pallet Oaks Lab
    • Events
      • Unit - A unit enters Pallet Town Oaks Lab <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pokemon Trainer
    • Actions
      • Trigger - Turn off Oaks Lab Exit <gen>
      • Set TempPoint1 = (Center of Oaks Lab Entrance <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Trigger - Turn on Oaks Lab Exit <gen>
 
Last edited:
Level 16
Joined
Mar 27, 2011
Messages
1,349
Adding a wait timer does the trick. I'll have to use Timers or some other system to ensure this works properly in a multiplayer environment. Thanks for your help.

Edit: This seemed like the easiest way to implement the fix for my map. Shared for anyone who's interested.

  • Pallet Oaks Lab
    • Events
      • Unit - A unit enters Pallet Town Oaks Lab <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pokemon Trainer
      • (Remaining time for TraverseDelay[(Player number of (Triggering player))]) Less than or equal to 0.00
    • Actions
      • Countdown Timer - Start TraverseDelay[(Player number of (Triggering player))] as a One-shot timer that will expire in 0.10 seconds
      • Set TempPoint1 = (Center of Oaks Lab Entrance <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
  • Oaks Lab Exit
    • Events
      • Unit - A unit enters Oaks Lab Entrance <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pokemon Trainer
      • (Remaining time for TraverseDelay[(Player number of (Triggering player))]) Less than or equal to 0.00
    • Actions
      • Countdown Timer - Start TraverseDelay[(Player number of (Triggering player))] as a One-shot timer that will expire in 0.10 seconds
      • Set TempPoint1 = (Center of Pallet Town Oaks Lab <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
4,994
You could do it without the timer array if a 0.00 timeout works (as I imagine it will).

  • Enable Trigger
    • Events
      • Time - TraverseDelay expires
    • Conditions
    • Actions
      • Trigger - Turn on Pallet Oaks Lab <gen>
      • Trigger - Turn on Oaks Lab Exit <gen>
      • Trigger - Turn on othertrig1 <gen>
      • Trigger - Turn on othertrig2 <gen>
      • Trigger - Turn on othertrig3 <gen>
      • -------- Add all region-move triggers to this list
  • Pallet Oaks Lab
    • Events
      • Unit - A unit enters Pallet Town Oaks Lab <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pokemon Trainer
    • Actions
      • Trigger - Turn off Oaks Lab Exit <gen>
      • Set TempPoint1 = (Center of Oaks Lab Entrance <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Countdown Timer - Start TraverseDelay as a One-shot timer that will expire in 0.00 seconds
  • Oaks Lab Exit
    • Events
      • Unit - A unit enters Oaks Lab Entrance <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pokemon Trainer
    • Actions
      • Trigger - Turn on Pallet Oaks Lab <gen>
      • Set TempPoint1 = (Center of Pallet Town Oaks Lab <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Countdown Timer - Start TraverseDelay as a One-shot timer that will expire in 0.00 seconds
 
Status
Not open for further replies.
Top