PDA

View Full Version : Client - Side animation


vjawa
25th Apr 2004, 01:11 PM
I've been using the runtime for a couple of months now. I've had issues with it but most of them have been solved over time.

My major problem now is client-side animation for bots. In particular the movement animations.

I've used the MyFirstExample ExamplePawn.uc method to base the code structure for my bots. I have a simulated PlayWaiting() and PlayMoving() functions which get called on the client for the bots. However, when it comes to moving, the Walk/Run animations don't loop like they should. The animation gets stuck on the first frame of the required animation and then slides to the next position

Here's some of the code


simulated function PlayMoving()
{
MovementAnims[0] = AnimationNames[12]; //Walk animation
MovementAnims[1] = AnimationNames[12];
MovementAnims[2] = AnimationNames[12];
MovementAnims[3] = AnimationNames[12];
TurnLeftAnim = AnimationNames[12];
TurnRightAnim = AnimationNames[12];
}

//Callback by the engine when the player is not moving
simulated function PlayWaiting()
{
log("Play Waiting Called");
ChooseIdleAnimation();
LoopAnim(AnimationNames[CurCivAnim], 1.0, 0.3);

}

I'm not using SetAnimAction because I don't need to (or do i?). Shouldn't defining these functions be enough? The internal pawn functions call the playwaiting and playmoving but the moving animations don't play or loop.

Has anyone had this problem before. Is there any other example that I could see to help me solve this problem?

Thanks.

vjawa
6th May 2004, 01:07 AM
I found the solution to my problem. I want to put it down here for anyone to see. There is a small funny thing about runtime. The MovementAnims need to be set to valid animations in the default properties. Just setting them in the PlayMoving the first time doens't work. Something to do about caching the animation name the first time and if there is nothing - it doesn't update itself