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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 06-10-2019 , 06:46   [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #1


Imgur post

Although I couldn't quite manage it correctly, I made the commentary_dummy parented to Coach look back while incapacitated, thus giving us the impossible sight of a character looking back while incapped in L4D2.
(Also for some reason, the angles for the dummy always stay at 0 even though it's supposed to set them to the client's existing angles already.)

What I planned to do was to make the player's model invisible, parent a dummy model and set that model's pose parameters instead.
(A bug I encountered is that the pose parameters don't change while active for the dummy.)
The new version with atleast some functionality is attached below, the old version is in the original description.



Original Description
I attempted to fix it myself, but turns out that setting the pose parameter on a think hook does not appear to work.

For those that don't know, Valve managed to screw it up in-game, so incapacitated survivors face the front when the actual person's looking at the opposite direction.
The pose parameter I found that manipulated the bugged direction is body_yaw.

Here's some test code that prints out information and is supposed to set the pose parameter in a debuggy way:
Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (L4D2_Incap_Yaw_Fix.sp - 351 views - 10.2 KB)
__________________
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; 01-22-2020 at 01:33.
Shadowysn is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-03-2019 , 22:21   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #2

Should I... bump? Apologies if I'm breaking the rules, but I changed this thread from a simple asking-whether-it-can-be-fixed to there-was-an-attempt-but-I-failed.

Last edited by Shadowysn; 12-03-2019 at 22:23.
Shadowysn is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 12-03-2019 , 23:43   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #3

I never bothered looking at the source code so there's a mistake that I overlooked at. The think and event hooks are missing the public in their callbacks.

Last edited by cravenge; 12-03-2019 at 23:47.
cravenge is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-03-2019 , 23:50   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #4

Quote:
Originally Posted by cravenge View Post
I never bothered looking at the source code so there's a mistake that I overlooked at. The think and event hooks are missing the public in their callbacks.
Huh? Is that needed?
I tested out my code with the void function and the PrintToChatAll debug functions worked and printed out the variables in chat.

Oh yeah, I just now figured out the check through a bit of trial-and-error, but it's not exact. It'll only get the old position before incapacitation, so if the player model's angles change then the check will not be synced.

Last edited by Shadowysn; 12-03-2019 at 23:52.
Shadowysn is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 12-03-2019 , 23:58   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #5

Quote:
Originally Posted by Shadowysn View Post
Huh? Is that needed?
I tested out my code with the void function and the PrintToChatAll debug functions worked and printed out the variables in chat.
Tbh, I don't really remember if it's optional or not since I haven't been coding for so long and just came back recently.
Quote:
Originally Posted by Shadowysn View Post
Oh yeah, I just now figured out the check through a bit of trial-and-error, but it's not exact. It'll only get the old position before incapacitation, so if the player model's angles change then the check will not be synced.
Either move to a 0.1 second repeating timer or hooking the other think functions to get that preciseness with minimal erroneous results.
cravenge is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-04-2019 , 00:10   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #6

Quote:
Originally Posted by cravenge View Post
Tbh, I don't really remember if it's optional or not since I haven't been coding for so long and just came back recently.

Either move to a 0.1 second repeating timer or hooking the other think functions to get that preciseness with minimal erroneous results.
Getting the angles just gets the player's angles, not the player model's.

Upon incapacitation, the survivor's visible model is set to stay in one angle while the actual angles of the player are still free to be changed by the player.
I couldn't find a netprop or anything that dictates that angle so I had to make do.

But I could potentially see it working if I added the right checks for crawling, landing on the ground, etc.

Last edited by Shadowysn; 12-04-2019 at 00:17.
Shadowysn is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-04-2019 , 07:13   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #7

Animation stuff is usually done in PostThink, so a PostThinkPost hook should work.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-04-2019 , 07:25   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #8

Quote:
Originally Posted by Lux View Post
Animation stuff is usually done in PostThink, so a PostThinkPost hook should work.
Nope, still doesn't seem to be working.

Last edited by Shadowysn; 12-04-2019 at 09:00.
Shadowysn is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 12-06-2019 , 10:50   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #9

Like I said, move to a 0.1 second repeating timer instead of hooking the incapacitation event since it happens only once unless you want to fire it manually every time players stop crawling and stays in place but that would be messy.
cravenge is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 01-22-2020 , 01:25   Re: [L4D2] Fixing body_yaw when incapped? / Set pose parameters?
Reply With Quote #10

Quote:
Originally Posted by cravenge View Post
Like I said, move to a 0.1 second repeating timer instead of hooking the incapacitation event since it happens only once unless you want to fire it manually every time players stop crawling and stays in place but that would be messy.
Well, there's one more in-game thing that could change the incap model's angles:
- Landing on the ground after being in the air. (Only seems to sometimes happen, and only just flips the angles.)

I gave up with the real player model and decided to use a parented commentary_dummy instead.
__________________
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; 01-22-2020 at 01:25.
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 10:35.


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