Trigger Help needed!

Arctic

New Member
Reaction score
1
I'm making a TD and all i need to know is how to make it so once all the enemies are dead to make the next round start.:banghead:
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
You can make an integer count when the enemies are dead

if 30 spawn just make a trigger to make an integer and subtract it when 1 of them dies and when it hits 0... start the new one.

or

give the enemies 1 food and check when the food = 0
 

foodflare

You can change this now in User CP.
Reaction score
32
or you could do this type of thing

Levels is a unit-type array variable
Level is an integer variable
Spawns is a unit-group variable

this is for the first spawn just do watever with this(just example)
Code:
Basic Spawn
    Events
    Conditions
    Actions
        Unit - Create 15 Levels[Level] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
        Unit Group - Add all units of (Last created unit group) to Spawns

this is the actually testing part
Code:
Starting new spawn
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is in Spawns) Equal to True
    Actions
        Unit - Remove (Triggering unit) from the game
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in Spawns) Equal to 0
            Then - Actions
                Set Level = (Level + 1)
                Unit - Create 15 Levels[Level] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
                Unit Group - Add all units of (Last created unit group) to Spawns
            Else - Actions
 

Arctic

New Member
Reaction score
1
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Wait 25.00 seconds
        Unit - Create 10 Child for Player 2 (Blue) at (Center of Point A <gen>) facing Default building facing (270.0) degrees
Thats what i got for round 1 i just need to make it so when all of the 10 Children die to start another timer for the next round.
 

foodflare

You can change this now in User CP.
Reaction score
32
ok now in that trigger put

Unit Group - Add all units of (Last created unit group) to Spawns

and then

Code:
Starting new spawn
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is in Spawns) Equal to True [COLOR="red"]boolean[/COLOR]
    Actions
        Unit Group - Remove (Triggering unit) from Spawns
        Unit - Remove (Triggering unit) from the game
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in Spawns) Equal to 0 [COLOR="Red"]integer comparison[/COLOR]
            Then - Actions
                Unit - Create 10 Child for Player 2 (Blue) at (Center of Point A <gen>) facing Default building facing degrees
                Unit Group - Add all units of (Last created unit group) to Spawns [COLOR="Red"]Unit Group - Add unit group[/COLOR]
            Else - Actions
 

Arctic

New Member
Reaction score
1
But there are other people in the region "spawns" that you need the whole game.
 

foodflare

You can change this now in User CP.
Reaction score
32
this only selects the units u select for the spawns
unless u add other units to the unit group 'spawns'
you could change the name of the unit group if needed just create a new one and use it
 
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