How to revive a unit

Accname

2D-Graphics enthusiast
Reaction score
1,463
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,463
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,463
@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,463
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,463
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,463
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.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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