Spawn and Timers..

velnias

New Member
Reaction score
13
I'm making a solo TD and I need help on its spawn and timer triggers:
1. The spawning is complicated- every round (except boss rounds) 2 types of units should spawn for each player. During boss rounds only 1 unit spawns. First round starts in 40 seconds, then a spawn starts in 20 secs after the player kills all his creeps from the previous round (so it's kinda like a race)
I've tried various triggers and none of the seem to work correctly. So I need a brand new one here
2. Timer. Every player should have a timer that shows only his spawn time.
Help please, thank you !


here is trigers..

Code:
Set Levels
    Events
        Map initialization
    Conditions
    Actions
        -------- Level 1 --------
        Set EnemyType[1] = Wave 1 Frog
        Set EnemyType2[1] = Wave 1 Frog with Aura
        Set EnemyCount[1] = 19
        Set EnemyCount2[1] = 1
        -------- Level 2 --------
        Set EnemyType[2] = Wave 2 Woman
        Set EnemyType2[2] = Wave 2 Woman with Aura
        Set EnemyCount[2] = 19
        Set EnemyCount2[2] = 1
        -------- Level 3 --------
        Set EnemyType[3] = Wave 3 Soldier
        Set EnemyType2[3] = Wave 3 Soldier with Aura
        Set EnemyCount[3] = 19
        Set EnemyCount2[3] = 1
        -------- Level 4 --------
        Set EnemyType[4] = Wave 4 Magician
        Set EnemyType2[4] = Wave 4 Magician With Aura
        Set EnemyCount[4] = 19
        Set EnemyCount2[4] = 1
        -------- Level 5 --------
        Set EnemyType[5] = Wave 5 Raider
        Set EnemyType2[5] = Wave 5 Raider With Aura
        Set EnemyCount[5] = 19
        Set EnemyCount2[5] = 1
and...

Code:
Spawn
    Events
        Time - Elapsed game time is 30.00 seconds
    Conditions
    Actions
        Countdown Timer - Destroy (Last created timer window)
        Game - Display to Player Group - Player 1 (Red) the text: Here we go!  Level ...
        Set LevelNumberR = (LevelNumberR + 1)
        For each (Integer A) from 1 to EnemyCount[LevelNumberR], do (Actions)
            Loop - Actions
                Player Group - Pick every player in Defenders and do (Actions)
                    Loop - Actions
                        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType[LevelNumberR] for Player 12 (Brown) at Temp_Start[1] facing Default building facing degrees) else do (Do nothing)
                        If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType[LevelNumberR] for Player 12 (Brown) at Temp_Start[2] facing Default building facing degrees) else do (Do nothing)
                        Wait 0.30 seconds
        For each (Integer A) from 1 to EnemyCount2[LevelNumberR], do (Actions)
            Loop - Actions
                Player Group - Pick every player in Defenders and do (Actions)
                    Loop - Actions
                        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType2[LevelNumberR] for Player 12 (Brown) at Temp_Start[1] facing Default building facing degrees) else do (Do nothing)
                        If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType2[LevelNumberR] for Player 12 (Brown) at Temp_Start[2] facing Default building facing degrees) else do (Do nothing)
                        Wait 0.30 seconds
        [U]Trigger - Run Init TimerE <gen>[/U] (ignoring conditions)

Code:
[U]Init TimerE[/U]
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    Loop - Actions
                        Unit Group - Add (Entering unit) to TempGroupR[(Integer A)]
                        [U]Trigger - Turn on Init TimerD <gen>[/U]

This triger dont have mark on initially on (Init TimerD)

Code:
[U]Init TimerD[/U]    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Dying unit)) Equal to Player 12 (Brown)
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Unit Group - Remove (Dying unit) from TempGroupR[Player_Number]
        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
                        (Number of units in TempGroupR[(Integer A)]) Equal to 0
                    Then - Actions
                        Countdown Timer - Create a timer window for SpawnTimerR with title Next spawn in:
                        Countdown Timer - [U]Start SpawnTimerR [/U]as a One-shot timer that will expire in 20.00 seconds
                    Else - Actions

