Using Animations

P

PandaMine

Guest
PandaMines Tutorial To Using Animations v1.00
The following tutorial will tell you how to use unit animations through the Object Editor or Trigger Editor, it will even tell you how to do specific unit animations (through trigger editor) and replace animations done through the Object Editor

You Will Need
World Editor or World Editor Unlimited
Basic WE Knowledge
Medium Trigger Knowledge
WC3 Viewer

NOTE: Some of the terminology I made up myself in this guide so it is easier for readers to understand the animations, the real terms can differ

What are animations?
Animations is the movements played by a model when WE gives the model certain command. By default when units aren’t doing anything they play the “stand” animation and when they are given orders they play a specific or variation of an animation. Animations differ from model to model, however each model support by WE has specific animations which will be explained

Viewing Animations
There are many tools for viewing models (such as Warcraft 3 Viewer and Warcraft 3 Model Editor) however the easiest way to view animations is the one inbuilt into the WE. Below is a screenshot of where the Model Viewer is located, it is located on the left side of the World Editor Main Window and will display the model of the current unit/doodad/destructible/model seletected
tutorial01.jpg

Animation: Tells you the current animation that is playing, it also tells you how long the animation takes in seconds (in this case its 2.833 seconds)
Distance: Allows you to change how distant the model looks in the view
Rotate: Allows you to rotate the model
Lighting: Allows you to change the lighting

What are the different type of animations?
Listed below are the different types of animations and their specific animations. Animations are divided into 2 parts, there is the animation type which is then followed by a specific animation. The animation type has to be the same for each model but the specific animations can differ. If the WE is told just to do an animation type it will do a random animation from that type, however if it is followed by a certain specific animation then it will play that animation. In most cases the specific animations are followed by an integer such as “attack – 2” or “stand - 3” or use WE animation names such as “slam” or “channel”

Attack: This animation is played when a unit is ordered to attack and the attacking unit is within Combat Range
Birth: This animation is played when a Unit is spawned or summoned. NOTE: that it does not play when a unit is created through the Create 1 Unit for Player at Point Facing Degrees/Point Function
Death: This animation is played when a unit dies, like with Birth it doesn’t play when the unit is removed through the Remove Unit function, it however will play with the Unit Explode Function
Decay: This plays when a unit that isn’t a hero or a building dies. The animation in most cases are the bones of the model
Dissipate: This animation replaces the Decay animation for Units that are heroes. In most cases it’s the hero rising into the air
Morph: This replaces the normal animations when a Unit is morphed by an ability. In most cases this animation has the “morphed” variations of the “attack”, “death”, “stand” and “walk” animations which replace the normal animations until the unit is morphed back
Spell: This animation is played when a unit starts casting a spell
Stand: This animation is played when the unit doesn’t have any command from WE (i.e. is standing)
Walk: This animation is played when a unit is ordered to move

What are the specific Animations?
You may have noticed that a model has certain different types of the animations such as “attack – slam” or “stand - channel”. These animation names are inbuilt by the World Editor to be played when a specific order is given (in most cases its spells). There are 2 types of specific animations, normal Specific Animations and Random Specific Animations.
Specific Animations
These animations are often used with “birth”, “walk”, “spell”, “death” and “dissipate” animations. When called by the WE, they will only play that one animation. As an example when a unit casts the “Chain Lightning Spell” by default it calls the unit to play the “spell – chain” animation
Random Animations
These animations are played by random within an animation type. The are always characterized with integers after the animation name. These animations are often used with “attack” and “stand” animations. As an example when a unit is ordered to attack another unit, it will play either the “attack – 1”, “attack – 2” or “attack – 3” animations.
NOTE: In actual fact, the animations aren’t totally random, the “attack – 1” animation has a common chance of played where as the “attack – 2” has a rare chance of being played. The common and rare terms are used in GUI/Jass and will be explained later on

Animations with the Object Editor
Animations are used within the object editor when dealing with abilities. All other animations such as walk, attack, death etc are inbuilt into WE and can only be changed with GUI/Jass. The string/s that stores the animation names is shown below and multiple strings are separated by a comma
tutorial07.jpg

As you can see it can store multiple strings and this is used with specific animations. If you want to change the animation, the first string you enter will always be the animation type i.e. “attack”, “stand” or “spell”. If this is the only animation you enter it will play
a) If it is a specific animation the first specific animation (i.e. “spell”, “birth” or “death”)
b) If it is a random animation it will play one of random animations (i.e. “attack” will cause to play one of the attack animations”)
You then can add a second string, which is used to play a certain specific animation. The second string must contain the 2nd part of the animation name (after the – symbol). Some common specific animation names are “channel”, “slam”, “alternate” etc
NOTE: You CANNOT specify which random animation you want to play with the Object Editor, this can only be done through GUI/Jass

