a Hero Defense Trigger

TfauxT

New Member
Reaction score
2
Timed spawns are not working out too well, if the player group doesn't kill the wave in time another spawns on top of it. I need a trigger that waits until the enemy has lost all of its units to spawn the next wave. Is there any kind of setup I can create to achieve this, respectively?:nuts:

Thanks!
 
F

FKNCrazy

Guest
Maybe you could try adding all the units to a unit group on creation and remove them from the unit group when they die, once done this you could have a trigger that checks when a unit dies if every unit in that unit group is dead, if it is dead it spawns next wave. Do this for adding the units to the group and checking if they are dead or not etc, i can prolly squeeze it all into two triggers i think.
Code:
Events - A unit dies.
Conditions - (Owner of triggering unit equal to (Player 12 brown) (Or whatever your enemy player is.)
Actions -
Pick every unit in unit group Spawn1 (lets just say this is the unit group that first spawns, i'll get on to adding units to it in a sec.)
and do (Actions)
Loop Actions -
If - Then - Else
If -
(All units of (Spawn1) are dead) Equal to True
Then - 
Pick every unit in (Spawn1) and do Unit Group - Remove Picked Unit from Spawn1
Unit - Create 1 (or w/e number of units you want to spawn) Monster(Your monster here!) for Player 12 Brown at Region(where you want them to spawn)
Unit Group - Add (Last Created Unit) to Spawn2 (2nd lot of spawns)
Else -
Do Nothing
Ok, i havn't tested this so their may be some errors + im to tired to think properly but that should work, basically you should have to repeat that trigger for every time you want different units to spawn. I hope this is what you needed, any problems PM me.
 

ertaboy356b

Old School Gamer
Reaction score
86
Here's how I do it:

1. create a unit group (WaveGroup)
2. Create your wave trigger (WaveTrigger)
3. Add an event to WaveTrigger that looks like this: Every 0.3 seconds of game time.
4. Add a condition to WaveTrigger that looks like this: Number Of Units in WaveGroup equals to 0
5. Add your Wave Actions..
6. Your Done!!
 
O

Orcses

Guest
Go to: Condition/Integer Comparison/Player Property/Food Used
It should look like this:
Code:
Conditions
    (Player 1 (Red) Food used) Equal to 0
-Just change (Player 1 Red) to whatever player you want in the wave
-for conditions, unless you have an "Or" in it, all conditions have to be correct in order for the actions to run. So you could add whatever other players are in the wave if there are more:)
Here is the trigger for waves that I use:
Code:
Wave Setup Copy
    Events
        Time - Every 10.00 seconds of game time
    Conditions
        (Neutral Hostile Food used) Equal to 0
    Actions
        Set Wave = (Wave + 1)
        Set Wave2 = (Real(Wave))
        Game - Display to (All players) the text: (Wave  + (String(Wave)))
Make 2 variables: "Integer" and "Real", I called mine "Wave" and "Wave2" respectively. What the first trigger does is adds one to the integer every ten seconds if there are no neutral hostiles alive. You need to convert the integer to a real because you cannot have an event triggered by an integer only a real number;)
Code:
Wave1
    Events
        Game - Wave2 becomes Equal to 1.00
    Conditions
    Actions
        Set tmpLocation1 = (Center of Portal1 <gen>)
        Unit - Create 5 Blood Fel Orc Grunt for Player 12 (Brown) at tmpLocation1 facing 90.00 degrees
        Custom script:   call RemoveLocation(udg_tmpLocation1)
-For the second wave just make another trigger and have in the event:
Code:
Events
    Game - Wave2 becomes Equal to 2.00
-We make a "Point" variable for the second trigger, I called mine "tmpLocation1". You set it to the region you want the wave to originate at. Then you creat the wave at the point and then remove the point after they are created.

Edit: Uggh 2 posts 2 late but mine took longer to write!
 

TfauxT

New Member
Reaction score
2
Thank you! I accept your advice humbly. I will now go experiment in WE with the mass mobs I have created :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top