• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Choose when to resurrect with ankh

Status
Not open for further replies.
Level 7
Joined
Jul 4, 2007
Messages
249
Hi, I've been wanting to make an ankh that allows you to resurrect whenever you choose to but I can't figure out how to do it. First of all I can't really read when someone has died and has ankh since they don't count as dead, and second I can't resurrect someone under the effect of ankh because they're not actually dead.
Is this even possible to do, if so how? And is it worth the trouble? I mean it would be very nice but it's not like my map depends on it
 
Level 8
Joined
May 21, 2019
Messages
435
It's possible that there's some crafty way to manipulate the Ankh effect, like pausing the unit and then unpausing it to do the revival.

But that's just a shot in the dark, I don't have WE on me atm.

There's another way that you could go about this though. That's using a dummy item instead of the Ankh, and doing a trigger based revival when the player gives a certain input instead.
 
Level 7
Joined
Jul 4, 2007
Messages
249
Yes but then what kind of event would I use? If I use
  • Unit - Lord of the Seven 0141 <gen>'s life becomes Less than 1.00
for example the unit still dies because it doesn't read it in time
 
Level 8
Joined
May 21, 2019
Messages
435
Yes but then what kind of event would I use? If I use
  • Unit - Lord of the Seven 0141 <gen>'s life becomes Less than 1.00
for example the unit still dies because it doesn't read it in time
Well, what I am suggesting is accepting that this counts as a "death", since you are essentially giving the player the option of when to pop back up. If you are keeping track of deaths somehow, simply nullify that.

If you badly want to avoid things like the on-death chat message, bounty rewards, exp gains, and etc to be triggered, then you'd have to use a Damage Detection System to predict fatal damage before it occurs, and then run the triggers with that.
 
Level 7
Joined
Jul 4, 2007
Messages
249
Well, what I am suggesting is accepting that this counts as a "death", since you are essentially giving the player the option of when to pop back up. If you are keeping track of deaths somehow, simply nullify that.

If you badly want to avoid things like the on-death chat message, bounty rewards, exp gains, and etc to be triggered, then you'd have to use a Damage Detection System to predict fatal damage before it occurs, and then run the triggers with that.
Uhm yea this is a little too much work I'd say, but thanks for your answer you've been most helpful
 
Level 2
Joined
Aug 14, 2019
Messages
21
This is an interesting idea, youu could make a custom item that is similar to an ankn and have a trigger which ressurects the unit at a preset location.
Im not too good with the editor, but those are my thoughts
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
I made a map with a triggered Reincarnation system. It uses a Damage Detection System and a Unit Indexer. Two very powerful but very easy to use tools for GUI.

Anyway. the system almost works perfectly... but an issue is turning off the collision for the dying unit. I can't seem to get that to work. Regardless, I think it works good enough. At the very least you may learn something from it.

Follow these 3 steps in this exact order to import it into your map:
1) Enable "Automatically create unknown variables while pasting trigger data" under File/Preferences/General in the World Editor.
2) Copy and Paste "Ankh of Reincarnation NEW" from the Object Editor into your map
3) Copy and Paste the "Ankh Triggers" folder from the Trigger Editor into your map

Edit: Uploaded a No Damage Engine version. This one doesn't prevent the unit from dying. Don't really know how you want this system to work so I figured I'd throw it in too.
 

Attachments

  • Ankh No Damage Engine.w3x
    26.6 KB · Views: 19
  • Ankh Demo.w3x
    54.2 KB · Views: 19
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
Not sure if I did it right but it didn't work. Same problem as before, the ability is added but it doesn't kick in until the unit is no longer paused.

vJASS:
function Test takes nothing returns nothing
    call UnitAddAbilityBJ( 'A000', udg_DamageEventTarget )
endfunction

I tried calling this before AND after pausing the unit.
  • Custom script: call ExecuteFunc("Test")
Edit: Seems as though Pause prevents Ghost from working regardless of when you add/pause the unit. Is there any way to mimic a Pause? I know you can stun the unit or maybe interrupt it's issued orders... But those are never great solutions.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
One thing I learned was that you can detect when a unit dies with Ankh by doing this:
  • Detect Ankh Death
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ankh of Reincarnation
      • ((Triggering unit) is dead) Equal to True
    • Actions
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
However, in response to that Event I can't seem to interrupt the Ankh effect. Things I tried that didn't work: Revive Hero Instantly, hiding/unhiding the unit, moving the unit instantly.

