Raised This Month: $32 Target: $400
 8% 

Problem with Gait Sequence


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-02-2014 , 09:50   Problem with Gait Sequence
Reply With Quote #1

Hi, I have problem with gait sequence when the player activity is 28 (ACT_ATTACK) but if the player activity is 3 (ACT_IDLE) the gait sequence works fine. I've tried to replace the player activity with idle activity but it blocks the sequence.

The detail video is: http://youtu.be/jIDXilZxRss

Code:

PHP Code:
HamRegister(Ham_Weapon_PrimaryAttack"weapon_knife""OnCBase_KnifeAttack");
OrpheuRegisterHook(OrpheuGetFunction("SetAnimation""CBasePlayer"), "Orpheu_SetAnimation"OrpheuHookPost); 
PHP Code:
public Ham_Weapon_PrimaryAttack(iEnt)
{
    
get_pdata_cbase(iEnt414);
    
gSeq[iIndex] = 124;
}

public 
OrpheuHookReturn:Orpheu_SetAnimation(iIndex)
{
    if (!
is_user_alive(iIndex)) return OrpheuIgnored;
    
    new 
iWpn get_user_weapon(iIndex);
    
    if (
gPlay[iIndex])
    {
        
Set_PlayerSequence(iIndexgSeq[iIndex]);
        return 
OrpheuSupercede;
    }
    return 
OrpheuIgnored;
}

Set_PlayerSequence(iIndexiSeq)
{
    new 
iGait Get_GaitSequence(iIndex);
    
    
set_pev(iIndexpev_sequenceiSeq);
    
set_pev(iIndexpev_gaitsequenceiGait);
    
set_pev(iIndexpev_frame1.0);
    
set_pev(iIndexpev_framerate1.0);
    
gPlay[iIndex] = 0;
}

Get_GaitSequence(iIndex)
{
    new 
Float:flVelocity[3];
    
pev(iIndexpev_velocityflVelocity);
    
    new 
iFlags pev(iIndexpev_flags);
    new 
Float:flSpeed vector_length(flVelocity);
    new 
iWaterLevel pev(iIndexpev_waterlevel);
    new 
iMoveType pev(iIndexpev_movetype);
    
    if(
iWaterLevel 1)
    {
        if (
flSpeed <= 0.1) return 9;
        else return 
8;
    }
    else if (
iMoveType == MOVETYPE_FLY)
    {
        if (
iFlags FL_DUCKING) return 2;
        else return 
1;
    }
    else if (
iFlags FL_DUCKING)
    {
        if (
flSpeed <= 0.1) return 2;
        else if (!(
iFlags FL_ONGROUND)) return 6;
        else return 
5;
    }
    else if (!(
iFlags FL_ONGROUND)) return 6;
    else if (
0.0 flSpeed 100.0) return 3;
    else if (
flSpeed 100.0) return 4;
    
    return 
1;

__________________
What are you looking for here?

Last edited by DavidJr; 06-02-2014 at 09:51.
DavidJr is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-21-2014 , 23:59   Re: Problem with Gait Sequence
Reply With Quote #2

Bump, need some answers please.
__________________
What are you looking for here?
DavidJr is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-22-2014 , 00:34   Re: Problem with Gait Sequence
Reply With Quote #3

Your code very hard.

by KORD_12.7

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>


public plugin_precache()
{
   
register_clcmd("say test""test");
   
   
precache_model("models/player/zombie_stingfinger/zombie_stingfinger.mdl");
}

public 
test(iPlayer)
{
   
cs_set_user_model(iPlayer"zombie_stingfinger");
   
set_pdata_int(iPlayer491engfunc(EngFunc_ModelIndex"models/player/zombie_stingfinger/zombie_stingfinger.mdl"), 5);
   
   
Player_SetAnimation(iPlayer"skill1_idle1");
}


stock Player_SetAnimation(const iPlayer, const szAnim[])
{
   
#define ACT_RANGE_ATTACK1   28
   
   // Linux extra offsets
   #define extra_offset_player   5
   #define extra_offset_animating   4
   
   // CBaseAnimating
   #define m_flFrameRate      36
   #define m_flGroundSpeed      37
   #define m_flLastEventCheck   38
   #define m_fSequenceFinished   39
   #define m_fSequenceLoops   40
   
   // CBaseMonster
   #define m_Activity      73
   #define m_IdealActivity      74
   
   // CBasePlayer
   #define m_flLastAttackTime   220
   
   
new iAnimDesiredFloatflFrameRateFloatflGroundSpeedboolbLoops;
      
   if ((
iAnimDesired lookup_sequence(iPlayerszAnimflFrameRatebLoopsflGroundSpeed)) == -1)
   {
      
iAnimDesired 0;
   }
   
   new 
FloatflGametime get_gametime();

   
set_pev(iPlayerpev_frame0.0);
   
set_pev(iPlayerpev_framerate1.0);
   
set_pev(iPlayerpev_animtimeflGametime );
   
set_pev(iPlayerpev_sequenceiAnimDesired);
   
   
set_pdata_int(iPlayerm_fSequenceLoopsbLoopsextra_offset_animating);
   
set_pdata_int(iPlayerm_fSequenceFinished0extra_offset_animating);
   
   
set_pdata_float(iPlayerm_flFrameRateflFrameRateextra_offset_animating);
   
set_pdata_float(iPlayerm_flGroundSpeedflGroundSpeedextra_offset_animating);
   
set_pdata_float(iPlayerm_flLastEventCheckflGametime extra_offset_animating);
   
   
set_pdata_int(iPlayerm_ActivityACT_RANGE_ATTACK1extra_offset_player);
   
set_pdata_int(iPlayerm_IdealActivityACT_RANGE_ATTACK1extra_offset_player);   
   
set_pdata_float(iPlayerm_flLastAttackTimeflGametime extra_offset_player);

And you can use for weapon animation offset m_szAnimExtention
__________________

Last edited by Bos93; 06-22-2014 at 00:38.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-22-2014 , 02:20   Re: Problem with Gait Sequence
Reply With Quote #4

Thank you Bos, but it is only for default animation. I have more than 110 animations in character, to play the default animation is fine, but the custom one will be likely in the video above. Any solution?
__________________
What are you looking for here?
DavidJr is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-22-2014 , 06:01   Re: Problem with Gait Sequence
Reply With Quote #5

Quote:
but it is only for default animation
Player_SetAnimation(iPlayer, "name of animation" )
__________________

Last edited by Bos93; 06-22-2014 at 06:02.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-22-2014 , 23:40   Re: Problem with Gait Sequence
Reply With Quote #6

I try to get seq number 119 with name "_CSF_deploy_kukri_"

PHP Code:
Set_PlayerSequence(iIndex"_CSF_deploy_kukri_"); 
The animdesired returns 0. Does it affect with the name of sequence in the model? Here I provided the character model.

https://www.dropbox.com/s/fa6a8xvdf0f3zdi/gign.rar
__________________
What are you looking for here?

Last edited by DavidJr; 06-22-2014 at 23:42.
DavidJr is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 07-11-2014 , 22:54   Re: Problem with Gait Sequence
Reply With Quote #7

bump
__________________
What are you looking for here?
DavidJr is offline
Reply


Thread Tools
Display Modes

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:04.


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