• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

need help spawning units {spawning a unit every 30 seconds depending on a building}

Status
Not open for further replies.
Level 2
Joined
Feb 14, 2009
Messages
10
I am having trouble making a trigger that:
  • spawns a unit every 30 seconds
  • spawns a certain unit depending on a certain building (ex. spawning a footman if and only if you have a barracks)
the effect i want is similar to the spawning system in civilization wars
 
Level 3
Joined
Apr 24, 2005
Messages
61
Something like this:

  • Events
    • Unit finishes construction
  • Conditions
    • Unit type of constructed unit equal to YourBuilding
  • Actions
    • Set SpawnCount = SpawnCount + 1
  • Events
    • Every 30 seconds of game time
  • Actions
    • Create SpawnCount Unit for player x
SpawnCount is an integer variable. If you want several unit spawns you might want to consider making it an array to keep the number of variables needed down.
 
Level 4
Joined
Jan 25, 2009
Messages
117
Or:
Events
Every 30 seconds of the game

Conditons
If (Barracks) life greater than or equal to 1

Actions
Create X amount of (your soldier(s)) in (your region)
 
Level 2
Joined
Aug 11, 2008
Messages
19
other solution

Something like this might work better
Unit Spawn
Events
Time - Every 30.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units of type Barracks) and do (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees)

doing this will make it spawn one footmen for every barracks each player has for that player, one blanket trigger to cover it all
 
Last edited:
Level 2
Joined
Feb 14, 2009
Messages
10
if i just want it to spawn for red i can do this right?
conditions: (owner of (picked unit)) equal to Player 1

never mind... its working now thanks
 
Last edited by a moderator:
Status
Not open for further replies.
Top