• 🏆 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!

Damage detection triggers

Status
Not open for further replies.
Level 13
Joined
Nov 4, 2006
Messages
1,239
Hi guys,

i recently stumbled upon the following event:

  • Unit - A Unit takes damage
there are also several responses to it, like you can refer to the damage taken (real value), damage source, damaged unit

i did some quick testing and it seems to be fairly accurate, with the exception that when you kill a unit it detects the damage you would have done instead of the remaining hp of the unit

Anyone uses it, can it somewhat replace a damage detection system? any known bugs?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
So the reason for Damage Detection systems being created in the first place was 1) The Events were only available to Jass users. 2) To make Damage Events easier to control/manage.

Here are the original Jass-only Events:
JASS:
EVENT_UNIT_DAMAGED
EVENT_UNIT_DAMAGING
And the new GUI Events:
JASS:
EVENT_PLAYER_UNIT_DAMAGED
EVENT_PLAYER_UNIT_DAMAGING

EVENT_PLAYER_UNIT_DAMAGED:
  • Unit - A unit Takes damage
EVENT_PLAYER_UNIT_DAMAGING:
  • Unit - A unit About to take damage
What's different about the Jass/GUI Events? I'm not 100% sure to be honest, but I think it's safe to assume that they're almost identical. I know they use the same Event Responses and I know the GUI Events work fine from personal experience. Hopefully someone with more experience like @Bribe could explain the differences.

Edit:
To answer your questions, yes, and I don't know of any bugs. That being said, it's probably best just to use Bribe's Damage Engine as it covers basically every issue you could possibly run into when dealing with this sort of thing.
 
Last edited:
Status
Not open for further replies.
Top