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.
 
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.
 
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
 
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
 
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.
 
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
 
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.
 
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.
 
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
 
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.
 
Oh and another thing, what's your opinion for the increase in health per level on the creep spawns?
 
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;)
 
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?
 
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.
 
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?
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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