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

The Animation Doesn't work!

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
800
Some animations won't play using that function. Instead use


  • Custom script: call SetUnitAnimationByIndex(unit, integer)
You'll need to get the index of the animation you want to play, though. Which is annoying because it doesn't match up to the order of the animations in the object editor's little animation player thingy, and it isn't standard for all units. I happen to know off the top of my head that a Footman's walk animation is 6, so if I wanted to make my footman play its walk animation I'd do

  • Set unit = Footman 0001 <gen>
  • Custom script: call SetUnitAnimationByIndex(udg_unit, 6)

This is the method I use for getting animation indexes, since I haven't heard of any better way.

  • Play
    • Events
      • Player - Player 1 (Red) types a chat message containing play as A substring
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • Set int = (Integer((Substring((Entered chat string), 5, 6))))
          • Custom script: call SetUnitAnimationByIndex(udg_unit, udg_int)
Also worth noting animation indexes start at 0, not 1.
 
This is the method I use for getting animation indexes, since I haven't heard of any better way.

  • Play
    • Events
      • Player - Player 1 (Red) types a chat message containing play as A substring
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • Set int = (Integer((Substring((Entered chat string), 5, 6))))
          • Custom script: call SetUnitAnimationByIndex(udg_unit, udg_int)
Also worth noting animation indexes start at 0, not 1.

You can see the animation index from the WE Maybe that what I have noticed, when he show you the unit you selected you can choose the animation, search for the one you want and see which number it is, start counting from the first animation the WE put, usually it is(Stand -1).
 
Status
Not open for further replies.
Top