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

[Trigger] Play a specific unit animation?

Status
Not open for further replies.
Level 4
Joined
Apr 9, 2011
Messages
84
Hey Guys,

this is a problem I've tried to solve for long, but I've never managed to solve it.
So:

I want to play a specific stand animation of a Militia (Stand -4). The "Play Animation" Trigger doesn't work, I mean, it just does nothing. Is there a way to play unit animations like Stand -4 and so on?

Greetings, Renschi
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Try using the JASS function SetUnitAnimationByIndex and go from 0 up until you find the correct index of the Militia's stand-4 animation.

Do you need help on how to implement this JASS?
 
you can do it in GUI using the GUI action "Custom script", under the general tab...

though you would need to do trial and error on this...

  • Actions
    • Custom script: call SetUnitAnimationByIndex( unit YourMilitia, integer animationindex)
just change unit YourMilitia to the variable pertaining to the militia, and play with the value of integer animationindex
 
Status
Not open for further replies.
Top