• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Name of build animation?

Status
Not open for further replies.
Level 7
Joined
May 11, 2010
Messages
278
I want to make a trigger.

When [EVENT]
Order [UNIT] to play [???] animation.

I want to make a unit play it's build animation without actually building anything, but i can't figure out what the name of the animation is.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can use a function called SetUnitAnimationByIndex(whichUnit, whichIndex) to call specific animation for a unit.

If let's say you have discovered an index of '6' will make the unit (Caster) to play your desired animation, replace the whichIndex as 6 call SetUnitAnimationByIndex(udg_Caster, 6)

Here's a test map to ease your work to find desired animation.
 

Attachments

  • SetUnitAnimationByIndex (1).w3x
    12.8 KB · Views: 59
Level 7
Joined
May 11, 2010
Messages
278
Defskull, i've managed to find the animation (index of 22), and i got it to work! :)
One more thing, is there a way to order a group of units to play the same animation?
 
Last edited:
Level 7
Joined
May 11, 2010
Messages
278
I made a simple solution, but is there a better way?

  • All Animate
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • Custom script: call SetUnitAnimationByIndex (udg_unit, 22)
They won't do it in sync with this trigger :p
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
1. Add a set bj_wantDestroyGroup = true above the Unit Group action to clear its leak.
2. Don't use variable as you only reference them once, just call SetUnitAnimationByIndex(GetEnumUnit(), 22)

It should look like this;
  • All Animate
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Custom script: call SetUnitAnimationByIndex(GetEnumUnit(), 22)
 
Status
Not open for further replies.
Top