• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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: 57
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