• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Can't save the unit from dying with modifying damage with PDD

Status
Not open for further replies.
Level 11
Joined
Jan 23, 2015
Messages
788
When a unit's hp drops bellow a percent in my map, it goes invulnerable and cannot be damaged, however if the damage is high enough to kill the unit before it becomes invulnerable, it dies even though I used PDD to modify the damage, even tried to set PDD_amount to 0 and then damage the unit, but the it still dies.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Have you imported (or made) the passive bonus health ability that's used to make sure that the unit doesn't die from the initial attack?

Otherwise I think bribe's damage engine doesn't have to use it so you could switch to that, which dee-boo already linked, and it has more functionality with other systems that are compatible with it.
 
Otherwise I think bribe's damage engine doesn't have to use it so you could switch to that, which dee-boo already linked, and it has more functionality with other systems that are compatible with it.

Damage Engine uses that ability if the unit needs it, but that's only if simply setting the current life high enough to negate the damage isn't enough.

it dies even though I used PDD to modify the damage, even tried to set PDD_amount to 0

As far as why the invulnerability isn't working, keep in mind that PDD will modify the current and max life of the unit between the initial damage event and a 0 second timer (which isn't instant), so you have to use custom functions "Get/SetUnitLife" and "GetUnitMaxLife" as looking_for_help added in his disclaimer. Damage Engine does not have this flaw as it uses unitstate events to instantly detect when the damage is applied, so there is no 0 second timer needed (one is still used in case of emergencies, but I've never seen it activate).

So, as others have mentioned, it may be a good idea to start migrating to Damage Engine. Damage Engine also includes cross-compatibility with PDD, so if you have a lot of stuff in your map using it the transition will still be easygoing. Please let me know if you have any other questions.
 
Level 11
Joined
Jan 23, 2015
Messages
788
Have you imported (or made) the passive bonus health ability that's used to make sure that the unit doesn't die from the initial attack?

Otherwise I think bribe's damage engine doesn't have to use it so you could switch to that, which dee-boo already linked, and it has more functionality with other systems that are compatible with it.

No, I haven't, where do I find that passive bonus health ability?
 
Level 11
Joined
Jan 23, 2015
Messages
788
Please explain what I need to do, cause I haven't done this before.

Do I need to give the unit bonus health and then remove it after 0.01 second? That won't help cause I think it's the same when you modify PDD_amount.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
The damage event fires before the damage is removed from the unit's health. When it is removed from the health if the health falls below 0.405 exactly it will die immediatly. To stop this you re-heal the unit so that it will survive the damage and then after a 0 second timeout (with either timer or periodic event trigger, Wait is limited to 0.1 seconds or worse so will not work) you set the life to the appropriate amount the unit should have after taking that damage. To prevent the unit dying from very large damage sources you use a very large health boost during the time.
 
Level 15
Joined
Aug 14, 2007
Messages
936
ERhmm, you will have to recode the damage detection from scratch, allow me to simplify. . ..

Damage taken event registered when the unit is created.

Actual damage taken trigger.

Post action trigger directly after the event.

The first one is simple, when u create a unit/hero then via trigger u add the event to the actual trigger.

The damage detection activates and using the event Specific unit Takes Damage, this function Calls before damage is taken (BEFORE, BEFORE) alright now why is the a post trigger you ask? Here's the trick, when the detection trigger, make the unit invulnerable, won't take any damage and or crowd controls etc, immediately add a timer with 0 count down, Or something with trigger queue (someone enlighten this I forgot that trick), the point is that the post action must be seeming less and undetected by the player so that they wont see the "Invulnerable" so that you don't expose the trick.

In the post action simple make them back to vulnerable.

One thing to note that the conditions of the health of the damage taken unit can be set at the actual trigger, things happen before damage is being taken. The Killing blow can be then checked from there, the unit will never die since it's invulnerable :D
 
Status
Not open for further replies.
Top