AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   m_szAnimExtention usage ? (https://forums.alliedmods.net/showthread.php?t=193024)

darktemplar 08-15-2012 20:39

m_szAnimExtention usage ?
 
Hi, :)

Can anyone help me to know how to use m_szAnimExtention ? I found it in CS-SDK, but I dont know how it work ? Please show me a code :D

Thanks :D

ConnorMcLeod 08-16-2012 00:53

Re: m_szAnimExtention usage ?
 
First, what are you trying to do ?

darktemplar 08-16-2012 03:12

Re: m_szAnimExtention usage ?
 
I want to fix the dummy sequence . Because I've blocked Ham_Item_deploy, so , engine cant relize what weapon I'm holding, and it causes this :

[IMG]http://img14.**************/img14/7049/dedust20001on.png[/IMG]

Uploaded with **************

csoldjb 08-18-2012 21:06

Re: m_szAnimExtention usage ?
 
I think set/get_pdate_string can change this,but set/get_pdate_string have some bugs, maybe you can't use these natives.You can try. (The offset is 492 (Linux+=5))
The best way is to use Orpheu to set animation.

KORD_12.7 08-19-2012 06:36

Re: m_szAnimExtention usage ?
 
http://forums.alliedmods.net/showthread.php?t=163990

ConnorMcLeod 08-19-2012 06:44

Re: m_szAnimExtention usage ?
 
This offset doesn't exist, 492 (int based) is for shield :

#define m_szShieldAnimExt 1968 // 492 * 4, linux diff 20 ( see offsets there : http://forums.alliedmods.net/showthr...01#post1712101 )

set_pdata_string(index, m_szShieldAnimExt, "ANIM_THERE", -1, 20)


But it won't help in your case, what you need is pev_sequence or pev_gaitsequence.

meTaLiCroSS 08-19-2012 19:48

Re: m_szAnimExtention usage ?
 
I think that he is talking about the offset that sets the current "weapon holding animation"

Code:
BOOL CHEGrenade::Deploy() {     m_flReleaseThrow = -1.0     m_flWeaponSpeed  = 250.0;     ClearBits( m_fWeaponState, WEAPONSTATE_SHIELD_DRAWN );     ClearBits( m_pPlayer->m_iUserPrefs, USERPREFS_SHIELD_DRAWN );     m_pPlayer->m_iUserPrefs = 0;     if ( m_pPlayer->HasShield() )         return DefaultDeploy( "models/shield/v_shield_hegrenade.mdl", "models/shield/p_shield_hegrenade.mdl", GRENADE_DRAW, "shieldgren", UseDecrement() );     else         return DefaultDeploy( "models/v_hegrenade.mdl", "models/p_hegrenade.mdl", HEGRENADE_DEPLOY, "grenade", UseDecrement() ); }

The "shieldgren" / "grenade" are set into that offset (at least on the HLSDK):

Code:
BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body ) // it is the same code in the CS binaries? {     if (!CanDeploy( ))         return FALSE;     m_pPlayer->TabulateAmmo();     m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel);     m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel);     strcpy( m_pPlayer->m_szAnimExtention, szAnimExt );     SendWeaponAnim( iAnim, skiplocal, body );     m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;     m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;     return TRUE; }

That one it's used on SetAnimation for checking also the fire animation

