Raised This Month: $ Target: $400
 0% 

SetAnimation dude.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fearAR
Veteran Member
Join Date: Oct 2010
Old 01-20-2013 , 22:25   SetAnimation dude.
Reply With Quote #1

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 GetSequenceInfovoid *pmodelentvars_t *pevfloat *pflFrameRatefloat *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 sqrtpseqdesc->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_PTRENT(pev) );

    return ::
LookupSequencepmodellabel );

PHP Code:
//=========================================================
//=========================================================
void CBaseAnimating :: ResetSequenceInfo ( )
{
    
void *pmodel GET_MODEL_PTRENT(pev) );

    
GetSequenceInfopmodelpev, &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.
__________________
~~~~ NPC AI ~~~~

[ Pathfinding - OK ]
[ Citizen AI - OK ]
[ Handle Weapons - --- ]

Last edited by fearAR; 01-20-2013 at 23:33.
fearAR is offline
Send a message via MSN to fearAR
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode