Line up for the greatest question in this forum

smileyguyx

Member
Reaction score
1
yes for a TD. How am i meant to make a 'short spawn' in between spawns, or do i have to do it using a huge list of 'spawn 1 Unit A wait 0.5 seconds spawn 1 unit A etc etc'?
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
Use a For loop:

Trigger:
  • Creep Spawn
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Nb_Of_Spawns, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Spawn for Player 1 (Red) at Spawn_Point facing Default building facing degrees
          • Wait 0.50 seconds
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
Ah, didn't know about that. Well, just use something like this then:

Trigger:
  • Creep Spawn
    • Events
      • Time - Creep_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Nb_Left_To_Spawn Greater than or equal to 1
        • Then - Actions
          • Set Nb_Left_To_Spawn = (Nb_Left_To_Spawn - 1)
          • Unit - Create 1 Spawn_Unit for Player 1 (Red) at Spawn_Point facing Default building facing degrees
          • Countdown Timer - Start Creep_Timer as a One-shot timer that will expire in 0.50 seconds
        • Else - Actions
          • Trigger - Turn off (This trigger)
 

Bogrim

y hello thar
Reaction score
154
That's a much better trigger, except that you don't need to turn off the trigger when the condition doesn't match (the timer not repeating will have the same effect). To use Sirroelivan's trigger, smileyguy, you just have to set the Nb_Left_To_Spawn integer variable to the number of units you wish to create and then run the trigger with the action,
Trigger:
  • Actions
    • Set Nb_Left_To_Spawn = (Your Spawn Number)
    • Trigger - Run Creep_Timer <gen> (ignoring conditions)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top