• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Damage detection system, that doesn't overflow on kill?

Status
Not open for further replies.
Level 2
Joined
Mar 18, 2018
Messages
8
Does anyone know how I could accomplish the following: if unit happens to be killed, DDS detects damage that was needed/enough to kill the unit, but no more. I couldn't find a DDS that would detect the damage after it is done.

Like, if a damaging unit has 4000 dmg, and damaged unit has 3 hp left, it detects 3 instead of 4000.

Thanks, in advance.
 
Level 7
Joined
Jan 23, 2011
Messages
350
I don't think you could find one that does that. You could use a trigger positionated at the top of all your triggers with the only use of setting a variable like "TrueDamage", and you check an if like "If life of unit < dmg then set TrueDamage=life of unit"
 
Level 2
Joined
Mar 18, 2018
Messages
8
Thanks to you guys I eventually solved it using A unit is attacked event which reads the HP of attacked unit before the damage is done.
 
Level 2
Joined
Mar 18, 2018
Messages
8
Click Stop before animation finish and watch the glitch happens ^^
I did try that quite some time it is possible indeed, but it isn't a problem for my map, because you can't gain any advantage from it, you can only hurt yourself with the abuse.
 
Status
Not open for further replies.
Top