I'm trying to get player animation working with some non-CS models.
Specifically, I'd like to get animations working with the models used
in HL2DM. I used model viewer to load up the combine models from HL2DM
and some of the resistance models from HL2DM.

Not only are their animations totally different from CS, they're
different from each other. The combine models have different
animations than the resistance models. I've been working on converting
the animation names in sdk_playeranimstate.cpp to call the animations
in combine_solder.mdl, which I think is the one used in HL2DM.

I've run into some problems with this though.

First off, there's doesn't seem to be any walking or running shooting
animations. There are animations like ShootSGs, ShootSGc, ShootSMG1s,
ShootSMG1c, etc but there's no walk_upper_mp5 or run_upper_mp5 like in
the CS models. There doesn't seem to be any animation to be running
and shooting at the same time.

Second, the animations seem to only play the first frame and then
stop. For example, I changed CalcFireLayerSequence to look like this:


int CSDKPlayerAnimState::CalcFireLayerSequence(PlayerAnimEvent_t event)
{
        // Figure out the weapon suffix.
        CWeaponSDKBase *pWeapon = m_pHelpers->SDKAnim_GetActiveWeapon();
        if ( !pWeapon )
                return 0;

        const char *pSuffix = GetWeaponSuffix();
        if ( !pSuffix )
                return 0;

        // Don't rely on their weapon here because the player has usually
switched to their
        // pistol or rifle by the time the PLAYERANIMEVENT_THROW_GRENADE
message gets to the client.
        if ( event == PLAYERANIMEVENT_THROW_GRENADE )
        {
                pSuffix = "Gren";
        }

        switch ( GetCurrentMainSequenceActivity() )
        {
                case ACT_PLAYER_RUN_FIRE:
                case ACT_RUN:
                        //return CalcSequenceIndex( "%s%s", 
DEFAULT_FIRE_RUN_NAME, pSuffix );
                        return CalcSequenceIndex( "ShootSMG1s" );       
//FIXME: totally wrong

                case ACT_PLAYER_WALK_FIRE:
                case ACT_WALK:
                        //return CalcSequenceIndex( "%s%s", 
DEFAULT_FIRE_WALK_NAME, pSuffix );
                        return CalcSequenceIndex( "ShootSMG1s" );       
//FIXME: totally wrong

                case ACT_PLAYER_CROUCH_FIRE:
                case ACT_CROUCHIDLE:
                        return CalcSequenceIndex( "%s%s", 
DEFAULT_FIRE_CROUCH_NAME, pSuffix );

                case ACT_PLAYER_CROUCH_WALK_FIRE:
                case ACT_RUN_CROUCH:
                        return CalcSequenceIndex( "%s%s", 
DEFAULT_FIRE_CROUCH_WALK_NAME, pSuffix );

                default:
                case ACT_PLAYER_IDLE_FIRE:
                        //return CalcSequenceIndex( "%s%s", 
DEFAULT_FIRE_IDLE_NAME, pSuffix );
                        return CalcSequenceIndex( "ShootSMG1s" );       
//FIXME: pick the right weapon
        }
}

I've set my player model to be combine_soldier. When I spawn in third
person and watch my player model, if I run along start shooting it
looks like it plays only the first frame or two and then immediately
goes back to idle/jittering. If I'm running, it looks even worse since
each time I fire it looks like it restarts the ShootSMG1animation but
there's no blending between them so it looks all jittery. Has anyone
had any luck getting this to work?

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to