Code:
Spawn2
    Events
        [U]Time - SpawnTimerR expires[/U]
    Conditions
    Actions
        Set LevelNumberR = (LevelNumberR + 1)
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Player - Add (KillsR[(Integer A)] / 5) to (Player((Integer A))) Current gold
                Game - Display to (Player group((Player((Integer A))))) the text: (|cffffcc00You recieved |r + ((String((KillsR[(Integer A)] / 5))) + |cffffcc00 gold for completing level. |r))
                Countdown Timer - Destroy (Last created timer window)
                Wait 1.00 seconds
                Game - Display to (Player group((Player((Integer A))))) the text: (|cffff0000Level |r + ((String(LevelNumberR)) + |cffff0000 is attacking!|r))
        For each (Integer A) from 1 to EnemyCount[LevelNumberR], do (Actions)
            Loop - Actions
                Player Group - Pick every player in Defenders and do (Actions)
                    Loop - Actions
                        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType[LevelNumberR] for Player 12 (Brown) at Temp_Start[1] facing Default building facing degrees) else do (Do nothing)
                        If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType[LevelNumberR] for Player 12 (Brown) at Temp_Start[2] facing Default building facing degrees) else do (Do nothing)
                        Wait 0.30 seconds
        For each (Integer A) from 1 to EnemyCount2[LevelNumberR], do (Actions)
            Loop - Actions
                Player Group - Pick every player in Defenders and do (Actions)
                    Loop - Actions
                        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType2[LevelNumberR] for Player 12 (Brown) at Temp_Start[1] facing Default building facing degrees) else do (Do nothing)
                        If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType2[LevelNumberR] for Player 12 (Brown) at Temp_Start[2] facing Default building facing degrees) else do (Do nothing)
                        Wait 0.30 seconds
        Trigger - Run Init TimerE <gen> (ignoring conditions)

Code:
Functions
    Events
        Map initialization
    Conditions
    Actions
        Set Temp_Start[1] = (Center of Red Start <gen>)
        Set Temp_Start[2] = (Center of Blue Start <gen>)
        Set Temp_Start[3] = (Center of Teal Start <gen>)
        Set Temp_Start[4] = (Center of Purple Start <gen>)
        Set Temp_Start[5] = (Center of Yellow Start <gen>)
        Set Temp_Start[6] = (Center of Orange Start <gen>)
        Set Temp_Start[7] = (Center of Green Start <gen>)
        Set Temp_Start[8] = (Center of Pink Start <gen>)

EDIT:The problem now is that a total of 40 units spawn instead of 20 for both players. 2nd problem- both units must wait until all creeps are killed before the start of next wave.

help pls wat i do wrong
 

Tom Jones

N/A
Reaction score
437
Here's how I would do it:
Code:
Variables:
Spawn_Timers timer array size equal to number of players 
Spawn_Current group array size equal to number of players
Spawn_Region region array size equal to number of players
Spawn_Level integer array size equal to number of players
Spawn_TempPoint point

