• 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.

[Trigger] Unit Move Instantly + Play Animation?

Status
Not open for further replies.
It will play animations with out custom scripts unless you want to play Walk animation.
Using set unitx and set unity will make unit able attack and casp spells while charging.
You can also use set unit animation by index, that custom script is really useful, because you can play any animation while moving even Walk animation.
To get animation index open model with model viewer and count animation 1, 2, 3 until you get to the animation you want to play. Using magos to find animation index wont works
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Here's an example Action for that problem of yours.... just set Blademaster into a variable and also the region if you want.

  • Actions
    • Unit - Move Blademaster 0003 <gen> instantly to (Center of Region 000 <gen>)
    • Animation - Play Blademaster 0003 <gen>'s attack animation
Is this what you mean or is their a deeper meaning to that question?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Move Unit (Instantly)
After the execution of this function, the unit is order to Stop, resulting in stopping of Playing Unit Animation.

SetUnitX/Y
This on the other hand, doesn't order the unit to Stop after execution, therefore you can combine this with Playing Unit Animation.

SetUnitAnimationByIndex
This function should be used to play the specific animation provided from the unit. Let's say the index of your desired animation is 4, therefore it would be like this;
  • Custom script: call SetUnitAnimationByIndex(udg_Caster, 4)
Animation Index starts from 0.
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
Move Unit (Instantly)
After the execution of this function, the unit is order to Stop, resulting in stopping of Playing Unit Animation.

SetUnitX/Y
This on the other hand, doesn't order the unit to Stop after execution, therefore you can combine this with Playing Unit Animation.

SetUnitAnimationByIndex
This function should be used to play the specific animation provided from the unit. Let's say the index of your desired animation is 4, therefore it would be like this;
  • Custom script: call SetUnitAnimationByIndex(udg_Caster, 4)
Animation Index starts from 0.
hmm yeah the X/Y is the one I'm looking for, where do I find that action? is it jass?
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
Action >>> General >>>> Custom Script then just copy the Script Code. But I think the animation index will be random as defskull said. =)
hey man thnx a lot for the help!
but I got a minor problem, it only plays animation when I order the unit to move at a point, how to make it play the animation without having to order it to move?

(+2) to all that helped, thnx!

please check the map: (nvm the leaks it's just a test)
 

Attachments

  • Test.w3x
    16.5 KB · Views: 50
Level 30
Joined
Nov 29, 2012
Messages
6,637
hey man thnx a lot for the help!
but I got a minor problem, it only plays animation when I order the unit to move at a point, how to make it play the animation without having to order it to move?

(+2) to all that helped, thnx!

please check the map: (nvm the leaks it's just a test)

So you want to play the animation without moving or anything? Just do Play the animation with this trigger:

  • Animation - Play (Last Created unit)'s stand animation
It will play an animation but will stop when ordered to move or Move Instantly is used.
 
Status
Not open for further replies.
Top