• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How to force unit play specific animation for x seconds?

Level 20
Joined
Aug 29, 2012
Messages
832
You can use "queue animation"

  • Trigger
    • Events
    • Conditions
    • Actions
      • Animation - Play Footman 0000 <gen>'s attack animation
      • Animation - Queue Footman 0000 <gen>'s attack animation
      • Animation - Queue Footman 0000 <gen>'s attack animation
      • Animation - Queue Footman 0000 <gen>'s attack animation
      • Wait 4.00 seconds
      • Animation - Reset Footman 0000 <gen>'s animation
In this example, it will perform 4 animations in total, one after the other, add as many as can fit in your time period and then you reset the anim
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
You can use "queue animation"

  • Trigger
    • Events
    • Conditions
    • Actions
      • Animation - Play Footman 0000 <gen>'s attack animation
      • Animation - Queue Footman 0000 <gen>'s attack animation
      • Animation - Queue Footman 0000 <gen>'s attack animation
      • Animation - Queue Footman 0000 <gen>'s attack animation
      • Wait 4.00 seconds
      • Animation - Reset Footman 0000 <gen>'s animation
In this example, it will perform 4 animations in total, one after the other, add as many as can fit in your time period and then you reset the anim
I am playing howl animation of the wolves. But trigger runs before action does. How to make it properly as you mentioned?
I want to "force" unit.
No howl, no trigger run.
Animation name: Spell Slam
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
So when you cast an ability the unit is going to play an Animation based on the Art - Animation Names field (assuming the ability isn't Instant like Wind Walk):
art.png

It will play a default animation even if you leave it blank. This is what interferes with the animation in your trigger.

With that in mind, it sounds like you want to use the Casting Time field of your ability.

What you would do is set the Art - Animation Names of your ability to stand, change the Casting Time to match the length of your animation, and make a trigger to detect when the ability begins it's Casting Time and Play your animation in response:
  • Example
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Feral Spirit
    • Actions
      • Wait 0.00 seconds
      • Animation - Play (Triggering unit)'s attack animation
      • Animation - Queue (Triggering unit)'s stand animation
Note that the Wait is needed since the unit's animation from the Art - Animation Name will overwrite any animations you play too early.

You can use a Timer to make the unit play the animation after 0.00 seconds (on the next frame) if you want the Animation to play immediately. This is better than using a Wait since Waits need to be synced in multiplayer and have a minimum Wait time.

For a triggered custom spell you would use the "Starts the effect of an ability" event to detect when the Casting Time is finished. So you would have both the above animation trigger and your own spell trigger for when it actually casts.
 
Last edited:
Top