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

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,240
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