Walk animations with SetUnitX/Y

saw792

Is known to say things. That is all.
Reaction score
280
I'm trying to get a unit to play its walk animation while I am sliding it with SetUnitX and SetUnitY. As I've heard, you cannot get the walk animation to play when the unit is not moving due to some irritating hard coding that automatically orders the stand animation. Any solutions to this?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,497
call SetUnitAnimationByIndex(<unit>), index)

Where index is some number, starting at 0...
Unfortunately, there's not really any system to the numbering of animations, so... you basically need to trial and error until you get the correct one.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I don't know where you heard that from. I've gotten it to work just fine for me.

The only problem I had with playing animations while sliding was getting a unit to play an attack animation (which I figured out).

I used this:

JASS:


EDIT: Got beat to it. :p
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Yes that works, thanks. The only problem is, I need it to work for multiple unit models. Obviously the walk animation is not going to have the same index for every model, so that provides another problem...

EDIT: Found that info here: http://www.thehelper.net/forums/showpost.php?p=859748&postcount=4

You could do an integer array and unit-type array, in which you compare each unit type's walk animation number, and set the integer to that number. That way you can loop through it instead of doing a whole bunch of manual if-then checks.

Not much else you can do here. :eek:
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,497
Given SetUnitX/Y does not interrupt the current animation, it's probably simpler to order the unit to move, then slide it.
A list with every unit on the map... doesn't sound like that great a plan :p
 

chobibo

Level 1 Crypt Lord
Reaction score
48
You could do an integer array and unit-type array, in which you compare each unit type's walk animation number, and set the integer to that number. That way you can loop through it instead of doing a whole bunch of manual if-then checks.

Not much else you can do here. :eek:
Like I said, a lookup table is what you need here.

EDIT:
Given SetUnitX/Y does not interrupt the current animation, it's probably simpler to order the unit to move, then slide it.
A list with every unit on the map... doesn't sound like that great a plan
That's a better idea lol.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top