Code:
void CBasePlayer::SetAnimation( PLAYER_ANIM playerAnim ) {     int animDesired;     float speed;     char szAnim[64];     speed = pev->velocity.Length2D();     if (pev->flags & FL_FROZEN)     {         speed = 0;         playerAnim = PLAYER_IDLE;     }     switch (playerAnim)     {     case PLAYER_JUMP:         m_IdealActivity = ACT_HOP;         break;         case PLAYER_SUPERJUMP:         m_IdealActivity = ACT_LEAP;         break;         case PLAYER_DIE:         m_IdealActivity = ACT_DIESIMPLE;         m_IdealActivity = GetDeathActivity( );         break;     case PLAYER_ATTACK1:            switch( m_Activity )         {         case ACT_HOVER:         case ACT_SWIM:         case ACT_HOP:         case ACT_LEAP:         case ACT_DIESIMPLE:             m_IdealActivity = m_Activity;             break;         default:             m_IdealActivity = ACT_RANGE_ATTACK1;             break;         }         break;     case PLAYER_IDLE:     case PLAYER_WALK:         if ( !FBitSet( pev->flags, FL_ONGROUND ) && (m_Activity == ACT_HOP || m_Activity == ACT_LEAP) ) // Still jumping         {             m_IdealActivity = m_Activity;         }         else if ( pev->waterlevel > 1 )         {             if ( speed == 0 )                 m_IdealActivity = ACT_HOVER;             else                 m_IdealActivity = ACT_SWIM;         }         else         {             m_IdealActivity = ACT_WALK;         }         break;     }     switch (m_IdealActivity)     {     case ACT_HOVER:     case ACT_LEAP:     case ACT_SWIM:     case ACT_HOP:     case ACT_DIESIMPLE:     default:         if ( m_Activity == m_IdealActivity)             return;         m_Activity = m_IdealActivity;         animDesired = LookupActivity( m_Activity );         // Already using the desired animation?         if (pev->sequence == animDesired)             return;         pev->gaitsequence = 0;         pev->sequence       = animDesired;         pev->frame          = 0;         ResetSequenceInfo( );         return;     case ACT_RANGE_ATTACK1:         if ( FBitSet( pev->flags, FL_DUCKING ) )    // crouching             strcpy( szAnim, "crouch_shoot_" );         else             strcpy( szAnim, "ref_shoot_" );         strcat( szAnim, m_szAnimExtention );         animDesired = LookupSequence( szAnim );         if (animDesired == -1)             animDesired = 0;         if ( pev->sequence != animDesired || !m_fSequenceLoops )         {             pev->frame = 0;         }         if (!m_fSequenceLoops)         {             pev->effects |= EF_NOINTERP;         }         m_Activity = m_IdealActivity;         pev->sequence       = animDesired;         ResetSequenceInfo( );         break;     case ACT_WALK:         if (m_Activity != ACT_RANGE_ATTACK1 || m_fSequenceFinished)         {             if ( FBitSet( pev->flags, FL_DUCKING ) )    // crouching                 strcpy( szAnim, "crouch_aim_" );             else                 strcpy( szAnim, "ref_aim_" );             strcat( szAnim, m_szAnimExtention );             animDesired = LookupSequence( szAnim );             if (animDesired == -1)                 animDesired = 0;             m_Activity = ACT_WALK;         }         else         {             animDesired = pev->sequence;         }     }     if ( FBitSet( pev->flags, FL_DUCKING ) )     {         if ( speed == 0)         {             pev->gaitsequence   = LookupActivity( ACT_CROUCHIDLE );             // pev->gaitsequence    = LookupActivity( ACT_CROUCH );         }         else         {             pev->gaitsequence   = LookupActivity( ACT_CROUCH );         }     }     else if ( speed > 220 )     {         pev->gaitsequence   = LookupActivity( ACT_RUN );     }     else if (speed > 0)     {         pev->gaitsequence   = LookupActivity( ACT_WALK );     }     else     {         // pev->gaitsequence    = LookupActivity( ACT_WALK );         pev->gaitsequence   = LookupSequence( "deep_idle" );     }     // Already using the desired animation?     if (pev->sequence == animDesired)         return;     //ALERT( at_console, "Set animation to %d\n", animDesired );     // Reset to first frame of desired animation     pev->sequence       = animDesired;     pev->frame          = 0;     ResetSequenceInfo( ); }

It is CS' m_szShieldAnimExt offset the same as HL's m_szAnimExtention? If it's, would be something useful for making weapons modifications.

ConnorMcLeod 08-20-2012 00:58

Re: m_szAnimExtention usage ?
 
There is no such offset on cs1.6, though the shield one could be the one used instead, i have no time right now to check why Arkshine (i think HE named that offset) named it like that.

Arkshine 08-20-2012 04:58

Re: m_szAnimExtention usage ?
 
It's the reverse, there is no m_szShieldAnimExt offset but only m_szAnimExtention, like in HL. m_szAnimExtention is used in DefaultDeploy()/SetAnimation() but also in function related to knife/grenade/pistol (ShieldSecondaryFire, SetPlayerShieldAnim(), ResetPlayerShieldAnim, etc) since there is special animation in player model if you have a shield.

ConnorMcLeod 08-20-2012 12:19

Re: m_szAnimExtention usage ?
 
Should be my fault then, gonna rename the offset :)


All times are GMT -4. The time now is 05:51.

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