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

[L4D2] Fixing body_yaw when incapped? / Set pose parameters?


Post New Thread Reply   
 
Thread Tools Display Modes
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 01-25-2020 , 00:10   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #21

Quote:
Originally Posted by cravenge View Post
I just saw the source code of the plugin included in this post. I have to admit that it's a bit messy but you don't need the "player_incapacitated" event. All you have to do is apply the PostThinkPost hook on clients in OnClientPutInServer and do the cloning stuff there.
And keep having the hooks running at all times?
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4
Shadowysn is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-25-2020 , 10:37   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #22

Quote:
Originally Posted by Shadowysn View Post
And keep having the hooks running at all times?
Why not? It's more efficient that way rather than unhooking when the player isn't incapacitated anymore and hooking once more when they are again every time. All the hook needs to have are valid and incapacitated checks so the plugin wouldn't do anything to invalid and non incapacitated players.

Last edited by cravenge; 01-25-2020 at 10:43.
cravenge is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 07-15-2020 , 00:42   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #23

Just posting, the game seems to process the client as if it can look around 360° while incapped either the CTerrorPlayer entity was changed to nolonger support showing this, probs why the l4d2 character turning is fucked or it is being changed later on.

PHP Code:
long double __cdecl CTerrorPlayerAnimState::GetLookRange(CTerrorPlayerAnimState *this)
{
    
int v1// eax
    
long double result// fst7

    
v1 CBaseEntity::GetTeamNumber(this->Client);
    
result 45.0;
    if ( 
IsASurvivorTeam(v1v1) )
    {
        
result 90.0;
        if ( (
this->Client->vptr->CCSPlayer.IsIncapacitated)(this->Client) )
            
result 360.0;
    }
    return 
result;

__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 07-15-2020 at 00:45.
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 07-15-2020 , 05:44   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #24

Quote:
Originally Posted by Lux View Post
Just posting, the game seems to process the client as if it can look around 360° while incapped either the CTerrorPlayer entity was changed to nolonger support showing this, probs why the l4d2 character turning is fucked or it is being changed later on.

PHP Code:
long double __cdecl CTerrorPlayerAnimState::GetLookRange(CTerrorPlayerAnimState *this)
{
    
int v1// eax
    
long double result// fst7

    
v1 CBaseEntity::GetTeamNumber(this->Client);
    
result 45.0;
    if ( 
IsASurvivorTeam(v1v1) )
    {
        
result 90.0;
        if ( (
this->Client->vptr->CCSPlayer.IsIncapacitated)(this->Client) )
            
result 360.0;
    }
    return 
result;

Alright, seems like that function is on the server-side of things, but since I don't have the pro version of IDA or any pseudocode for the binaries, I'm unable to dig further into this.

For now, I'm wondering about CCSPlayer::IsIncapacitated and CTerrorPlayer::IsIncapacitated.
Could CCSPlayer::IsIncapacitated seem to be unable to return the actual incapacitation state?
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 07-15-2020 at 05:47.
Shadowysn is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 07-15-2020 , 08:54   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #25

Tbh i never really checked that function, ill have a look see whats what later, also ghidra is free and has decompiler

EDIT: the check is fine, thats just the name of the member for the struct, offset 505(linux) is CTerrorPlayer::IsIncapacitated since it's using the CTerrorPlayer object.

You can always patch out the check to see for you self.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 07-15-2020 at 15:43.
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 08-18-2020 , 07:29   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #26

Well, I've given up on trying to make this fix.

It'd most likely require memory patching, or a really janky and non-intuitive alternative.
Or, at worst, is unable to be fixed due to it being potentially client-side.

And all that effort, for a rather meaningless-in-gameplay thing.

To be honest, I don't know about memory-patching, and I can't seem to find guides on them.
Along with me wanting to stay away from Sourcemod, and focusing on my simple animation projects.

Woe betide the person that tries to understand the mess that is obfuscated code.



can one of you sourcemod wizards miraculously fix this???

Last edited by Shadowysn; 08-18-2020 at 07:37.
Shadowysn 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 19:04.


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