• 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.

Infinite Trigger Execution

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,348
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,348
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 45
Joined
Feb 27, 2007
Messages
5,578
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