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

Trigger Executes When Unit/Doodad is playing a specific animation

Status
Not open for further replies.
Level 11
Joined
Nov 25, 2014
Messages
526
As above. How would the trigger be? There is a trigger where when UnitX is close to another unit/doodad, it will play death animation. When UnitX approaches the unit/doodad again, it won't fire unless the unit/doodad is playing stand animation.

Example:
A passes by B, if B is playing stand animation, B will now play death animation and 20 Gold is deducted. When A passes by B again, and B is now playing death animation, no gold is deducted.

SO basically, I need an animation condition.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
There is no such function. All natives only allow setting an animation, not getting it.
You have to keep track of the animations yourself. For example when the unitX comes close to another unit, you store in a hashtable (for example), that unitX plays its death animation. You also start a timer, that lasts as long as the death animation and when the timer expires, you store that the unit is playing its stand animation. This way you know whenever death animation is played.
 
Status
Not open for further replies.
Top