OpenArena Message Boards

OpenArena Contributions => Development => Topic started by: fromhell on May 05, 2012, 07:09:06 am



Title: torso running animation code help
Post by: fromhell on May 05, 2012, 07:09:06 am
Hi

i've made a player model with a new TORSO_RUN animation placed after all the missionpack gestures. Problem is I can't seem to override TORSO_STAND no matter how hard I try.

I want to play it synced with legs and only when I run forward.

I attached my broken attepmt at implementing it

i also attached a sarge animation.cfg with a few more animation tokens to debug with (no actual animations are made for him)


Title: Re: torso running animation code help
Post by: andrewj on May 05, 2012, 09:16:46 pm
I took a look but couldn't see why, after switching to the gauntlet, the TORSO_RUN2 animation was not being used.


Title: Re: torso running animation code help
Post by: fromhell on May 05, 2012, 09:29:39 pm
eventually i'll add more torso animations if ths is successful. want to do torso_jump and torso_land also for both jumping animations too

i'm on a mission to 'de-stiff' the animation :)

cgame already has complatibility measures for player models that lack the new animations I want to do so there shouldn't be problems


Title: Re: torso running animation code help
Post by: revanic on May 06, 2012, 11:31:03 am
I suggest checking the legs animation to see if its in a running animation instead of using xyspeed. Also I must warn you that after firing, the animation will become desynched. Elite Force singleplayer suffered from it, but you rarely saw yourself moving like that. You'll have to find a way to keep the frames synched which will be much easier with a BOTH_RUN animation rather than a seperate LEGS_RUN and TORSO_RUN.


Title: Re: torso running animation code help
Post by: fromhell on May 12, 2012, 05:01:00 am
I just realized i am supposed to compile both cgame and game when I make a change......



so now here's my torso animation function so far

Code:
static void PM_TorsoAnimation( void ) {
if ( pm->ps->weaponstate == WEAPON_READY ) {




// Falling Downward
if ( pm->ps->velocity[2] < -10 ){
if ( pm->ps->weapon == WP_GAUNTLET ) PM_RunningTorsoAnim( TORSO_FALL2 );
else PM_RunningTorsoAnim( TORSO_FALL );
}
// Falling Upward
else if ( pm->ps->velocity[2] > 10 ){
if ( pm->ps->weapon == WP_GAUNTLET ) PM_RunningTorsoAnim( TORSO_JUMP2 );
else PM_RunningTorsoAnim( TORSO_JUMP );
}

// Running Forward
//if (  pm->ps->legsAnim && LEGS_RUN ) {
else if (  pm->cmd.forwardmove || pm->cmd.rightmove  ) {
if ( pm->ps->weapon == WP_GAUNTLET ) PM_RunningTorsoAnim( TORSO_RUN2 );
else PM_RunningTorsoAnim( TORSO_RUN );
}
else

{
if ( pm->ps->weapon == WP_GAUNTLET ) {
PM_ContinueTorsoAnim( TORSO_STAND2 );
} else {
PM_ContinueTorsoAnim( TORSO_STAND );
}
}
return;
}

}
You see where i'm going with this right? :P


Title: Re: torso running animation code help
Post by: andrewj on May 12, 2012, 09:16:29 am
it boggles my mind :)

riding up or down lifts should be interesting....


Title: Re: torso running animation code help
Post by: fromhell on May 12, 2012, 07:43:34 pm
yeah i haven't made an onground check for that yet. it's already strange when you go up and down slopes

'm just eager and excited to put in more animation. HOPEFULLY the compatibility is still retained with untouched cgames, maybe i'll do a function check to stay safe (i.e. if cgame returns a value for "extendedanimation" then call the new animations if not then just stick to the usual torso_stand)

I already have all my new animations fall back to torso_stand if the token doesn't exist for it in animation.cfg.