Tower Defense Trigger for spawning units

Fulgore

New Member
Reaction score
0
I tried searching for the answer, but I didn't see anything. I'm pro on ideas for maps, but noob on making them reality lol. I just need to know what I have to do to make units spawn periodically, not make another wave until the current one is gone, and then spawn another wave. I get stuck at this point. Also my TD is a survivor one so I'd have to make it to where each player's are independent with triggers.

Extreme detail is recommended :D

Thanks.
 

Tyrulan

Ultra Cool Member
Reaction score
37
Big project for someone to help with, although I don't mind becoming a partner with your map in general. Some easy ways to write what you need.
 

Fulgore

New Member
Reaction score
0
Well I don't think I want a partnership kinda thing. Too much hassle for me :rolleyes:. I did try reading the tutorial here at:

http://world-editor-tutorials.thehel...t/towerdef.php

But it didn't really give a very detailed explanation/example. An example spawn trigger that's similar to my description would help a lot. I'm sure there's someone on here who knows how to, but just needs to take the time to help a novice :p
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Haven't tested, but should work:
Initially On:
Trigger:
  • Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Neutral Hostile at TempPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Spawned
          • Wait 0.50 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn on Spawn Next <gen>


Initially On:

Trigger:
  • Spawn 2
    • Events
    • Conditions
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Neutral Hostile at TempPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Spawned
          • Wait 0.50 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn on Spawn Next <gen>


Initially Off

Trigger:
  • Spawn Next
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in Spawned) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from Spawned
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Spawned) Equal to 0
        • Then - Actions
          • Trigger - Turn on Spawn 2 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

Fulgore

New Member
Reaction score
0
Hmmm this does help a lot, thank you very much Komaqtion. I'll have to fiddle around with the variables stuff, I'm not too keen on them. I'll post again if I run into trouble.
 

Fulgore

New Member
Reaction score
0
Well got a problem with the trigger. I put everything exactly as your example said and I get a code error and here's what it shows...I get a very similar probelm with the Spawn 1 trigger also.

Trigger:
  • function Trig_Spawn_2_Actions takes nothing returns nothing
    • set udg_TempPoint = gg_rct_Spawn_1
    • set bj_forLoopAIndex = 1
    • set bj_forLoopAIndexEnd = 10
    • loop
      • exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
      • call CreateNUnitsAtLoc( 1, 'h002', Player(11), GetRectCenter(gg_rct_Spawn_1), bj_UNIT_FACING )
      • call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Spawned )
      • call TriggerSleepAction( 0.50 )
      • call RemoveLocation(udg_TempPoint)
      • call EnableTrigger( gg_trg_Spawn_Next )
      • set bj_forLoopAIndex = bj_forLoopAIndex + 1
    • endloop
    • endfunction
 

Fulgore

New Member
Reaction score
0
I'm not, it's the window that came up showing me the error it had with the trigger. I put everything as you said and it put a window up with the trigger in text form.
 

Fulgore

New Member
Reaction score
0
Well I fixed the error thing, but now another problem has come up. After spawning the first unit it doesnt stop spawning them and if I kill them all it doesn't spawn the next wave.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
These triggers are working for me, have changed them slightly ;)

Trigger:
  • Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempPoint = (Center of Region 1 <gen>)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Neutral Hostile at TempPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Spawned
          • Wait 0.50 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn off (This trigger)


Trigger:
  • Spawn 2
    • Events
    • Conditions
    • Actions
      • Set TempPoint = (Center of Region 1 <gen>)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Neutral Hostile at TempPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Spawned
          • Wait 0.50 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)


Trigger:
  • Spawn Next
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in Spawned) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from Spawned
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Spawned) Equal to 0
        • Then - Actions
          • Trigger - Run Spawn 2 <gen> (checking conditions)
        • Else - Actions


Have tested them, and working for me :D
 

Fulgore

New Member
Reaction score
0
Ah yes it does work, very nice! But I can't figure out how to make it go beyond 2 wave spawns lol.

By wave spawns I mean the next level of units.
 

Fulgore

New Member
Reaction score
0
Oh and another thing, what's your opinion for the increase in health per level on the creep spawns?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ah yes it does work, very nice! But I can't figure out how to make it go beyond 2 wave spawns lol.

By wave spawns I mean the next level of units.

Your trigger doesn't go beyond 2 spawns ? mine does :S

Oh and another thing, what's your opinion for the increase in health per level on the creep spawns?

What do you mean here? :S
You mean the first level will be easier than the next one ?
Then yeah, that is how it should be :D;)
 

Fulgore

New Member
Reaction score
0
Hmm weird, yeah mine doesnt go past the 2nd wave. It just repeats the same wave over and over. Did I miss something or was I supposed to change something? lol.

And I meant the health increase as in the numerical increase. Like maybe a % increase per level or something? Or is it just based on the damage my towers do?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, to be able to make them increase % health each spawn, you'll need to make new unit's to all spawn levels, and maybe use a Unit-Type Array variable so that a new unit is spawned when a new level begins.
 

Fulgore

New Member
Reaction score
0
I could try that, but what about the wave trigger? Should I just delete the ones I have and just redo them to be sure I have it right?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Sure, or disable them and if it doesn't work, we can keep working on them ;)
 
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