Spawn_Count integer array size equal to number of levels
Spawn_Id unit type array size equal to number of levels
Spawn_Count2 integer array size equal to number of levels
Spawn_Id2 unit type array size equal to number of levels
Code:
Spawn Start
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Countdown Timer - Start Spawn_Timers[(Integer A)] as a One-shot timer that will expire in 40.00 seconds
Code:
Spawn Create
    Events
        Time - Spawn_Timers[1] expires
        Time - Spawn_Timers[2] expires
        Time - Spawn_Timers[3] expires
        Time - Spawn_Timers[4] expires
        Time - Spawn_Timers[5] expires
        Time - Spawn_Timers[6] expires
        Time - Spawn_Timers[7] expires
        Time - Spawn_Timers[9] expires
        Time - Spawn_Timers[10] expires
        Time - Spawn_Timers[11] expires
        Time - Spawn_Timers[12] expires
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Remaining time for Spawn_Timers[(Integer A)]) Less than or equal to 0.00
                        Or - Any (Conditions) are true
                            Conditions
                                (All units of Spawn_Current[(Integer A)] are dead) Equal to True
                                (Spawn_Current[(Integer A)] is empty) Equal to True
                    Then - Actions
                        Set Spawn_Level[(Integer A)] = (Spawn_Level[(Integer A)] + 1)
                        Set Spawn_TempPoint = (Center of Spawn_Region[(Integer A)])
                        Unit Group - Remove all units from Spawn_Current[(Integer A)]
                        Unit - Create Spawn_Count[Spawn_Level[(Integer A)]] Spawn_Id[Spawn_Level[(Integer A)]] for Player 1 (Red) at Spawn_TempPoint facing Default building facing degrees
                        Unit Group - Add all units of (Last created unit group) to Spawn_Current[(Integer A)]
                        Unit - Create Spawn_Count2[Spawn_Level[(Integer A)]] Spawn_Id2[Spawn_Level[(Integer A)]] for Player 1 (Red) at Spawn_TempPoint facing Default building facing degrees
                        Unit Group - Add all units of (Last created unit group) to Spawn_Current[(Integer A)]
                        Custom script:   call RemoveLocation(udg_Spawn_TempPoint) *Memory leak removal*
                        Custom script:   exitwhen true //*Exits the For Each Integer loop*
                    Else - Actions
Code:
Spawn Death
    Events
        Unit - A unit Dies
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) is in Spawn_Current[(Integer A)]) Equal to True
                        (All units of Spawn_Current[(Integer A)] are dead) Equal to True
                    Then - Actions
                        Countdown Timer - Start Spawn_Timers[(Integer A)] as a One-shot timer that will expire in 20.00 seconds
                    Else - Actions
Obviously you should also have a trigger that sets all the level variables to their respective values, but I didn't bother making one (It could be implemented in the Spawn Start trigger).
 

velnias

New Member
Reaction score
13
Thank you, your triggers work, but I encountered 3 problems:


1. I can't see the Countdown Timers in-game, but I know that they work because the next level spawns.

2 Units spawn in all regions, I tried doing this:

Code:
Spawn Start
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        -------- Level 1 --------
        Set Spawn_Level[0] = 1
        Set Spawn_Id[Spawn_Level[0]] = Wave 1 Frog
        Set Spawn_Count[Spawn_Level[0]] = 19
        Set Spawn_Id2[Spawn_Level[0]] = Wave 1 Frog with Aura
        Set Spawn_Count2[Spawn_Level[0]] = 1
        -------- Level 2 --------
        Set Spawn_Level[0] = 2
        Set Spawn_Id[Spawn_Level[0]] = Wave 2 Woman
        Set Spawn_Count[Spawn_Level[0]] = 19
        Set Spawn_Id2[Spawn_Level[0]] = Wave 2 Woman with Aura
        Set Spawn_Count2[Spawn_Level[0]] = 1
        -------- Etc. --------
        -------- Spawn regions --------
        Set Spawn_Region[1] = Red Start <gen>
        Set Spawn_Region[2] = Blue Start <gen>
        Set Spawn_Region[3] = Teal Start <gen>
        Set Spawn_Region[4] = Purple Start <gen>
        Set Spawn_Region[5] = Yellow Start <gen>
        Set Spawn_Region[6] = Orange Start <gen>
        Set Spawn_Region[7] = Green Start <gen>
        Set Spawn_Region[8] = Pink Start <gen>
        -------- Etc. --------
      [U][B]  -------- Spawn Players --------
        Set Spawn_Player[1] = Player 1 (Red)
        Set Spawn_Player[2] = Player 2 (Blue)
        Set Spawn_Player[3] = Player 3 (Teal)
        Set Spawn_Player[4] = Player 4 (Purple)
        Set Spawn_Player[5] = Player 5 (Yellow)
        Set Spawn_Player[6] = Player 6 (Orange)
        Set Spawn_Player[7] = Player 7 (Green)
        Set Spawn_Player[8] = Player 8 (Pink)[/B][/U]      
        -------- Etc. --------
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Countdown Timer - Start Spawn_Timers[(Integer A)] as a One-shot timer that will expire in 40.00 seconds

