AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Very Close to Calling Sequences... (https://forums.alliedmods.net/showthread.php?t=45757)

Wilson [29th ID] 10-10-2006 17:45

Very Close to Calling Sequences...
 
I notice no thread in here actually seems to have a confirmed answer on making a player animate in game (to other players). A lot of threads have people claiming this is the way but none of it seems to have been tested before claimed. In other words, it doesn't look like anyone has actually gotten a player model to animate.

We've all probably seen the player start to animate but then go back to whatever it was doing half a second later. This is because the client is constantly updating and it sets the status back to "not animating" right away.

Here's what I found out. If you jump, for example, or fire, and then trigger the custom animation, it will play for the remainder of how long your "jump or fire" animation was going to play.

In other words, the game is setting a player's status to "Animating" or "Not-Animating." If the player's status is "Animating," you can set the sequence, frame, framerate, gaitsequence, to whatever you want and it will animate that. But if it's set to "Not-Animating," it will not play (you will see it try and revert to normal).

So the question is, how do we set a client's status to "Animating"?

Silencer123 10-10-2006 17:58

Re: Very Close to Calling Sequences...
 
Well it is like with HUD Messages the Animation is being "overwritten" by another.
If you could set the frame of the Animation you could use client_prethink or FM_PlayerPrethink
and every time set the next frame. Will probably appear laggy because there would be a
very fast change between sequences.

XxAvalanchexX 10-10-2006 19:03

Re: Very Close to Calling Sequences...
 
This allowed to me to play whatever animation I wanted, without it changing around when walking or performing other actions (as would usually happen by using the prethink method), at least to myself (using third person cam). I wasn't able to test to see if it appears to other players correctly.

Code:
public plugin_init() {     register_forward(FM_AddToFullPack,"fw_addtofullpack",1); } public fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet) {     if(!is_user_alive(ent))         return FMRES_IGNORED;     set_es(es_handle,ES_Sequence,100);     set_es(es_handle,ES_GaitSequence,100);     return FMRES_HANDLED; }

I may have also had to set the sequence and gaitsequence values in prethink as well, I can't remember. Let me know if this works for you.

Wilson [29th ID] 10-11-2006 01:04

Re: Very Close to Calling Sequences...
 
@Silencer - I tried that it still only works if the player is set to "Is Animated" - try it and see

@Avalanche - Wow I've never seen those lines of code, but I'll sure as hell try it. Thanks chap.

EDIT: Yes it works. Avalanche, congratulations you're the only person I've ever seen figure it out. You cracked it, good job.


All times are GMT -4. The time now is 04:48.

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