• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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