How to revive a unit

Accname

2D-Graphics enthusiast
Reaction score
1,462
My question for today, how to revive a normal unit without replacing it. there are reasons for me why i dont want it to be replaced nor to create a new one.

the unit is already dead and got to be somehow revived afterwards, every help appreciated.

things i already tried, i dont wanna use:
-replace unit: Dont wanna replace it because of skills added and maybe shortcuts of players on this unit.
-adding reinkarnation after it already died doesnt work
-setting life to 100% doesnt work
-hero - revive doesnt work on normal units
-giving reinkarnation with 2 levels, level 1 has 99999 seconds until it revives it and level 2 has 0.01 seconds and switching level after it died doesnt work
 

ajzdfd

New Member
Reaction score
5
maybe a dummy unit that has a revive spell that is triggered to cast when the unit dies? Im just guessing from the top of my head
good luck
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
i dont want it to be revived when it dies but long after its already dead.

think of it like a creep respawning system for player units. your unit has died and after about 20 seconds or so its reviving at some preset position.

the whole script aint any problem for me, the only problem is to revive a non-hero unit. i dont want it to be replaced or re-created because of trigger added skills, variables, custom values and all that kind of stuff which got to be set again.
 

ajzdfd

New Member
Reaction score
5
im a bit of a noob so this might not be possible

what if you made it so that when a unit is dealt a blow that would normally kill it a trigger goes into effect that makes the unit not die and be left with 1 health. then instantly move that unit to somewhere not on the playable map and reset its health and create a dummy unit in its place that shows the death animation. and then move the unit when it needs to be revived
 

Mandrilx

New Member
Reaction score
9
You can use the Hero - Revive for normal units as well, that way they dont lose abilities you have given them etc... Now, I dont think it would work once the unit has decayed, so you probably need to change the gameplay constant for decay if you need to wait too long.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
@ajzdfd: too much work and performance for too little effect. i would have about 200 of those units which got to be revived.

@mandrilx: that doesnt work as i said in the first post, i double checked it.
a trigger like this does no more then nothing:
Trigger:
  • Test
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Hero - Instantly revive (Triggering unit) at (Position of (Triggering unit)), show revival graphics


@keeper: i know how to make a creep respawn system, thats not the point. the system you have posted does create new units instead of reviving the old ones what i need to do.
 

Nexor

...
Reaction score
74
You could give them the ankh of reincarnation skill in a spellbook or so, and set the reviving duration to big number.

Else what you want can only be achieved by creating new units.
 

Mandrilx

New Member
Reaction score
9
Ok, you are right sorry.

I checked an old map I made where i had the same problem. Change the decay constants to a longer time, then make a dummy unit with a resurrect spell that revives them when you need to.


Edit: Probably reincarnation in a disabled spellbook is a more decent way to go if it works though. Back then I was still pretty sloppy.
 

ajzdfd

New Member
Reaction score
5
couldnt it be a generic trigger that would work for all units? or all units in a preselected group?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
you miss the point that the unit hasnt got to be revived after a certain time but if specific events fire and certain conditions are met.
it got to be revived any time I want it to be.

as i said in the first post reincarnation doesnt work. and creating hundreds of dummy units wont work either.

has anybody got another idea? maybe in jass?
 

madd_999

New Member
Reaction score
14
disable decay then.. withou decay untis cant disapear becous of it.. that way it can be ressed

only problem would be that it could create lag in the end becous of the amount of units lying dead there...
 

Bogrim

y hello thar
Reaction score
154
Reincarnation with revival time equal to the unit's death animation length. If you don't want there to be an icon then add the ability through a disabled spell book.
Hide the unit.
Put the unit in a unit group.

Now you can unhide the unit whenever you want it to come back alive.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Well i got an idea, but it may not work ^^

What if you, before the unit dies, hide the unit, create a dummy and play it's death animation, then store the ''dying'' unit into a variable or hashtable. That way you can bring the unit back whenever you want to, but i don't know much about storing it (i don't get hashtables that well) and i don't know how you're gonna detect if the unit will die >.<
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
seems like nobody got an idea how to revive a non-hero unit, geez and i hoped it would be possible to go the easy way around this.
well maybe its just impossible.

thank you guys anyway.
 

Bogrim

y hello thar
Reaction score
154
seems like nobody got an idea how to revive a non-hero unit, geez and i hoped it would be possible to go the easy way around this.
well maybe its just impossible.
Yes, we do. Yes, it's possible.

While there's no way of specifically reviving a single unit, you have Reincarnation which prevents the unit from dying in the first place.

All you have to do is trigger the event of death. Make the unit disappear by hiding it, reward the experience and bounty with triggers. You can even create a corpse if you want.

Then you have the unit stored for later purposes. A way of recycling units without replacing them. That's what you wanted, right?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
no what you are talking about is not reviving it but hiding it etc.

how to hide the unit and unhide it again is well known to me. the question was whether i can simply revive it and that is not possible. at least no one has given me a prove of it being possible.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Did you try editing the ancestral spirit of the tauren shaman units? That's the only unit resurect i know of, besides some elaborate triggering
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top