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..
This triger dont have mark on initially on (Init TimerD)
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
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