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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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