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

Detecting an attack?

Status
Not open for further replies.
Level 11
Joined
Jun 20, 2009
Messages
880
So how can i detect when unit is attacked? If i use
  • Unit - A unit Is attacked
it can be abused by cancelling animation.
I know how to use damage detection system but how can i detect is the damage an attack or some other source?
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
To further elaborate on ^, you would have to trigger all damage for all spells so that it would be using a different damage type. Damage detected that doesn't have a specified damage type could then be considered as damage coming from an attack.

Another way might be using orb abilities and giving them to all units so that they cause a buff when they attack, which you can detect with a damage detection system. I wouldn't really recommend this approach but it might be better if you don't want to trigger every spell.
 
Status
Not open for further replies.
Top