Two simple questions.

bowser499

Member
Reaction score
1
1. How to play a unit's walk animation? It don't work if use a trigger.
2. How to attach sound to the special effect model (where to set its path)?
 

Moridin

Snow Leopard
Reaction score
144
Just tested it...and you're right...the walk animation doesn't play fully. It seems to stop just after a very short time period.

I'm going to test out different methods of queing animations...I'll also look around for this.

Could someone else more experienced in animations reply?

Edit:
Searched around and found This thread.
Quoted from that thread:
Actually I just discovered how to resolve the issue. By using SetUnitAnimationByIndex() I was able to solve the issue. Thanks for the help anyway.

As for the indexing thing. I found this tutorial in our resources section, with this in it:

The Set Unit Animation by Index Function
Unfortunately but not surprisingly Blizzard forgot to put the Set Unit Animation by Index into GUI. This means you have to use the Custom Script Action. You could also use World Editor Unlimited by Pitzermike which has the Set Unit Animation by Index as an added action.

The function basically allows you to play ANY specific animation for a unit. It doesn’t take into account any strings or “rare” and “common” values, it just takes into account an Integer which is the number of the animation. The problem many people have with this function is that the order of the animations is NOT the same as the order in the Model Viewer inbuilt into WE. This is because the WE viewer automatically re-arranges the animations into the “stand”, “walk”, “attack”, “death”, “decay”, “dissipate”, “morph” and “birth” order.
In order to determine which Index to use, you can use Warcraft 3 Viewer. Open the model in Warcraft 3 Viewer and open the Treeview Window (CTRL + H). In the Animation section you will see the various animations, the order in which they are in is the same as the Integer you would use. Have a look at the screenshot below for an example

Using the same example for the Archmage, if we want to play the “Attack – 1” animation using the Set Unit Animation by Index function you would use the number 4 since it’s the 5th number down from the list and 0 is the first integer. In this case however its simpler to use the Play Unit Animation function since there is only one “attack” animation type.
Custom Script: call SetUnitAnimationByIndex(unit,integer)
This is the custom script you would use, below is an example



This is the custom script you would use cause the unit assigned to the variable tempunit to play the 3rd Animation. If you are using Jass it also supports local variables

Hope that resolves your problem.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
to give some more explanation, the "walk" animation is looping, its only very short, if you force a unit to play an animation it will play it only once and stop. however you can force your unit to play its "walk" animation periodically and the animation will loop correctly (it wont start from the beginning even if you play the animation every 0.01secs)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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