Code:
Spawn Create
    Events
        Time - Spawn_Timers[1] expires
        Time - Spawn_Timers[2] expires
        Time - Spawn_Timers[3] expires
        Time - Spawn_Timers[4] expires
        Time - Spawn_Timers[5] expires
        Time - Spawn_Timers[6] expires
        Time - Spawn_Timers[7] expires
        Time - Spawn_Timers[8] expires
    Conditions
    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
                        (Remaining time for Spawn_Timers[(Integer A)]) Less than or equal to 0.00
                        Or - Any (Conditions) are true
                            Conditions
                                (All units of Spawn_Current[(Integer A)] are dead) Equal to True
                                (Spawn_Current[(Integer A)] is empty) Equal to True
                               [U][B] (Spawn_Player[(Integer A)] slot status) Equal to Is playing[/B][/U]                    Then - Actions
                        Set Spawn_Level[(Integer A)] = (Spawn_Level[(Integer A)] + 1)
                        Set Spawn_TempPoint = (Center of Spawn_Region[(Integer A)])
                        Unit Group - Remove all units from Spawn_Current[(Integer A)]
                        Unit - Create Spawn_Count[Spawn_Level[(Integer A)]] Spawn_Id[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees
                        Unit Group - Add all units of (Last created unit group) to Spawn_Current[(Integer A)]
                        Unit - Create Spawn_Count2[Spawn_Level[(Integer A)]] Spawn_Id2[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees
                        Unit Group - Add all units of (Last created unit group) to Spawn_Current[(Integer A)]
                        Custom script:   call RemoveLocation(udg_Spawn_TempPoint)
                        Custom script:   exitwhen true
                    Else - Actions

But when I've done that, all waves started going all at once (all waves go out during the first round)

3. Because of 20 units spawning at once, there is a 2 second delay (lag) during the spawn. I would like it to be changed so that units spawn one after another with 0,3 sec gaps.
 

Tom Jones

N/A
Reaction score
437
1. I can't see the Countdown Timers in-game, but I know that they work because the next level spawns.
Add the bolded parts:
Code:
Part of the Spawn Start trigger:
For each (Integer A) from 1 to 12, do (Actions)
    Loop - Actions
        Countdown Timer - Start Spawn_Timers[(Integer A)] as a One-shot timer that will expire in 40.00 seconds
[B]        Countdown Timer - Create a timer window for (Last started timer) with title Time 'till next spa...[/B]
[B]        Countdown Timer - Hide (Last created timer window)
        Countdown Timer - Show (Last created timer window) for (Player((Integer A)))
        Set Spawn_TimerWindow[(Integer A)] = (Last created timer window)[/B]
Code:
Part of the Spawn Create trigger:
Then - Actions
    Set Spawn_Level[(Integer A)] = (Spawn_Level[(Integer A)] + 1)
    Set Spawn_TempPoint = (Center of Spawn_Region[(Integer A)])
[B]    Countdown Timer - Hide Spawn_TimerWindow[(Integer A)] for (Player((Integer A)))[/B]
    Unit Group - Remove all units from Spawn_Current[(Integer A)]
    Unit - Create Spawn_Count[Spawn_Level[(Integer A)]] Spawn_Id[Spawn_Level[(Integer A)]] for Player 1 (Red) at Spawn_TempPoint facing Default building facing degrees
    Unit Group - Add all units of (Last created unit group) to Spawn_Current[(Integer A)]
    Unit - Create Spawn_Count2[Spawn_Level[(Integer A)]] Spawn_Id2[Spawn_Level[(Integer A)]] for Player 1 (Red) at Spawn_TempPoint facing Default building facing degrees
    Unit Group - Add all units of (Last created unit group) to Spawn_Current[(Integer A)]
    Custom script:   call RemoveLocation(udg_Spawn_TempPoint)
    Custom script:   exitwhen true
Code:
Spawn Death
    Events
        Unit - A unit Dies
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) is in Spawn_Current[(Integer A)]) Equal to True
                        (All units of Spawn_Current[(Integer A)] are dead) Equal to True
                    Then - Actions
                        Countdown Timer - Start Spawn_Timers[(Integer A)] as a One-shot timer that will expire in 20.00 seconds
