• 🏆 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!

Whole trigger fcks up

Status
Not open for further replies.
Level 7
Joined
Aug 17, 2012
Messages
256
  • Custom script: call SetUnitAnimationByIndex(gg_unit_hfoo_0000, "Stand Victory - 5")
When i use this custom script the whole trigger fucks up when i try to save (e.g it says the wait trigger is invalid or something (i have absolutely no jass knowledge) etc.)
When i remove this custom script it's all right but i need this, any pro guys out there who know how to fix this?
Thanks

EDIT:
  • Animation - Play Footman 0000 <gen>'s Stand Victory - 5 animation
Why this trigger doesn't work as intended?
It plays multiple animations instead
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
The custom script looks like this:
  • Custom script: call SetUnitAnimationByIndex('unit', 'animation index')
First, like Maker wrote, index is an integer number, thus "Stand Victory - 5" won't work. You can find out the index using for example WC3 Viewer. Find footman unit there and look at its animation list. The first animation (the top one) has index 0; second has index 1; fifth has index 4 and so on.
for example like this
(none)
Stand - 1
Stand - 2
Attack - 1
Attack - 2
Stand Victory
Death
Decay
"(none)" is not animation. Stand - 1 is the first animation, so it's index is 0; Attack - 1 is 3rd animation, so its index is 2.

Now in trigger, save the unit into "unit"-type variable. Mine variable is called simply "unit"
Then use this
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set unit = Footman 0332 <gen>
      • Custom script: call SetUnitAnimationByIndex(udg_unit, 0)
      • Set unit = No unit
note that because "unit" is variable, you need to use the "udg_" prefix before the variable name. also be sure to have same capital letters in the custom script like in the example.
 
Status
Not open for further replies.
Top