• 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.

Trigger unit spawn and after time kill

Status
Not open for further replies.
Level 15
Joined
Jun 11, 2007
Messages
969
Use this:

  • Events
    • Game - The in-game time of day becomes Equal to 21.00
  • Conditions
  • Actions
    • Unit - Create xxx Zombie for Player 1 (Red) at (Random point in (Playable map area)) facing Default building facing degrees
  • Events
    • Game - The in-game time of day becomes Equal to 8.00
  • Conditions
    • ((Matching unit) is alive) Equal to True
    • (Unit-type of (Matching unit)) Equal to Zombie
  • Actions
    • Unit - Kill (Matching unit)
Haven't tested, but it should work
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
and it doesn't work. first point, with your first trigger all the zombies would spawn at the same point of the map, so you better use a loop with "for each integer from 1 to xx do actions" . second trigger: i'm not 100% sure but i doubt it works, as you have no unit to compare the "matching" , best to use is (imo) a unit group with "pick every unit in playable area matching conditions" and then the conditions stated by Revolve. the events are correct
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
I got those triggers:
  • Spawn Zombies
    • Events
      • Game - The in-game time of day becomes Equal to 21.00
    • Conditions
    • Actions
      • For each (Integer A) from 1 to [Number], do (Actions)
        • Loop - Actions
          • Set TempLoc = (Random point in (Playable map area))
          • Unit - Create 1 Zombie for [Player] at TempLoc facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempLoc)
  • Kill Zombies
    • Events
      • Game - The in-game time of day becomes Equal to 8.00
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Zombie))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
I think those are leakless and should work for you :)
 
Status
Not open for further replies.
Top