Raised This Month: $51 Target: $400
 12% 

Model Squences


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shine771
Senior Member
Join Date: Jun 2007
Old 01-14-2008 , 09:41   Model Squences
Reply With Quote #1

I searched this forum... nothing. Is it possible to change players model animation sequence? I mean like "idle", "dummy", "run", "walk" e.c, and even if they're moving, shooting, jumping e.c it won't change their model animation? If it is can you post a code snippet.

Thanks.

EDIT: Sh*t.. XD The topics name is "Model Squences"... sorry for mystake.. XD

Last edited by shine771; 01-14-2008 at 09:43.
shine771 is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 01-14-2008 , 14:03   Re: Model Squences
Reply With Quote #2

I'd like to help but have no idea how to do such a thing because these sequences are done client side according to entity flags. And if there was a way to do it, they would last only for 1 sequence though.

What are you actually trying to achieve? To switch between them or to modify them?
__________________
alien is offline
Send a message via ICQ to alien
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-14-2008 , 14:57   Re: Model Squences
Reply With Quote #3

I can't make a snippet, but from parachute plugin (in player prethink forward) :

PHP Code:
set_pev(idpev_sequence3)
set_pev(idpev_gaitsequence3)
set_pev(idpev_frame1.0)
set_pev(idpev_animtime100.0)
set_pev(idpev_framerate1.0
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
shine771
Senior Member
Join Date: Jun 2007
Old 01-14-2008 , 16:04   Re: Model Squences
Reply With Quote #4

uh...
1. I tried:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

#define PLUGIN "UnKnown."
#define VERSION "1.0"
#define AUTHOR "Sh!nE*"

new bool:anim

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /anim1","anim1")
}

public 
anim1(id)
{
    if(
anim == true)
        
anim=false
    
else
        
anim=true
        
    
return PLUGIN_HANDLED
}

public 
client_PreThink(id)
{
    if(
anim == true)
    {
    
set_pev(idpev_sequence0)
    
set_pev(idpev_gaitsequence0)
    
set_pev(idpev_frame1.0)
    
set_pev(idpev_animtime100.0)
    
set_pev(idpev_framerate24.0)
    
anim=true //<<<<
    
}
    return 
PLUGIN_CONTINUE

>>Didn't work... i think becuse just there is another PreThink like thing in CStrike.dll... and it updates the animation. So the 2. was:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

#define PLUGIN "UnKnown."
#define VERSION "1.0"
#define AUTHOR "Sh!nE*"

new bool:anim

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /anim1","anim1")
}

public 
anim1(id)
{
    if(
anim == true)
        
anim=false
    
else
        
anim=true
        
    
return PLUGIN_HANDLED
}

public 
client_PreThink(id)
{
    if(
anim == true)
    {
    
set_pev(idpev_sequence0)
    
set_pev(idpev_gaitsequence0)
    
set_pev(idpev_frame1.0)
    
set_pev(idpev_animtime100.0)
    
set_pev(idpev_framerate24.0)
    
//anim=true
    
}
    return 
PLUGIN_CONTINUE

The sequence was working, but it was kinda starting the animation over and over again... kinda like... hard to explain - bad english. Just something like LAG. Just restarting the animation over and over and over... once a ~0.1 second... just if there is possible to make that it Changes the Model animation sequence and and somehow BLOCK the dll to change it back when you move e.c. Please, tell me.

Thanks.
shine771 is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 01-14-2008 , 16:11   Re: Model Squences
Reply With Quote #5

Quote:
Originally Posted by shine771 View Post
The sequence was working, but it was kinda starting the animation over and over again... kinda like... hard to explain - bad english.
That's because it was setting the frame back to the one specified in prethink.

Here is the working method I know of...
PHP Code:
public plugin_init()
{
    
register_forward(FM_AddToFullPack"fwd_AddToFullPack"1);
}

public 
fwd_AddToFullPack(es_handleeidhosthostflagsplayerpSet)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    
// Set players sequence
    
set_es(es_handleES_Sequence8);
    
    return 
FMRES_HANDLED;

The only problem I can't figure out is when you duck or have a weapon besides the knife out the frame rate seems to go crazy.

Last edited by hlstriker; 01-14-2008 at 16:14.
hlstriker is offline
shine771
Senior Member
Join Date: Jun 2007
Old 01-14-2008 , 16:35   Re: Model Squences
Reply With Quote #6

ok.. problems. Like when i set run seq.:
Quote:
set_es(es_handle, ES_Sequence, 4);
set_es(es_handle, ES_GaitSequence, 4);
set_es(es_handle, ES_Frame, 1);
set_es(es_handle, ES_FrameRate, 60);
set_es(es_handle, ES_AnimTime, 100);
When im NOT moving - the sequence isn't playing. When i move forward - i'm running forward. When i run backwards - it's showing me that i am running backwards. But i need - that sequence is playing even if i am doing NOTHING, and when i am running backwards - i need that it still would show that i am just running. If it is possible - please post the code. I tried changing the framerate, animtime e.c. Of course that didn't work. Thank you all for help.
shine771 is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 01-14-2008 , 16:56   Re: Model Squences
Reply With Quote #7

If you use the exact code I posted above you will see it will ALWAYS be in the swimming animation (for Counter-Strike at least).

You shouldn't need to use the Frame, FrameRate, and AnimTime. If you set the frame it will force the model animation to be stuck on that frame. If you set the framerate it will speed up/slow down the animation. The AnimTime doesn't do anything that I know of.

Imagine the ES_Sequence controlling the upper body animations, and the ES_GaitSequence controlling the legs (or the actual movements of the player- ducking, jumping, dieing, etc).

Use the Half-Life Model Viewer to get the Sequence you want.

Here is the GaitSequence information (remember, controls the real movement):
GaitSequence = 1 = Idle
GaitSequence = 2 = Duck
GaitSequence = 3 = Walk
GaitSequence = 4 = Run
GaitSequence = 5 = Duck + Walk
GaitSequence = 6 = Jump

Last edited by hlstriker; 01-15-2008 at 16:15.
hlstriker is offline
shine771
Senior Member
Join Date: Jun 2007
Old 01-15-2008 , 08:04   Re: Model Squences
Reply With Quote #8

Ok i sat the Run sequence... but when i walk backwards... it shows that i am walking backwards... but i want it to show that i am walking forward.. +when im just standing... its not playing the animation
shine771 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 01:42.


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