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