Where will the dead unit respawn? At the current location?
Other than that, this might work... However, local variables can mess up with texts and messages that you write (like, what's new, write "-hi" to send an e-mail to blizzard employees, etc... :P). Although, they're not necessary and you can swap them I assume.
Events
Game - Map initialization
Unit - Any Unit dies
Local Variables
Location = (Position of (Triggering unit)) <Point>
Respawnable = UNIT TYPE <Game Link - Unit>
Conditions
(Unit type of (Triggering unit)) == Respawnable
Actions
General - Wait X Game Time seconds
Unit - Create 1 Respawnable for player (Triggering player) at Location using default facing (No Options)
Try this, if this won't work, I think it'll be related to how I used the "wait" in actions. I'd prefer a general definition, like: "If-Wait-Then". Unit action might execute before general action. This should resurrect a unit-type which you'll specify in the variable, at the place he died after X game time seconds.
Techinally, with what you have there, you can just tell it to resurrect. Also you are telling it to make a unit that is already on the map, not a unit type which might be where your error is...
If you wanted a more general one you would have to do something like
Event: if any unit dies
Condition: triggering unit = to "Dark Templar"
Action: creae 1(unit type of Dark Templar(at triggering units location) for (triggering player) using default facing.
Hi, I'm very close to complete my project. I'm looking for tutorial or completed script which will resurrect unit.
Script should resurrect unit when it die after X seconds.
Unit die -> resurrecting after X seconds.
Any one can help me?
Thanks in advance.
Cheers :)
Where will the dead unit respawn? At the current location?
Other than that, this might work... However, local variables can mess up with texts and messages that you write (like, what's new, write "-hi" to send an e-mail to blizzard employees, etc... :P). Although, they're not necessary and you can swap them I assume.
Events
Game - Map initialization
Unit - Any Unit dies
Local Variables
Location = (Position of (Triggering unit)) <Point>
Respawnable = UNIT TYPE <Game Link - Unit>
Conditions
(Unit type of (Triggering unit)) == Respawnable
Actions
General - Wait X Game Time seconds
Unit - Create 1 Respawnable for player (Triggering player) at Location using default facing (No Options)
Try this, if this won't work, I think it'll be related to how I used the "wait" in actions. I'd prefer a general definition, like: "If-Wait-Then". Unit action might execute before general action. This should resurrect a unit-type which you'll specify in the variable, at the place he died after X game time seconds.
Thanks for response. :)
I use your example and change something, here it is:
But it seems that something is wrong because it doesn't matter unit is dead or alive, trigger create this new unit after 2 sec anyway.
I made something like that:
But when unit dies i get this error:
I'm totally lost. :(
Help! :D
Techinally, with what you have there, you can just tell it to resurrect. Also you are telling it to make a unit that is already on the map, not a unit type which might be where your error is...
If you wanted a more general one you would have to do something like
Event: if any unit dies Condition: triggering unit = to "Dark Templar" Action: creae 1(unit type of Dark Templar(at triggering units location) for (triggering player) using default facing.
Yes, it's seems to work now: my unit dies and new one is created in right place but i still get some error:
Hi, to revive your "Dead" unit create an action as custom script and write : UnitRevive(lv_dead);
Warning : your unit must have his CUnit_DeathTime attribute to a value superior has the time you wait to resurrect it.