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

[Trigger] Infinite Loop, help!

Status
Not open for further replies.
Level 3
Joined
Jun 23, 2007
Messages
28
  • Spawn
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveLevelAmount[WaveLevel] Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WaveLevelAmount[WaveLevel] Equal to 6
            • Then - Actions
              • -------- BossSpawns --------
              • Countdown Timer - Start WaveTimer as a One-shot timer that will expire in 45.00 seconds
              • Countdown Timer - Create a timer window for WaveTimer with title (Level + ((String(WaveLevel)) + in:))
              • Set WaveTimerWindow = (Last created timer window)
              • Wait 45.00 seconds
              • Countdown Timer - Destroy WaveTimerWindow
              • Game - Display to (All players) the text: (((Bosswave + (String(WaveLevel))) + incoming: ) + ((String(WaveLevelAmount[WaveLevel])) + ( + (String(WaveUnitType[WaveLevel])))))
              • For each (Integer A) from 1 to WaveLevelAmount[WaveLevel], do (Actions)
                • Loop - Actions
                  • Unit - Create 1 WaveUnitType[WaveLevel] for Player 8 (Pink) at (Center of Bosspawn <gen>) facing 250.00 degrees
                  • Unit - Order (Last created unit) to Attack-Move To (Center of Mob attack <gen>)
                  • Wait 0.50 seconds
            • Else - Actions
              • -------- MobSpawns --------
              • Countdown Timer - Start WaveTimer as a One-shot timer that will expire in 30.00 seconds
              • Countdown Timer - Create a timer window for WaveTimer with title (Level + ((String(WaveLevel)) + in:))
              • Set WaveTimerWindow = (Last created timer window)
              • Wait 30.00 seconds
              • Countdown Timer - Destroy WaveTimerWindow
              • Game - Display to (All players) the text: (((Wave + (String(WaveLevel))) + incoming: ) + ((String(WaveLevelAmount[WaveLevel])) + ( + (String(WaveUnitType[WaveLevel])))))
              • For each (Integer A) from 1 to WaveLevelAmount[WaveLevel], do (Actions)
                • Loop - Actions
                  • Unit - Create 1 WaveUnitType[WaveLevel] for Player 8 (Pink) at (Center of Mob spawn <gen>) facing 180.00 degrees
                  • Unit - Order (Last created unit) to Attack-Move To (Center of Mob attack <gen>)
                  • Wait InternalWaveSpawnDelay seconds
      • Set WaveLevel = (WaveLevel + 1)
      • Trigger - Run (This trigger) (checking conditions)
I can't for the world figure out why this loop is infinite and crashes the game.
Anyhow, the WaveLevelAmount is an Array that is defined from 1-7 for example, and then when WaveLevel hits 8 it should contain 0 and therefor quit the loop. But I don't see that happening. Anyone got any clues?
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
Poot, he wants the trigger NOT to loop infinite times, since that is what it is doing

i just needed to say that, and im currently looking into it :p

Edit : Have you made a Set WaveLevelAmount[8] = 0? that might be the problem, that the default value is only working on they WaveLevelAmount[1-7]

try that, and say if its not working
 
Level 3
Joined
Jun 23, 2007
Messages
28
the default value is set to 0 so it should work, but as you said, I've also tried to set WaveLevelAmount[8] to 0 just in case. But no good.
 
Level 27
Joined
May 30, 2007
Messages
2,872
...
Trigger - Turn off (This trigger)
...
Trigger - Run (This trigger) (checking conditions)
When you use:
Trigger - Turn off SomeTrigger
SomeTrigger will not be run from it's events.
Triggers can be run without being on.
Here's the solution:
  • Spawn
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveLevelAmount[WaveLevel] Not equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WaveLevelAmount[WaveLevel] Equal to 6
            • Then - Actions
              • -------- BossSpawns --------
              • Countdown Timer - Start WaveTimer as a One-shot timer that will expire in 45.00 seconds
              • Countdown Timer - Create a timer window for WaveTimer with title (Level + ((String(WaveLevel)) + in:))
              • Set WaveTimerWindow = (Last created timer window)
              • Wait 45.00 seconds
              • Countdown Timer - Destroy WaveTimerWindow
              • Game - Display to (All players) the text: (((Bosswave + (String(WaveLevel))) + incoming: ) + ((String(WaveLevelAmount[WaveLevel])) + ( + (String(WaveUnitType[WaveLevel])))))
              • For each (Integer A) from 1 to WaveLevelAmount[WaveLevel], do (Actions)
                • Loop - Actions
                  • Unit - Create 1 WaveUnitType[WaveLevel] for Player 8 (Pink) at (Center of Bosspawn <gen>) facing 250.00 degrees
                  • Unit - Order (Last created unit) to Attack-Move To (Center of Mob attack <gen>)
                  • Wait 0.50 seconds
            • Else - Actions
              • -------- MobSpawns --------
              • Countdown Timer - Start WaveTimer as a One-shot timer that will expire in 30.00 seconds
              • Countdown Timer - Create a timer window for WaveTimer with title (Level + ((String(WaveLevel)) + in:))
              • Set WaveTimerWindow = (Last created timer window)
              • Wait 30.00 seconds
              • Countdown Timer - Destroy WaveTimerWindow
              • Game - Display to (All players) the text: (((Wave + (String(WaveLevel))) + incoming: ) + ((String(WaveLevelAmount[WaveLevel])) + ( + (String(WaveUnitType[WaveLevel])))))
              • For each (Integer A) from 1 to WaveLevelAmount[WaveLevel], do (Actions)
                • Loop - Actions
                  • Unit - Create 1 WaveUnitType[WaveLevel] for Player 8 (Pink) at (Center of Mob spawn <gen>) facing 180.00 degrees
                  • Unit - Order (Last created unit) to Attack-Move To (Center of Mob attack <gen>)
                  • Wait InternalWaveSpawnDelay seconds
          • Set WaveLevel = (WaveLevel + 1)
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
 
Status
Not open for further replies.
Top