Warcraft III resources & community, 2003–2006 · archived

Unit animations

7 posts
#1

Unit animations

Why do triggers never play a unit's correct animation?
A trigger like:

E - whatever
C - none
A - play xxx's 'attack slam' animation

or 'attack - 2' or 'attack'
I know you have to type it yourself as a string and I
triple-checked the animation names of the unit and typed
it 100 different ways. Still, it always plays the wrong
animation. Please, help me.
#2
For the attack slam animation just type in slam would be enough, no more, no less.
#3
No, salm could also play spell slam. Anyway, I want to play different attack animations. Like 'attack' and 'attack - 2'.
#4
You can use the JASS function SetUnitAnimationByIndex for that. Do you know how to use it?
#5
uhh... nah. sry
Could you tell me please, i've never used JASS.
#6
Just insert a custom script action in to your code and enter:
call SetUnitAnimationByIndex( unit, number )

Replace "unit" with a unit. The easiest way to do that is to set a unit variable and then enter the variable's name just with the prefix "udg_". To refer directly to a unit you have to know its exactly name. To find it out, make a new trigger without events or conditions and make an "Remove unit" action for the unit you want. Convert the trigger to custom text (Menu 'Edit') and copy it's name, it's a combination of prefix, some letters and a number, you'll find it in the brackets after "call RemoveUnit". After copying you can of course remove the trigger, since it is senseless.
For the number, type in the number of the animation. To find out the right one, open the model in Warcraft III Viewer and count the animations from top to down beginning with 0 or just try.

I hope this will help you!
Greetings,
Waldbaer
#7
Hey dude thanks, it really works. And indeed it start with 0.
... This is just sooo great. Thanks again dude.