• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Alternative Animations

Status
Not open for further replies.
Level 18
Joined
Mar 7, 2005
Messages
824
As I remember, there might be some function that can notice animations..

So simply replace them, like:

If Animation "stand" is playing
do - play "stand alternate"

so simply override the current animations
(maybe you have to stop them first, before running the alternate animation, so they don't mix/interupt themselves)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
You can use:
  • Custom Script: call SetUnitAnimationByIndex(unit,integer)
where unit is a local unit variable (you can also use udg_yourGUIvariable)
and where integer is the index of the animation.

A simple check to see which index each animation has can be done by looping this function call through the integer (index).

Another way of showing the alternative of an animation is by using:
  • Animation - Play Unit Animation (Specify Rarity)
Even though it's old here is a tutorial on animations:
using animations
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Here's a small system to test your unit's animation index.
Once you get the value, just use it, let's say it is 6, then at all times you should use 6 to execute that particular animation.
 

Attachments

  • SetUnitAnimationByIndex (1).w3x
    12.7 KB · Views: 66
Status
Not open for further replies.
Top