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

Playing Anim

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
call SetUnitAnimationByIndex(whichUnit, whichIndex)

Example: call SetUnitAnimationByIndex(udg_Caster, 2)
This will play the animation index of '2' by the Caster.
You should move your unit using SetUnitX/Y + SetUnitAnimationByIndex to move your unit and perform animation at the same time
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Both of those function is native to JASS, it is not a custom movement system.

The difference between SetUnitAnimation and ByIndex is that ByIndex more accurate, I believe ?
It does not have vague string like SetUnitAnimation like "stand" or "stand 2", etc.
Also, taking argument from Integer compared to String, I think Integer more faster, just like in Hashtable, we use Integer compared to String mostly.

As said, by combining SetUnitAnimationByIndex + SetUnitX/Y, you can move your unit while doing the animation while attacking, because SetUnitX/Y does not interrupt unit's current order.
 
Both of those function is native to JASS, it is not a custom movement system.
I know, but I can't (or rather don't want to) use SetUnitX/Y to emulate walking.
If you use "PlayUnitAnimation", the unit makes it once.

If you use "SetUnitAnimationByIndex", the unit makes it until it plays a new animation.
I see, thanks.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
So you want other native function that allows the unit to attack while moving, but not using SetUnitX/Y ?
I don't think there is a native function for that... unless a custom one, I think.

What are your complications on SetUnitX/Y ?
I've tried before, simulating a "walk" by using that function, it works without awkward movement.
Just need to check whether the unit isMove or not, if doesn't move, turn off the SetUnitAnimationByIndex to "stand" or something.

Even PurgeAndFire uses SetUnitX/Y (if I'm not mistaken) for his GUI MoveSpeed that bypasses max unit's 522 Movespeed.
 
Status
Not open for further replies.
Top