[B]                        Countdown Timer - Show Spawn_TimerWindow[(Integer A)] for (Player((Integer A)))[/B]
                    Else - Actions
Use the action Change Timer Window Title if you want to change the timer windows description during the game.
2 Units spawn in all regions, I tried doing this:
Do this instead:
Code:
Part of Spawn Start trigger:
For each (Integer A) from 1 to 12, do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
[B]            If - Conditions
                ((Player((Integer A))) slot status) Equal to Is playing
                ((Player((Integer A))) controller) Equal to User
            Then - Actions[/B]
                Countdown Timer - Start Spawn_Timers[(Integer A)] as a One-shot timer that will expire in 40.00 seconds
                Countdown Timer - Create a timer window for (Last started timer) with title Time 'till next spa...
                Countdown Timer - Hide (Last created timer window)
                Countdown Timer - Show (Last created timer window) for (Player((Integer A)))
                Set Spawn_TimerWindow[(Integer A)] = (Last created timer window)
[B]            Else - Actions[/B]
3. Because of 20 units spawning at once, there is a 2 second delay (lag) during the spawn. I would like it to be changed so that units spawn one after another with 0,3 sec gaps.
Add the bolded parts:
Code:
Part of Spawn Create trigger:
Then - Actions
    Set Spawn_Level[(Integer A)] = (Spawn_Level[(Integer A)] + 1)
    Set Spawn_TempPoint = (Center of Spawn_Region[(Integer A)])
    Countdown Timer - Hide Spawn_TimerWindow[(Integer A)] for (Player((Integer A)))
    Unit Group - Remove all units from Spawn_Current[(Integer A)]
[B]    For each (Integer A) from 1 to Spawn_Count[Spawn_Level[(Integer A)]], do (Actions)
        Loop - Actions
            Unit - Create 1 Spawn_Id[Spawn_Level[(Integer A)]] for Player 1 (Red) at Spawn_TempPoint facing Default building facing degrees
            Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
            Wait 0.30 seconds
    For each (Integer A) from 1 to Spawn_Count2[Spawn_Level[(Integer A)]], do (Actions)
        Loop - Actions
            Unit - Create 1 Spawn_Id2[Spawn_Level[(Integer A)]] for Player 1 (Red) at Spawn_TempPoint facing Default building facing degrees
            Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
            Wait 0.30 seconds[/B]
    Custom script:   call RemoveLocation(udg_Spawn_TempPoint)
    Custom script:   exitwhen true
I've updated the map in my previous post just in case.
 

velnias

New Member
Reaction score
13
thanks again :p
But i have 1 problem
Code:
Spawn Create
    Events
        Time - Spawn_Timers[1] expires
        Time - Spawn_Timers[2] expires
        Time - Spawn_Timers[3] expires
        Time - Spawn_Timers[4] expires
        Time - Spawn_Timers[5] expires
        Time - Spawn_Timers[6] expires
        Time - Spawn_Timers[7] expires
        Time - Spawn_Timers[8] expires
    Conditions
    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
                        (Remaining time for Spawn_Timers[(Integer A)]) Less than or equal to 0.00
                        Or - Any (Conditions) are true
                            Conditions
                                (All units of Spawn_Current[(Integer A)] are dead) Equal to True
                                (Spawn_Current[(Integer A)] is empty) Equal to True
                    Then - Actions
                        Set Spawn_Level[(Integer A)] = (Spawn_Level[(Integer A)] + 1)
                        Set Spawn_TempPoint = (Center of Spawn_Region[(Integer A)])
                        Countdown Timer - Hide Spawn_TimerWindow[(Integer A)] for (Player((Integer A)))
                        Unit Group - Remove all units from Spawn_Current[(Integer A)]
