• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Detect Damage event

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
320
How can I detect whether a unit has taken damage from any source? There is only event "is atttacked" bit this fires immediatelly before actually taking any damage.

Thank you for help.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I think the generic GUI event is missing still, but it is available.

call TriggerRegisterAnyUnitEventBJ( myTrigger, EVENT_PLAYER_UNIT_DAMAGING )
GetTriggerUnit() for who was damaged
GetEventDamageSource() for who did the damage

Using a DDS is still advisable.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,275
Use the generic unit event that was added in 1.31.

Anyone claiming it does not exist either is using GUI, or is using a pirated version of Warcraft III so have not updated to 1.31.

1.31 added generic player events for taking damage as well as a new event which fires before damage is reduced by armor allowing the damage to be modified directly. However it did not added either events to GUI, meaning one has to use JASS/Lua directly to use them. If you can only use GUI then use a recently updated damage detection system and let that handle all the custom script work.

Do note that the community may stop calling these "DDS" seeing how they are not Direct Draw Surface textures which Warcraft III Reforged uses.
 
Level 9
Joined
Dec 31, 2016
Messages
320
Yes, I use GUI. I should probably learn Jass sometime, but I am just too lazy I guess. :d Also I don't really see why they didn't add it to GUI too. It already exists for specific so why not for generic.
 
Status
Not open for further replies.
Top