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

[Solved] Animation problems with Locust units (Mountain King Alternate Animation)

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
I was having issues with changing the Mountain King to it's alternate Avatar animation while it had the Locust ability and making it play the alternate animations.

EDIT: Solved, the indexes for the alternate Mountain King animations start at 13. I was using the non-alternate ones and that was causing the hero to reset it's animation.

Here is the working trigger:
  • Working
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Zeus Dummy for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Animation - Add the alternate animation tag to (Last created unit)
      • Custom script: call UnitAddAbility( GetLastCreatedUnit(), 'Aloc' )
And these are his Alternate form Indexes for "call SetUnitAnimationByIndex()"
13 - 17 = stand
18 - 19 = attack
20 = walk
21 = death
22 = spell throw
23 = spell slam
24 = dissipate
25 = bash
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
What about spawning the unit, adding alternate, and THEN giving it locust with a trigger? Normally locust doesn’t show up in the ability list to add it with a trigger but you can do this:

  • Custom script: set udg_LOCUST = ‘Aloc’ //this is an ability type variable and can be set once on map init
  • Unit - Add LOCUST to (Last created unit)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
What about spawning the unit, adding alternate, and THEN giving it locust with a trigger? Normally locust doesn’t show up in the ability list to add it with a trigger but you can do this:

  • Custom script: set udg_LOCUST = ‘Aloc’ //this is an ability type variable and can be set once on map init
  • Unit - Add LOCUST to (Last created unit)

I tried that method too and found it had the same problem. Both methods works as long as the MK isn't told to play an animation with this action:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex(udg_Dummy, udg_TempInteger)
I just edited the original post, I think it was misleading. My current issue lies solely in trying to get it to play animations without reverting back.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
It's possible that the alternate animations are actually different numbers to use with ByIndex. Did you try something like this to see the full range of numbered animations?
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg("animation #: "+I2S(udg_TempInteger))
      • Custom script: call SetUnitAnimationByIndex(udg_Dummy, udg_TempInteger)
      • set TempInteger = TempInteger + 1
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
It's possible that the alternate animations are actually different numbers to use with ByIndex. Did you try something like this to see the full range of numbered animations?
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg("animation #: "+I2S(udg_TempInteger))
      • Custom script: call SetUnitAnimationByIndex(udg_Dummy, udg_TempInteger)
      • set TempInteger = TempInteger + 1
I'll try that out and get back to you.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
It's possible that the alternate animations are actually different numbers to use with ByIndex. Did you try something like this to see the full range of numbered animations?
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg("animation #: "+I2S(udg_TempInteger))
      • Custom script: call SetUnitAnimationByIndex(udg_Dummy, udg_TempInteger)
      • set TempInteger = TempInteger + 1
That did the trick. Thanks! Starting at Index 13 and above are the Mountain King's alternate animations.
 
Status
Not open for further replies.
Top