Maybe someone can figure out a way to prevent the Ankh effect from finishing? Seems impossible though.
 
Level 8
Joined
May 21, 2019
Messages
435
One thing I learned was that you can detect when a unit dies with Ankh by doing this:
  • Detect Ankh Death
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ankh of Reincarnation
      • ((Triggering unit) is dead) Equal to True
    • Actions
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
However, in response to that Event I can't seem to interrupt the Ankh effect. Things I tried that didn't work: Revive Hero Instantly, hiding/unhiding the unit, moving the unit instantly.

Maybe someone can figure out a way to prevent the Ankh effect from finishing? Seems impossible though.
This is pretty radical... but... I guess you could replace the entire hero with an exact copy?
 
Level 7
Joined
Jul 4, 2007
Messages
249
One thing I learned was that you can detect when a unit dies with Ankh by doing this:
  • Detect Ankh Death
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ankh of Reincarnation
      • ((Triggering unit) is dead) Equal to True
    • Actions
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
However, in response to that Event I can't seem to interrupt the Ankh effect. Things I tried that didn't work: Revive Hero Instantly, hiding/unhiding the unit, moving the unit instantly.

Maybe someone can figure out a way to prevent the Ankh effect from finishing? Seems impossible though.
I figured out a way to do it, in the ability set Delay After Death to 0 sec and remove the effects, then use this trigger. I haven't done the reviving part yet though but from this point it's not a problem :D
  • ankh
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Ankh of Reincarnation
      • ((Triggering unit) is dead) Equal to True
    • Actions
      • Wait 0.01 seconds
      • Animation - Play (Triggering unit)'s death animation
      • Unit - Pause (Triggering unit)
      • Unit - Make (Triggering unit) Invulnerable
      • Set tempLoc = (Position of (Triggering unit))
      • Special Effect - Create a special effect at tempLoc using Abilities\Spells\Orc\Reincarnation\ReincarnationTarget.mdl
      • Custom script: call RemoveLocation(udg_tempLoc)
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
it should be "a unit Uses an item", no need to check if the triggering unit is dead then, just keep the first condition and you're good. Doing this with Damage Engine like uncle suggested is the best solution though.
 
Level 7
Joined
Jul 4, 2007
Messages
249
it should be "a unit Uses an item", no need to check if the triggering unit is dead then, just keep the first condition and you're good. Doing this with Damage Engine like uncle suggested is the best solution though.
You're right that works too.
Why would that be a better solution? It works perfectly this way and is way less complicated
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Having two conditions is less complicated than to use one?
Maybe the trigger fire if you drop the item, and you're still not dead?
On death, Ankh is used...
Both work, but if you want to have logic on triggers, you should do it the correct way, because, this might not work in some of your future contexts.
 
Level 7
Joined
Jul 4, 2007
Messages
249
Having two conditions is less complicated than to use one?
Maybe the trigger fire if you drop the item, and you're still not dead?
On death, Ankh is used...
Both work, but if you want to have logic on triggers, you should do it the correct way, because, this might not work in some of your future contexts.
I meant you're right in using "Uses a item", and I asked why using a damage engine would be a better solution.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
As far as I understood what you want to achieve, it's to choose when to ressurect with ankh. Currently without the damage engine you'll have still the reicarnation effect showing, even though the unit died, and the item removed. You can't change the effect, nor replace it.
With damage engine you simply calculated if the damage is fatal, if yes, then play death animation, set unit hp to 1 and do your own thing.
 
Level 7
Joined
Jul 4, 2007
Messages
249
As far as I understood what you want to achieve, it's to choose when to ressurect with ankh. Currently without the damage engine you'll have still the reicarnation effect showing, even though the unit died, and the item removed. You can't change the effect, nor replace it.
With damage engine you simply calculated if the damage is fatal, if yes, then play death animation, set unit hp to 1 and do your own thing.
I have completely removed the effect from the ability and made a custom effect in trigger that I'm in full control of, or what is it exactly that you're saying? I'm not sure I get it because I can't see any flaws in my method
 
Status
Not open for further replies.
Top