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

Respawning Creeps

Status
Not open for further replies.
Level 4
Joined
Jul 18, 2008
Messages
76
hey, my new map project is mostly about slaying creeps.
Ive got a huge map, with lots of creeps and what i need is a good trigger to respawn all the creeps every minute (if they are dead).. Just like DotA..

Any ideas?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
At map initialization:

  • Hashtable - Create a hashtable
  • Set Respawn_Hash = (Last created hashtable)
  • Init Locs
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Set Temp_Loc_1 = (Position of (Picked unit))
          • Hashtable - Save Handle OfTemp_Loc_1 as (Key loc) of (Key (Picked unit)) in Respawn_Hash
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Wait 5.00 seconds
      • Set Temp_Loc_1 = (Load (Key loc) of (Key (Triggering unit)) in Respawn_Hash)
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at Temp_Loc_1 facing Default building facing degrees
      • Hashtable - Save Handle OfTemp_Loc_1 as (Key loc) of (Key (Last created unit)) in Respawn_Hash
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Respawn_Hash
Units will spawn at the location where they are placed in the editor.
 
Level 4
Joined
Jul 18, 2008
Messages
76
Thanks alot dude, it works perfectly!

EDIT: cant give rep to u yet.. have given it recently:p
 
Status
Not open for further replies.
Top