Trouble with spawn trigger

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
Okay so the trigger is supposed to run in a loop "For each integer a 1 to variable"
but the loop only runs once.. any ideas?

Code:
Spawn
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to NumWaves[Level], do (Actions)
            Loop - Actions
                For each (Integer A) from 1 to 8, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Player((Integer A))) controller) Equal to User
                                ((Player((Integer A))) slot status) Equal to Is playing
                            Then - Actions
                                Unit - Create NumSpawn[Level] MonType[Level] for Player 12 (Brown) at (Center of regions[(Integer A)]) facing Default building facing degrees
                                Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
                                    Loop - Actions
                                        Unit - Set life of (Picked unit) to ((Power((Real(CosmeticLevel)), 2.00)) + 3.00)
                                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) x bossmodifier[Level])
                            Else - Actions
                                Do nothing

The second loop inside the primary loop is for the amount of players 1 through 8.
 

jonadrian619

-___-
Reaction score
240
I think NumWaves[Level] is set to 1 that's why the loop only runs once. Set NumWaves to a different integer, like 5 or so.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Seems about normal, the second run overwrites the ending conditions of the first one.
Which is one of the reasons there's also a "For each Integer B"...


> I think NumWaves[Level] is set to 1

Stop thinking and have a look instead (menu: Edit / Convert to custom script).
With sufficiently motivated looking, you may notice that "Integer A" loops use a set of global variables for running.
 

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
Seems about normal, the second run overwrites the ending conditions of the first one.
Which is one of the reasons there's also a "For each Integer B"...


> I think NumWaves[Level] is set to 1

Stop thinking and have a look instead (menu: Edit / Convert to custom script).
With sufficiently motivated looking, you may notice that "Integer A" loops use a set of global variables for running.

Okay i tried to change the second loop to an integer b, but not nothing spawns at all.
Could you elaborate a bit on what you said?

-----
Never mind, I was just being stupid, still using (integer a) in the conditions under the integer b loop. Works as it should now, thanks
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top