Hi, I am playing with m_szAnimExtention, changing its values to my requirements, and It is working perfect, but I have one dude about the use of it. For example I change the value of m_szAnimExtention to "bow", so the function will search for "ref_aim_bow"/"crouch_aim_bow"/"ref_shoot..." inside the model's sequence list, and then it will work, or it doesn't work that way?
and other dude:
The Engine looks inside the new model for the model's total frame value of each sequence, or it just take it from one variable, so it is saved. I'm asking this because I have some problems when I use a new sequence in place of "mp5" sequences, because this new sequence have a different amount of frames, and the sequence takes an acceleration.
PHP Code:
void GetSequenceInfo( void *pmodel, entvars_t *pev, float *pflFrameRate, float *pflGroundSpeed )
{
studiohdr_t *pstudiohdr;
pstudiohdr = (studiohdr_t *)pmodel;
if (! pstudiohdr)
return;
mstudioseqdesc_t *pseqdesc;
if (pev->sequence >= pstudiohdr->numseq)
{
*pflFrameRate = 0.0;
*pflGroundSpeed = 0.0;
return;
}
pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + (int)pev->sequence;
if (pseqdesc->numframes > 1)
{
*pflFrameRate = 256 * pseqdesc->fps / (pseqdesc->numframes - 1);
*pflGroundSpeed = sqrt( pseqdesc->linearmovement[0]*pseqdesc->linearmovement[0]+ pseqdesc->linearmovement[1]*pseqdesc->linearmovement[1]+ pseqdesc->linearmovement[2]*pseqdesc->linearmovement[2] );
*pflGroundSpeed = *pflGroundSpeed * pseqdesc->fps / (pseqdesc->numframes - 1);
}
else
{
*pflFrameRate = 256.0;
*pflGroundSpeed = 0.0;
}
}
I saw this in the SDK, and this gets the value of FrameRate per sequence, and I think it could be changed.
Grettings.
PHP Code:
int CBaseAnimating :: LookupSequence ( const char *label )
{
void *pmodel = GET_MODEL_PTR( ENT(pev) );
return ::LookupSequence( pmodel, label );
}
PHP Code:
//=========================================================
//=========================================================
void CBaseAnimating :: ResetSequenceInfo ( )
{
void *pmodel = GET_MODEL_PTR( ENT(pev) );
GetSequenceInfo( pmodel, pev, &m_flFrameRate, &m_flGroundSpeed );
m_fSequenceLoops = ((GetSequenceFlags() & STUDIO_LOOPING) != 0);
pev->animtime = gpGlobals->time;
pev->framerate = 1.0;
m_fSequenceFinished = FALSE;
m_flLastEventCheck = gpGlobals->time;
}
Edit: I saw this macro on LookUpSequence function:
PHP Code:
#define GET_MODEL_PTR (*g_engfuncs.pfnGetModelPtr)
And now the problem is, how to access this engFunc, so it could return me a value that I can set calling LookUpSequence's function with Orpheu.
__________________