Animation is stopping whenever I move a unit...

Status
Not open for further replies.
Level 8
Joined
Aug 2, 2006
Messages
346
...and I don't want it to!

I have a trigger that runs every .03 seconds (or something like that) and I'm moving a unit based on x and y velocities... blah blah blah, the point is, I'm moving a unit every .03 seconds but this resets the units animation so instead of a nice smooth walk animation, they look like they're spazzing out.

Is there some way to keep it from stopping the animation? There's nothing really important about the unit itself, so if there's some kind of trick to doing this that I'm missing and something major needs to change about the unit, I'm all for it.

EDIT: agh... nevermind. Seems like calling 'Play Animation' every .03 seconds'll do that...
 
Level 4
Joined
Jul 31, 2008
Messages
109
I think there is no way because when you give a command to unit it starts to do it with this move animation. I have bad english so example. You wanna spell animation. But when you give a command to stand it will change animation for currently move (here stand animation). Another talk it will change animation by trigger. It will work as how you will command unit to do someone else. And it will do it before you brake currently move with another animation etc. It looks like some type of layer im my imagination
 
Level 8
Joined
Aug 2, 2006
Messages
346
Use

Custom script: call SetUnitX(unit, real)
Custom script: call SetUnitY(unit, real)

It won't give that stop order, and animations play smoothly. You can check my Holy Dragging Spell for an example how to do it.

Oh nice! I didn't realize those functions existed. I was using SetUnitPosition. Thanks man!

{EDIT}
Hmm... there's still something wrong. The animation is being stopped, but there is no trigger doing it. What non-trigger source could cause this?
 
Last edited by a moderator:
Level 8
Joined
Aug 2, 2006
Messages
346
Nah there's no spells stopping it. It plays the animation for about a split second, then it reverts to the stand animation. I don't have any triggers telling it to set its animation to stand, only to walk.

EDIT: Ok am I missing something simple here? I place some random units around and made a simple trigger so when I hit ESC their walk animation would play. It play for a split second then reverts back to their stand animation (basically, they just sort of kick their legs up then stop). I can tell them to walk, and it plays just fine.

EDIT2: I made a test map where I just play the animation I type in. Stand, Death, Attack, Stand Ready... well all of them except walk play just fine. Walk does just what it does in my map: Starts to play. I suspect it only moves to the first keyframe and I'm only really seeing it move at all because of the blend time. How can I make it look the walking animation?

EDIT3: Could pausing the unit do the trick? Would I still be able to move the unit? (I mean rapidly set it's location via triggers, not move orders)
 
Last edited:
Level 8
Joined
Aug 2, 2006
Messages
346
Come on, I've seen other maps play the walk animation properly, what am I doing wrong?

EDIT: Aww you guys are mean... :p

{EDIT}
Ok it seems that by using "SetUnitAnimationByIndex" works when "SetUnitAnimation" doesn't... weird...
 
Last edited by a moderator:
Level 11
Joined
Jun 21, 2007
Messages
505
If you want to move a unit manually via triggers, then the unit itself must have movement speed set to 0. Or else it will be counted as an object that can move, therefore it will receive stop order after being moved instantly. But if a unit has 0 movement speed, then it doesn't have the Move ability, and it can't move on its own, only manually via triggers. You can't set movement speed to 0 via triggers, nor versa (set movement speed to, like, 270 for a unit which has 0 movement speed), it can be done only in objects editor.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
a samplemap for you lazycoder:

http://www.hiveworkshop.com/forums/pastebin.php?id=lg7yhw

It's a keyboard movement system I made + a little camera that locks onto the footmen.

It also shows the footmen's walk animation while moving him by triggers ;)

and yes kkots was right about this ;) setting movement speed to 0 does work ;)

I only made the triggers work for player 1 yet but you can change it to whatever you like...
 
Status
Not open for further replies.
Top