Raised This Month: $ Target: $400
 0% 

m_szAnimExtention usage ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
darktemplar
Member
Join Date: Sep 2009
Old 08-15-2012 , 20:39   m_szAnimExtention usage ?
Reply With Quote #1

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

Thanks
darktemplar is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2012 , 00:53   Re: m_szAnimExtention usage ?
Reply With Quote #2

First, what are you trying to do ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
darktemplar
Member
Join Date: Sep 2009
Old 08-16-2012 , 03:12   Re: m_szAnimExtention usage ?
Reply With Quote #3

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 **************
darktemplar is offline
csoldjb
Member
Join Date: Dec 2010
Old 08-18-2012 , 21:06   Re: m_szAnimExtention usage ?
Reply With Quote #4

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.
csoldjb is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 08-19-2012 , 06:36   Re: m_szAnimExtention usage ?
Reply With Quote #5

http://forums.alliedmods.net/showthread.php?t=163990
__________________

Vi Veri Veniversum Vivus Vici
Russian Half-Life and Adrenaline Gamer community
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-19-2012 , 06:44   Re: m_szAnimExtention usage ?
Reply With Quote #6

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.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-19-2012 at 06:44.
ConnorMcLeod is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-19-2012 , 19:48   Re: m_szAnimExtention usage ?
Reply With Quote #7

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.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-20-2012 , 00:58   Re: m_szAnimExtention usage ?
Reply With Quote #8

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2012 , 04:58   Re: m_szAnimExtention usage ?
Reply With Quote #9

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.
__________________

Last edited by Arkshine; 08-20-2012 at 04:58.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-20-2012 , 12:19   Re: m_szAnimExtention usage ?
Reply With Quote #10

Should be my fault then, gonna rename the offset
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 05:51.


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