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

[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?
 
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
 
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.
 
...
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.
Back
Top