Hey,
I am trying to make a defensive map, where there will be coming waves 1 by 1. The next wave will not come before the existing wave has been slain.
I know the error in this trigger, but I can't find the solution to fix it. When the last enemy of the wave is slain, both trigger 2 and trigger 3 will activate.
Trigger 2 and trigger 3 is constructed the same way, but with a condition requiring the variable:
I am trying to make a defensive map, where there will be coming waves 1 by 1. The next wave will not come before the existing wave has been slain.
I know the error in this trigger, but I can't find the solution to fix it. When the last enemy of the wave is slain, both trigger 2 and trigger 3 will activate.
Trigger 2 and trigger 3 is constructed the same way, but with a condition requiring the variable:
-
Invade_Wave_Integer Equal to 2
-
Invaders Wave 1
-
Events
-
Time - Elapsed game time is 2.00 seconds
-
-
Conditions
-
Actions
-
Set Invade_Count = 0
-
Set Invade_Wave_Integer = (Invade_Wave_Integer + 1)
-
Countdown Timer - Start A_Timer as a One-shot timer that will expire in (Real(Wave_Timer)) seconds
-
Countdown Timer - Create a timer window for A_Timer with title (Wave + ((String(Invade_Wave_Integer)) + :))
-
Set A_Timer_Window = (Last created timer window)
-
Wait (Real(Wave_Timer)) seconds
-
Countdown Timer - Destroy A_Timer_Window
-
Game - Display to (All players) the text: (Wave + ((String(Invade_Wave_Integer)) + has spawned!))
-
-------- Spawns --------
-
Unit - Create 1 Ghoul for Player 12 (Brown) at Invade_Point facing Default building facing degrees
-
-------- --------
-
Unit Group - Pick every unit in (Units in Invade_Spawn) and do (Actions)
-
Loop - Actions
-
Set A_Unit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of A_Unit) Equal to Player 12 (Brown)
-
(A_Unit is A structure) Not equal to True
-
(A_Unit is dead) Not equal to True
-
-
Then - Actions
-
Unit Group - Add A_Unit to Invade_Group
-
Set Invade_Count = (Invade_Count + 1)
-
-
Else - Actions
-
-
-
-
-
-
Invaders Wave 2
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
-
((Triggering unit) is A structure) Not equal to True
-
((Triggering unit) is in Invade_Group) Equal to True
-
Invade_Wave_Integer Equal to 1
-
-
Actions
-
Set A_Unit = (Triggering unit)
-
Set Invade_Count = (Invade_Count - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Invade_Count Less than or equal to 0
-
-
Then - Actions
-
Set Invade_Wave_Integer = (Invade_Wave_Integer + 1)
-
Countdown Timer - Start A_Timer as a One-shot timer that will expire in (Real(Wave_Timer)) seconds
-
Countdown Timer - Create a timer window for A_Timer with title (Wave + ((String(Invade_Wave_Integer)) + :))
-
Set A_Timer_Window = (Last created timer window)
-
Wait (Real(Wave_Timer)) seconds
-
Game - Display to (All players) the text: (Wave + ((String(Invade_Wave_Integer)) + has spawned!))
-
Countdown Timer - Destroy A_Timer_Window
-
-------- Spawns --------
-
Unit - Create 2 Ghoul for Player 12 (Brown) at Invade_Point facing Default building facing degrees
-
-------- --------
-
Unit Group - Pick every unit in (Units in Invade_Spawn) and do (Actions)
-
Loop - Actions
-
Set A_Unit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of A_Unit) Equal to Player 12 (Brown)
-
(A_Unit is A structure) Not equal to True
-
(A_Unit is dead) Not equal to True
-
-
Then - Actions
-
Unit Group - Add A_Unit to Invade_Group
-
Set Invade_Count = (Invade_Count + 1)
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-