Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Events
Time - Every 50 seconds of the game
Conditions
Actions
Unit - Create 3 Ghoul for Player 7 (Green) at (Center of Scourage middle spawn <gen>) facing Default building facing degrees
Wait 0.01 seconds
Unit - Create 1 Necromancer for Player 7 (Green) at (Center of Scourage middle spawn <gen>) facing Default building facing degrees
Wait 0.01 seconds
Unit Group - Pick every unit in (Units in Scourage middle spawn <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of Middle of map <gen>))
Each wave can come after each amount of time, for example 1 wave comes after 50 seconds, the next wave comes after 80 seconds.
Like this: Time elapsed - 50 seconds
Spawn Units for Player 1

Events

Conditions


Player Slot Status of Player 1 equal to Is Playing

Actions


Set - TempLocation to center of Player1sSpawningRegion


Unit - Create (unit type of (Amount[CurrentLevel])) units of type (unit type of (UnitType[CurrentLevel])) for (Neutral Hostile) at (TempLocation) facing default building facing degrees


Set NumOfUnits to (Arithmetic(NumOfUnits + Amount[CurrentLevel]))


Custom Script(call RemoveLocation(udg_TempLocation))


Custom Script(set bj_wantDestroyGroup = true)


Set - TempLocation to center of (First checkpoint in player 1's path)


Unit Group - Pick every unit in (Player1sSpawningRegion) and do if ((owner of (Picked Unit) equal to (Neutral Hostile)) then (order (Picked Unit) to (Move) to (TempLocation)) else (do Nothing))


Custom Script - (call RemoveLocation(udg_TempLocation))
Map Initialization

Events


Map Initialization

Conditions

Actions


Comment - set number of units per level


Set Amount[1] to # of units to spawn in wave 1


Set Amount[2] to # of units to spawn in wave 2


Set Amount[3] to # of units to spawn in wave 3


...


Comment - set unit types for each level


Set UnitType[1] to (unit that spawns at level 1)


Set UnitType[2] to (unit that spawns at level 2)


Set UnitType[3] to (unit that spawns at level 3)


...
Events
Conditions

currentLevel is less than or equal to (total number of waves)
Actions

Trigger - Run (Spawn units for Player 1) checking conditions

Trigger - Run (Spawn units for Player 2) checking conditions

...
Events

Unit dies
Conditions

Owner of (Triggering Unit) equal to (Neutral Hostile)
Actions

Set - NumOfUnits to (Arithmetic(NumOfUnits - 1))

if then else - multiple


if



NumOfUnits equal to 0


than



wait 30 seconds



Trigger - Run (trigger above this one that has no name) checking conditions


else
This is how I did it in my TD (well, mostly)
First you need to make 4 variables:
TempLocation - Point variable
Amount - Integer array with a length of however many levels you're going to have
UnitType - Unit array with a length of however many levels you're going to have
CurrentLevel - integer with starting value of 1 (this counts your levels for you)
edit:
NumOfUnits - integer variable starting at 0
Now all you have to do is set what each wave is, and how many of them spawn...
Spawn Units for Player 1
Events
Conditions
Player Slot Status of Player 1 equal to Is Playing
Actions
Set - TempLocation to center of Player1sSpawningRegion
Unit - Create (unit type of (Amount[CurrentLevel])) units of type (unit type of (UnitType[CurrentLevel])) for (Neutral Hostile) at (TempLocation) facing default building facing degrees
Set NumOfUnits to (Arithmetic(NumOfUnits + Amount[CurrentLevel]))
Custom Script(call RemoveLocation(udg_TempLocation))
Custom Script(set bj_wantDestroyGroup = true)
Set - TempLocation to center of (First checkpoint in player 1's path)
Unit Group - Pick every unit in (Player1sSpawningRegion) and do if ((owner of (Picked Unit) equal to (Neutral Hostile)) then (order (Picked Unit) to (Move) to (TempLocation)) else (do Nothing))
Custom Script - (call RemoveLocation(udg_TempLocation))
Map Initialization
Events
Map Initialization
Conditions
Actions
Comment - set number of units per level
Set Amount[1] to # of units to spawn in wave 1
Set Amount[2] to # of units to spawn in wave 2
Set Amount[3] to # of units to spawn in wave 3
...
Comment - set unit types for each level
Set UnitType[1] to (unit that spawns at level 1)
Set UnitType[2] to (unit that spawns at level 2)
Set UnitType[3] to (unit that spawns at level 3)
...
Copy the first trigger for each player and change the regions and the player number for each copy
Events
Every ... seconds of the game // get rid of this if you add the next trigger
Conditions
Actions
Trigger - Run (Spawn units for Player 1) checking conditions
Trigger - Run (Spawn units for Player 2) checking conditions
...
Hope this helps!
EDIT: for the "30 seconds after the wave dies" thing, add this:
I wouldn't wait 30 seconds after the wave dies though, since that adds a lot of down time where people just get impatient, wanting to kill stuff.
Events
Unit dies
Conditions
Owner of (Triggering Unit) equal to (Neutral Hostile)
Actions
Set - NumOfUnits to (Arithmetic(NumOfUnits - 1))
if then else - multiple
if
NumOfUnits equal to 0
than
wait 30 seconds
Trigger - Run (trigger above this one that has no name)
else
Copy the first trigger for each player and change the regions and the player number for each copy