If the animation for the first string doesn’t exist, then it will play the “spell animation”, if the animation doesn’t exist for the second string then it will play the first string
Some Examples
“spell”: Will play the spell animation
“spell,channel”: Will play the spell channel animation
“attack”: Will play one of the attack animations
“fly”: Since this animation is not a valid animation, it will play the “spell”animation
“spell,chain” Lets assume that you changed the model of the unit using this ability from the Far Seer model to another one. Since Far Seer is the only Blizzard Model with the Spell Chain animation it will only play the first specific “spell” animation

Animations with Triggers
Triggers give you full grasp of the animation capabilities. Jass isn’t required in animations except for one function which can be used with a custom script (or is included in World Editor Unlimited). Listed below are the different animation functions

Play Unit Animation: Does the exact same as the Object Editor’s Art - Animation Names. Can play specific animations but not random animations
Play Unit Animation (Specify Rarity): When dealing with Random Animations, it will allow you to either play the rare or common animation. In most cases the common animation is the usually “attack – 1” where as the rare animation is “attack – 2” or “attack – 3”. This has no effect on Specific Animations (it will just play the specific animation)
Queue Unit Animation: Causes a unit not to play any other animations until it plays the specified animation
Reset Unit Animation: Causes the unit to play the animation it is supposed to be playing (i.e. if you caused a unit to play the “spell” animation and you used this function, it would cause the unit to play the “stand” animation if it is currently standing)
Add/Remove Animation Tags: Animation tags are just the same as custom values but there just animations, you can add/remove an animation tag to a unit which you can then play later
Change Unit Animation Speed: Does exactly what it says, sets the animation speed to a percentage (is quite handy for matrix or lightning quick effects) causing any future animations made by that unit to play at that speed.
NOTE: Once your trigger is finished what its supposed to be doing don’t forgot to set the animation speed back to 100%
Play Destructible Animation: Same as Play Unit Animation but with Destructible’s
Queue Destructible Animation: Same as Queue Unit Animation but with Destructible’s
Change Destructible Animation Speed: Same as Change Unit Animation speed but with Destructible’s
Play Animation For Doodads in Region: Plays all the animations for all the Doodads in a certain region
Play Animation For Doodads in Region: Same as Play Animation For Doodads in Region but with a circle

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
tutorial02.jpg

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

tutorial08.jpg


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

If you have World Editor Unlimited you would use the following action

tutorial09.jpg


How do I make play a specific animation when a unit casts an ability
Many people seem to have this problem, and I have also had it. The problem is the Object Editor doesn’t allow you to play definite animations (it doesn’t support the SetUnitAnimationByIndex function) so it means you would have to trigger the ability. That however isn’t the main problem which is that when a unit is given 2 commands to play an animation at the exact same time, only the first animation called is played. Object Editor functions are always called before the corresponding Trigger Action, so using the following trigger will not work as it will only play the animation specified in the Object Editor

tutorial03.jpg


What you would need to do is add in a Wait function of 0.01 seconds. This is virtually undistinguishable to the human eye however it allows you to play the animation. For further accuracy you would also want to increase the Duration of the base ability by 0.01. It would also be a good idea to set the Art – Animation Names to “stand” so you do not see a sudden twitch in the animation

tutorial04.jpg


This is the correct version of the trigger. Likewise you could do the same with common/rare animations and play animation Tags, but in all other situations just change the Art – Animation Names in the Object Editor. From this you have also learnt you cannot replace animations, you have to override the animation by making it play an animation 0.01 seconds after the replacing animation

My Unit Animations Isn’t Play At All
Here is a checklist for most of the common problems
1. Does the animation exist?
2. Is the unit being given any orders when the animation is being played
3. Is there a queued unit animation
4. If referring to a Animation Tag, did you add that animation tag

My animations aren’t playing at the right speed
You have some Trigger that caused that unit to increase/decrease its attack speed and you obviously forgot to set it to 100%. Remember to set the unit animation speed to 100% when your finished with the trigger

How do I play the Birth Animation when a unit is created
Just simply tell the last created unit to play the animation

tutorial05.jpg


How do I play the Death Animation when I use Remove Unit
The easiest solution is to use the Explode Unit function (which displays the Death Animation). If for some reason you need to use the Remove Unit function then you would need to note down the duration of the death animation and use the following trigger

tutorial06.jpg


The locust ability is added to the unit so it cannot be selected and to remove the health bar while its dying. The units “death” animation is then played, a wait is added in which is the same duration as the “death” animation. The unit is then removed and a corpse is left behind at the position of the unit

More Questions and Answers will be added when people reply
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
PandaMine said:
What you would need to do is add in a Wait function of 0.01 seconds.
Or just make a wat function of .1 seconds because thats what the game interprets a wait of .01 as.
 
P

PandaMine

Guest
Archer 1 said:
for the last one, why not just "kill unit?"

but a good tutorial. :)

Some people may want to use the remove unit trigger, since kill unit adds to the score and activates other triggers

As it is stated IF a person for a reason wants to use remove unit this is what you would do
 
