call SetUnitAnimationByIndex... Burning Question

•Pooter•

Guest
When my hero casts I spell I want him to use attack - 2 animation. I tried using call SetUnitAnimationByIndex(GetTriggerUnit(), 2) and it didn't work. Can anyone help?

Code:
call SetUnitAnimationByIndex[COLOR=Orange](GetTriggerUnit(), 2) [/COLOR] 
If I put in 2 after GetTriggerUnit(),would make the unit play attack - 2 when I use Play Unit's attack Animation?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Attack 2 doesn't necessarily have 2 as index.

Get something like wc3viewer to have a look at the model.
Or write a trigger that plays them, with a 3 or so seconds wait in between.
Preferably also telling you what index it's currently playing.
 

•Pooter•

Guest
Unfortunately I don't have wc3viewer :( , could you tell me the script that would make him play attack - 2?
 

•Pooter•

Guest
Where can I find the index it's currently playing? I can only see the Tauren Chieftain's attack - 2 animation...

EDIT: And what would the script look like if I were to change it's index to 2? Would it be call SetUnitAnimationByIndex(udg_Caster, 2) ?
 

corvusHaunt

New Member
Reaction score
96
Animation indexes are included with the model, each one is different. The 'Attack' anim might have index 5 for a Footman, but index 2 for a Peasant. Just make a script that plays unit animations when you select a unit, and shows what index it is currently showing. That, or you open up the model stuff in notepad and look at the animations, which should be listed. Look for the animation you want and copy the index :)
 

•Pooter•

Guest
But what if the index is 2? call SetUnitAnimationByIndex(udg_Caster,2) << is that correct?!? please just give me an example!
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top