• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How do i make waves for td in gui

Status
Not open for further replies.
Level 5
Joined
Jul 25, 2008
Messages
155
  • Events
  • Time - Every 50 seconds of the game
  • Conditions
  • Actions
  • Unit - Create 3 Ghoul for Player 7 (Green) at (Center of Scourage middle spawn <gen>) facing Default building facing degrees
  • Wait 0.01 seconds
  • Unit - Create 1 Necromancer for Player 7 (Green) at (Center of Scourage middle spawn <gen>) facing Default building facing degrees
  • Wait 0.01 seconds
  • Unit Group - Pick every unit in (Units in Scourage middle spawn <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Center of Middle of map <gen>))
Then you can just change the every 50 second to time elapsed, and make several of these triggers with different monsters
 
Level 5
Joined
Jul 25, 2008
Messages
155
Each wave can come after each amount of time, for example 1 wave comes after 50 seconds, the next wave comes after 80 seconds.
Like this: Time elapsed - 50 seconds
 
Level 9
Joined
Feb 19, 2006
Messages
115
This is how I did it in my TD (well, mostly)

First you need to make 4 variables:
TempLocation - Point variable
Amount - Integer array with a length of however many levels you're going to have
UnitType - Unit array with a length of however many levels you're going to have
CurrentLevel - integer with starting value of 1 (this counts your levels for you)

edit:
NumOfUnits - integer variable starting at 0

  • Spawn Units for Player 1
    • Events
    • Conditions
      • Player Slot Status of Player 1 equal to Is Playing
    • Actions
      • Set - TempLocation to center of Player1sSpawningRegion
      • Unit - Create (unit type of (Amount[CurrentLevel])) units of type (unit type of (UnitType[CurrentLevel])) for (Neutral Hostile) at (TempLocation) facing default building facing degrees
      • Set NumOfUnits to (Arithmetic(NumOfUnits + Amount[CurrentLevel]))
      • Custom Script(call RemoveLocation(udg_TempLocation))
      • Custom Script(set bj_wantDestroyGroup = true)
      • Set - TempLocation to center of (First checkpoint in player 1's path)
      • Unit Group - Pick every unit in (Player1sSpawningRegion) and do if ((owner of (Picked Unit) equal to (Neutral Hostile)) then (order (Picked Unit) to (Move) to (TempLocation)) else (do Nothing))
      • Custom Script - (call RemoveLocation(udg_TempLocation))
Now all you have to do is set what each wave is, and how many of them spawn...

  • Map Initialization
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Comment - set number of units per level
      • Set Amount[1] to # of units to spawn in wave 1
      • Set Amount[2] to # of units to spawn in wave 2
      • Set Amount[3] to # of units to spawn in wave 3
      • ...
      • Comment - set unit types for each level
      • Set UnitType[1] to (unit that spawns at level 1)
      • Set UnitType[2] to (unit that spawns at level 2)
      • Set UnitType[3] to (unit that spawns at level 3)
      • ...
  • Events
  • Conditions
    • currentLevel is less than or equal to (total number of waves)
  • Actions
    • Trigger - Run (Spawn units for Player 1) checking conditions
    • Trigger - Run (Spawn units for Player 2) checking conditions
    • ...
Copy the first trigger for each player and change the regions and the player number for each copy
Hope this helps!

EDIT: for the "30 seconds after the wave dies" thing, add this:
  • Events
    • Unit dies
  • Conditions
    • Owner of (Triggering Unit) equal to (Neutral Hostile)
  • Actions
    • Set - NumOfUnits to (Arithmetic(NumOfUnits - 1))
    • if then else - multiple
      • if
        • NumOfUnits equal to 0
      • than
        • wait 30 seconds
        • Trigger - Run (trigger above this one that has no name) checking conditions
      • else
I wouldn't wait 30 seconds after the wave dies though, since that adds a lot of down time where people just get impatient, wanting to kill stuff.
 
Last edited:
Level 3
Joined
Feb 22, 2008
Messages
23
This is how I did it in my TD (well, mostly)

First you need to make 4 variables:
TempLocation - Point variable
Amount - Integer array with a length of however many levels you're going to have
UnitType - Unit array with a length of however many levels you're going to have
CurrentLevel - integer with starting value of 1 (this counts your levels for you)

edit:
NumOfUnits - integer variable starting at 0

  • Spawn Units for Player 1
    • Events
    • Conditions
      • Player Slot Status of Player 1 equal to Is Playing
    • Actions
      • Set - TempLocation to center of Player1sSpawningRegion
      • Unit - Create (unit type of (Amount[CurrentLevel])) units of type (unit type of (UnitType[CurrentLevel])) for (Neutral Hostile) at (TempLocation) facing default building facing degrees
      • Set NumOfUnits to (Arithmetic(NumOfUnits + Amount[CurrentLevel]))
      • Custom Script(call RemoveLocation(udg_TempLocation))
      • Custom Script(set bj_wantDestroyGroup = true)
      • Set - TempLocation to center of (First checkpoint in player 1's path)
      • Unit Group - Pick every unit in (Player1sSpawningRegion) and do if ((owner of (Picked Unit) equal to (Neutral Hostile)) then (order (Picked Unit) to (Move) to (TempLocation)) else (do Nothing))
      • Custom Script - (call RemoveLocation(udg_TempLocation))
Now all you have to do is set what each wave is, and how many of them spawn...

  • Map Initialization
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Comment - set number of units per level
      • Set Amount[1] to # of units to spawn in wave 1
      • Set Amount[2] to # of units to spawn in wave 2
      • Set Amount[3] to # of units to spawn in wave 3
      • ...
      • Comment - set unit types for each level
      • Set UnitType[1] to (unit that spawns at level 1)
      • Set UnitType[2] to (unit that spawns at level 2)
      • Set UnitType[3] to (unit that spawns at level 3)
      • ...
  • Events
    • Every ... seconds of the game // get rid of this if you add the next trigger
  • Conditions
  • Actions
    • Trigger - Run (Spawn units for Player 1) checking conditions
    • Trigger - Run (Spawn units for Player 2) checking conditions
    • ...
Copy the first trigger for each player and change the regions and the player number for each copy
Hope this helps!

EDIT: for the "30 seconds after the wave dies" thing, add this:
  • Events
    • Unit dies
  • Conditions
    • Owner of (Triggering Unit) equal to (Neutral Hostile)
  • Actions
    • Set - NumOfUnits to (Arithmetic(NumOfUnits - 1))
    • if then else - multiple
      • if
        • NumOfUnits equal to 0
      • than
        • wait 30 seconds
        • Trigger - Run (trigger above this one that has no name)
      • else
I wouldn't wait 30 seconds after the wave dies though, since that adds a lot of down time where people just get impatient, wanting to kill stuff.

what if u have more than one player?
 
Level 9
Joined
Feb 19, 2006
Messages
115
the "set UnitType[#] to (unit)" thing in the second trigger declares what each wave is going to be. so, for example, "set UnitType[1] to Footman" would make footmen spawn on wave 1. "set UnitType[4] to Grunt" sets the 4th wave to Grunts.
In the initialization trigger, you just need to have a "set UnitType..." line for each wave.

And remember, "UnitType" is a variable you declare in the variable thing in the trigger editor.
 
Status
Not open for further replies.
Top