P

PandaMine

Guest
I have listed all the animation types, however for all the different specific animations (such as slam, channel etc) there are over 100 different types for those, and some animations are only specific for those units i.e. Ancient Protector has an Animation called Eat Tree and is the only unit that has that animation. I could list all the animations but it would take some time

I have also fixed some minor formatting and spelling issues
 

Chocobo

White-Flower
Reaction score
409
PandaMine said:
I have listed all the animation types, however for all the different specific animations (such as slam, channel etc) there are over 100 different types for those, and some animations are only specific for those units i.e. Ancient Protector has an Animation called Eat Tree and is the only unit that has that animation. I could list all the animations but it would take some time

I have also fixed some minor formatting and spelling issues

I listed one time the full list of animations in this forum but my account got deleted, so I want to get again the full list of animations. That is why I am telling you if you can list the animations list (Maybe if not all, at least units' animations, not buildings)
 
D

Doomsday

Guest
Great tutorial. Can help many people on using triggered spells, jumping, sliding, etc.
+Rep from me.
 
M

MysterySoul

Guest
Hmmm, is it possible to have different units do different animations, i.e. Devour/eat animation for different unit that didn't had it before? :confused:
 

Vulcansurge

Ultra Cool Member
Reaction score
27
I need to know how to use a specific attack animation. In my spell, which I have the trigger for below, I need to use the second attack animation, by when the trigger is activated, it still uses a random attack animation. This is what I have written:

Code:
Actions:
Animation - Play (Casting Unit's) Attack 2 Animation

This is annoying me because I've changed the text to stuff like "attack2", "2nd attack", and "attack - 2"... With no results. Help me! :) I know you said to animations are random, as in i wont be able to change it, but you also mentioned you might be able to do it with the help of JASS...
 

Newbwc3

Sephiroth_VII
Reaction score
156
I read this whole tut just because I've had that same problem and even posted it but no one seemed to know, they just told me to put in different stuff like "Attack2" "Attack-2"... But I think I figured it out! Just look in this section of the tut : "The Set Unit Animation by Index Function"


EDIT: Sorry but i just relized u posted this last year! lol
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Lol... *My Ressurection of the Dead Thread* Written by: Newbwc3
"I was there, lurking in the shadows of the tutorial repository. Then, suddenly I noticed a tutorial. It's name was "Using Animations"! That was exactly what I needed! I read or skimmed through the whole tutorial and I found out my problem! But then, I looked at the posting time... June 26th 2006... My ressurection of the dead thread." :D

Anyways, the set unit animation by index is a JASS function.
It is:
Code:
     call SetUnitAnimationByIndex(<Unit>, <Index ID #>)
I think that is what it is, that is how I remember it. So if you wanted a blademaster to do "attack slam" I think it would be something like this:
Code:
     call SetUnitAnimationByIndex(Blademaster, 2)
Of course, Blademaster is a local unit though otherwise it would get jacked up. Lol... :D
I think you can find out index animation #s by using W3Viewer or Magos's Model Editor, but I'm not sure. :shades:
 

Newbwc3

Sephiroth_VII
Reaction score
156
thanks for the little classroom session there but as i said i already read the tut so i know. Anyway lets not bring up this thread let it fall back into the cracks of society:) :D
 

chovynz

We are all noobs! in different states of Noobism!
Reaction score
130
Got a suggestion for this thread. Want to include this little tidbit?
. Abusive Using of Backward Animations

When you want to play an animation in reverse mode, like the death animation of a footman, an archer.. or whatever you want, you think for triggers that -100.00% in animation speed is imposible, but, it is possible.

Example with that trigger that has a death unit of 2.333s :

Code:

Code:
Events 
    Selection - Player 1 (Red) selects a unit 
Conditions 
Actions 
    Set MyUnit = (Selected unit) 
    Animation - Play MyUnit's Animation - death animation 
    Animation - Change MyUnit's animation speed to 500.00% of its original speed
    Animation - Change MyUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
    Wait (2.333 / (500.00 / 100.00)) seconds of game-time
    Animation - Change MyUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    Animation - Change MyUnit's animation speed to (0.00 - 100.00)% of its original speed
    Wait 2.333 seconds of game-time
    Animation - Change MyUnit's animation speed to 100.00% of its original speed
    Animation - Play MyUnit's Animation - stand animation

Notice : 2.333/(500.00/100.00) = 0.4666
2.333 : Death Animation Time (this is not constant for all units)
500.00 = 500.00% of its original speed
100.00 = A meaning for 100%, bracking 500.00 to 5.

The death animation is played first, with an improvement of the animation speed by 5x and a vertex coloring making the unit invisible to avoid death particles. Then there is a Polled Wait, and the vertex come back to the normal values and the animation speed is reversed. And after, it waits until the animation is fully reversed and the animation is set to 100.00% and to stand to avoid the unit to stuck doing nothing.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top