• 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.

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