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

Unit Respawn Issues

Status
Not open for further replies.
Level 2
Joined
Sep 6, 2008
Messages
8
I can get these units to respawn but they always be respawning where they die I want them to respawn where I placed them >_> but I try and do regions and that doesnt work because they go to different regions that i didnt set GRrr im so frustrated please help :ugly:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Well you detect all the units you want to respawn.
Then for each of them you save their position and rotation in 4 variable arrays (unit type, X,Y and rotation).
You then store the array index on the unit via the handy custom value natives that enable one to store an integer on a unit.
When a unit dies, you get the custom value of it and store it in a local, you then wait your respawn time (polledwait recomended for better accuracy) and then create a new unit from the stored value and your arrays and then reattach the index to it so the cycle can repeat.
 
Level 6
Joined
Aug 13, 2008
Messages
197
try
event-a unit dies
condition-unit type of (triggering unit) equal to (your creep)
action-wait (20sec)
-create (1) (your creep) at (your location) facing (default angle)
-call destroy location (your location)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Epimeliad , your way does not meet the requirements of LusciousK as he clearly stated that he has one that does that already but wants one that. . .
respawn where I placed them

Which means where he placed them in the the worldeditor (their starting position).

I just noticed that you can remove the unit type array as you can get the unit type from the dying unit and store that in a local as well.
 
Status
Not open for further replies.
Top