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

[Spell] GUI Animation doesn't go off

Status
Not open for further replies.
Level 2
Joined
Dec 22, 2016
Messages
9
I feel like this is sort of a noob-question, but I'm clueless on how to solve it.

  • Jump Timer Player 1
    • Events
      • Time - JumpTimerPlayer1 expires
    • Conditions
    • Actions
      • Unit - Pause on Sportler1
      • Unit - Hide Sportler1
      • Unit - Create 1 Sportler (flying) for Player 1 (Red) at (Position of Sportler1) facing (Facing of Sportler1) degrees
      • Set SportlerDummy[1] = (Last created unit)
      • Animation - Play SportlerDummy[1]'s stand 3 animation
      • Selection - Select SportlerDummy[1] for Player 1 (Red)
      • Trigger - Turn on Jump Player 1 up <gen>
      • Trigger - Turn on Jump Player 1 forw <gen>
The model I'm using is the standard warcraft 3 Forest Troll, due to his backflip animation. The animation preview on the left shows me, that the backflip's name should be "Stand - 3", but it doesn't work. Ingame, the unit always just does a random one of the 3 stand animations, but I need exactly that stand 3 animation. I've already tried phrasing it "stand", "stand 3", "Stand3", "Stand - 3", "Stand -3" and so forth instead, but it just won't work. Not even "Walk", "Walk 1" or "Walk - 1" works, only "attack", "spell" and "death".

I've discovered the "Custom script: call SetUnitAnimationByIndex(unit, index)", but can't really figure out how to use it with the "SportlerDummy" Array, but even if I change it to "SportlerDummy1" without array (which means more work for me), I still can't figure out what the hell the "index" is.

I got that it is some sort of Integer, but the trigger gets an error when I fill in one of my integer variables (like ... "call SetUnitAnimationByIndex(SportlerDummy1, AnimationInteger). It also doesn't work, when I just fill in a number ("call SetUnitAnimationByIndex(SportlerDummy1, 3).

What am I doing wrong and how exactly does the "index" here work?
 
Play animation should play it once. "stand - 3" should have worked.

call SetUnitAnimationByIndex(SportlerDummy1, 3)

^with this function you can loop an animation. Though your syntax is wrong, that's the right one:

call SetUnitAnimationByIndex(udg_SportlerDummy[1], 3)

^GUI variables need an udg_ prefix when used in JASS (custom script). And the array index is defined in such brackets [].
 
Level 2
Joined
Dec 22, 2016
Messages
9
^GUI variables need an udg_ prefix when used in JASS (custom script). And the array index is defined in such brackets [].

Ah that is interesting, I've always been wondering what the "udg_" means in my "call RemoveLocation" scripts.

empty.gif
join.gif
ani.gif
Animation - Play SportlerDummy[1]'s stand - 3 animation
does definitely not work, for whatever reason.

No guanrantee the index is 3, start at 0 and keep going until you find the one you want.

Correct, "call SetUnitAnimationByIndex(udg_SportlerDummy[1], 3)" triggers the spell animation. The stand - 3 animation is on ", 2)".

Problem solved.
 
Status
Not open for further replies.
Top