How to revive a unit

Accname

2D-Graphics enthusiast
Reaction score
1,469
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
 
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
 
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.
 
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
 
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.
 
@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.
 
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.
 
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.
 
couldnt it be a generic trigger that would work for all units? or all units in a preselected group?
 
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?
 
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...
 
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.
 
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 >.<
 
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.
 
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?
 
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.
 
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:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
    +1
  • The Helper The Helper:
    It will only be on internal network
  • jonas jonas:
    Man the AI is good about gaslighting about security though. I've had several times where I pointed out security problems and it tried to convince me that with a tiny tweak it suddenly becomes secure
  • jonas jonas:
    Like using a distrobox as a "secure" container, and when I point out that's not secure at all, it claimed that specifying home will make it secure
  • The Helper The Helper:
    Yeah I finished the app today and it is bad ass. Like ChatGPT codes way better and faster than me that is for sure. The app is unsecure AF though and I would never put it anywhere it was obvious. I did not even show it today, the boss never made it in, but I showed the office and they liked it and frankly, I do software for a living and I am qualified to judge this kind of stuff and... Holy Shit this is a game changer. It took me around 4 hours to finish the app from design to end and that is much faster than I could have done it in the outdated MS Access the thing it replaced was in. Good Stuff! Had tons of fun doing it too! Work has not been fun in a while - today was fun!
    +1
  • The Helper The Helper:
    And really, I did not do it, chat wrote all the code I just pasted it in, tested it, acted like Chats eyes on it and just learned. I learned VS Code, how to use the Terminal and a bunch of Powershell and Command stuff, I used Git for the first time and learned how to save, search, start my server, stop it, run the tests, do some debugging - all the freaking fun stuff - chat wrote all the code
    +1
  • The Helper The Helper:
    I think the key was the 40 minutes of that 4 hours that went into the design of it. The thing was fully specced out before we started and the only reason it took so long was I had never done any of it and had to get used to the navigation and workflow.
    +1
  • The Helper The Helper:
    React, JS and AG Grid are the tools that I know i used along with git. I learned alot but it will be a minute before I fully understand everything I am doing in these environments because I am really just following instructions.
    +1
  • jonas jonas:
    I think people who aren't logged in can't even see this chat, so your message letting them know they won't be able to register is also hidden xP
  • jonas jonas:
    but yeah on LLM they're pretty capable now, I used opencode to build a custom agent for some tasks I face, and the custom agent ended up doing better than either opencode or specialized tools that have been developed for 20 years by humans
  • jonas jonas:
    at the same time it is so stupid and making insanely dumb mistakes, I had to stop it several times from doing really dumb things that would work for just a few cases but would be totally broken for more serious workloads, or sometimes were always broken (like just drop some responses from the LLM, then continue with some fake message) but would not trigger immediate problems
  • jonas jonas:
    I had to babysit it a lot, I'm not sure if in the near future better models will come around at a similar price point. If the price increases by more than 10x, it will be cheaper for me to do it myself again
  • The Helper The Helper:
    I use it a little different due to my programming background. I dont let it just do it. I am behind it watching what it does and learning. However, Chat has not been making many mistakes. Mostly it is me pasting wrong or something.
  • The Helper The Helper:
    Wow, I have left windows behind on my home pc. I am not using Linux Mint babies
  • Ghan Ghan:
    Nice
  • Ghan Ghan:
    Fewer and fewer reasons to use Windows these days.
  • The Helper The Helper:
    Had to type my password like 50 times already though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top