wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Tutorials > General Mapping Tutorials
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 06-27-2006, 01:00 AM   #1
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default PandaMine's Tutorial to Using Animations

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
Edit:
- Forgot to mention that anything below 0.10 in the Wait Action is interpreted as 0.10
- Added a JASS Script that allows you to play an animation 0.01 seconds after spell cast (using PolledWait)

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
Zoom (requires log in)
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
Zoom (requires log in)
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
Zoom (requires log in)
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

Trigger:
Custom Script: call SetUnitAnimationbyIndex(udg_tempunit,3)

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

Trigger:
Animation - Set current animation to temp unit to its 3th animation

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

Incorrect Trigger:
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Storm Bolt
Collapse Actions
Set tempunit = (Triggering unit)
Custom script: call SetUnitAnimationByIndex(udg_tempunit,3)

What you would need to do is add in a Wait function of 0.10 seconds (anything below 0.10 using the TriggerSleepAction which is Wait in GUI is interpreted as 0.10). 0.10 Seconds can still be noticed, so you need to set the Art – Animation Names to “stand” so you do not see a sudden twitch in the animation. For further accuracy you would also want to increase the Duration of the base ability by 0.10.

Correct Trigger:
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Storm Bolt
Collapse Actions
Set tempunit = (Triggering unit)
Wait 0.10 seconds
Custom script: call SetUnitAnimationByIndex(udg_tempunit,3)


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. If you want to be as perfect as possible you would need to use a JASS Script with the PolledWait function. Here is an example below

Collapse JASS:
function Trig_Example_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' 
endfunction

function Trig_Example_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    call PolledWait(0.01)
    call SetUnitAnimationByIndex(caster, 3)
endfunction

//==== Init Trigger Example ====
function InitTrig_Example takes nothing returns nothing
    set gg_trg_Example = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Example, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition(gg_trg_Example, Condition(function Trig_Example_Conditions))
    call TriggerAddAction(gg_trg_Example, function Trig_Example_Actions)
endfunction

If you dont understand JASS then simply, create a New Trigger and call it whatever you want, go to Edit - Convert To Custom Text and delete whatever is in there and paste this script in. Where ever you see Example, replace it with the name of the trigger and change the rawcode of the ability to the appropriate ability. In SetUnitAnimationIndex where you see the integer 3, change it to what animation you want.

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

Trigger:
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing (270) degrees
Animation - Play (Last created unit)'s birth animations


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

Trigger:
Actions
Unit - Add Locust to tempunit
Animation - Play tempunit's death animation
Wait 2.80 seconds
Unit - Remove tempunit from the game
Unit - Create a Archmage corpse for (Owner of tempunit) at (Position of tempunit)

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
Attached Images
File Type: jpg tutorial01.jpg (30.9 KB, 994 views)
File Type: jpg tutorial02.jpg (20.8 KB, 896 views)
File Type: jpg tutorial03.jpg (56.7 KB, 871 views)

Last edited by PandaMine : 09-01-2006 at 02:51 AM.
PandaMine is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 06-30-2006, 01:55 PM   #2
Lordbevan
User
 
Join Date: Sep 2005
Posts: 20

Lordbevan has little to show at this moment (0)

Default

I want to know if there are other commands for the second strings, example I know looping is an extra one that u can add.

Also when i use stand, victory in the art-animation tags the animation just wont go away.
Lordbevan is offline   Reply With Quote
Old 07-01-2006, 02:55 AM   #3
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

Quote:
Originally Posted by Lordbevan
I want to know if there are other commands for the second strings, example I know looping is an extra one that u can add.

Also when i use stand, victory in the art-animation tags the animation just wont go away.

Animations by default loop anyways, the only animations that dont loop are the attack animation made when you do an attack command. If there is a "loop" string im not aware of it

You need to remove the animation tag (i.e. "stand,victory") when your done, otherwise the animations will constantly loop (since animations loop by default)

I will need to make another section on looping animations soon

Last edited by PandaMine : 07-01-2006 at 03:06 AM.
PandaMine is offline   Reply With Quote
Old 07-25-2006, 12:12 AM   #4
Raq_Thao
User
 
Join Date: Jan 2006
Posts: 19

Raq_Thao has little to show at this moment (0)

Default

Great tut! Helped enormously.
Raq_Thao is offline   Reply With Quote
Old 09-01-2006, 02:50 AM   #5
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

Updated
- Forgot to mention that anything below 0.10 in the Wait Action is interpreted as 0.10
- Added a JASS Script that allows you to play an animation 0.01 seconds after spell cast (using PolledWait)
PandaMine is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:50 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2017, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services