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

Unit animations

Status
Not open for further replies.
Level 4
Joined
Nov 9, 2005
Messages
113
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.
 
Level 4
Joined
Nov 9, 2005
Messages
113
No, salm could also play spell slam. Anyway, I want to play different attack animations. Like 'attack' and 'attack - 2'.
 
Level 10
Joined
Jul 14, 2004
Messages
463
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
 
Level 4
Joined
Nov 9, 2005
Messages
113
Hey dude thanks, it really works. And indeed it start with 0.
... This is just sooo great. Thanks again dude.
 
Status
Not open for further replies.
Top