• 🏆 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!

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 13
Joined
Nov 4, 2006
Messages
1,239
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