[B]                        For each (Integer A) from 1 to Spawn_Count[Spawn_Level[(Integer A)]], do (Actions)
                            Loop - Actions
                                Unit - Create 1 Spawn_Id[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees
                                Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
                                Wait 0.30 seconds
                        For each (Integer A) from 1 to Spawn_Count2[Spawn_Level[(Integer A)]], do (Actions)
                            Loop - Actions
                                Unit - Create 1 Spawn_Id2[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees
                                Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
                                Wait 0.30 seconds[/B]
                        Custom script:   call RemoveLocation(udg_Spawn_TempPoint)
                        Custom script:   exitwhen true
                    Else - Actions

Dont know why but this triger create only 1 unit and then waiting 5 sec after 5 sec create unit spawn_id2.
All wave = 2 units :/
I tried test your "spawn example" but its work same.

Sry for bad english :p
 

velnias

New Member
Reaction score
13
Code:
 -------- Level 1 --------
        Set Spawn_Level[0] = 1
        Set Spawn_Id[Spawn_Level[0]] = Wave 1 Frog
        Set Spawn_Count[Spawn_Level[0]] = 19
        Set Spawn_Id2[Spawn_Level[0]] = Wave 1 Frog with Aura
        Set Spawn_Count2[Spawn_Level[0]] = 1
        -------- Level 2 --------
        Set Spawn_Level[0] = 2
        Set Spawn_Id[Spawn_Level[0]] = Wave 2 Woman
        Set Spawn_Count[Spawn_Level[0]] = 19
        Set Spawn_Id2[Spawn_Level[0]] = Wave 2 Woman with Aura
        Set Spawn_Count2[Spawn_Level[0]] = 1


Code:
Spawn Create
    Events
        Time - Spawn_Timers[1] expires
        Time - Spawn_Timers[2] expires
        Time - Spawn_Timers[3] expires
        Time - Spawn_Timers[4] expires
        Time - Spawn_Timers[5] expires
        Time - Spawn_Timers[6] expires
        Time - Spawn_Timers[7] expires
        Time - Spawn_Timers[8] expires
    Conditions
    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
                        (Remaining time for Spawn_Timers[(Integer A)]) Less than or equal to 0.00
                        Or - Any (Conditions) are true
                            Conditions
                                (All units of Spawn_Current[(Integer A)] are dead) Equal to True
                                (Spawn_Current[(Integer A)] is empty) Equal to True
                    Then - Actions
                        Set Spawn_Level[(Integer A)] = (Spawn_Level[(Integer A)] + 1)
                        Set Spawn_TempPoint = (Center of Spawn_Region[(Integer A)])
                        Countdown Timer - Hide Spawn_TimerWindow[(Integer A)] for (Player((Integer A)))
                        Unit Group - Remove all units from Spawn_Current[(Integer A)]
                        [B][U]For each (Integer A) from 1 to Spawn_Count[Spawn_Level[(Integer A)]], do (Actions)
                            Loop - Actions
                                Unit - Create 1 Spawn_Id[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees
                                Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
                                Wait 0.30 seconds
                        For each (Integer A) from 1 to Spawn_Count2[Spawn_Level[(Integer A)]], do (Actions)
                            Loop - Actions
                                Unit - Create 1 Spawn_Id2[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees[/U][/B]
                                Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
                                Wait 0.30 seconds
                        Custom script:   call RemoveLocation(udg_Spawn_TempPoint)
                        Custom script:   exitwhen true
                    Else - Actions

I would like it to make units spawn one after another with 0,3 sec gaps.
This trigger dont work like i want ( he spawn 1 unit in Spawn_Count ).
 

TheCrystal

New Member
Reaction score
36
You need to add a water after the Spawning of the units.
Code:
Loop - Actions
                                Unit - Create 1 Spawn_Id2[Spawn_Level[(Integer A)]] for Player 12 (Brown) at Spawn_TempPoint facing Default building facing degrees
                                Unit Group - Add (Last created unit) to Spawn_Current[(Integer A)]
                                Wait 0.30 seconds

Add a wait after that, because it spawns the unit but then it immediately removes the point, atleast thats what I believe.
 

velnias

New Member
Reaction score
13
nahh i fixed this problem :)

need change this:
Code:
For each (Integer A) from 1 to Spawn_Count[Spawn_Level[(Integer A)]], do (Actions)

to this:
Code:
For each (Integer B) from 1 to Spawn_Count[Spawn_Level[(Integer A)]], do (Actions)
 
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