AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D/L4D2]ThirdPersonShoulder_Detect(1.5.3 - 08/06/2020) (https://forums.alliedmods.net/showthread.php?t=298649)

Lux 06-19-2017 06:03

[L4D/L4D2]ThirdPersonShoulder_Detect(1.5.3 - 08/06/2020)
 
2 Attachment(s)
Simple Forwarding plugin so querying the client convar c_thirdpersonshoulder only happens once not multiple at once by otherplugins to lower client upstream, just by using a simple forward.

PHP Code:

/**
*    @param     iClient            Client Index.
*    @param     bIsThirdPerson    true = Is in thirdperson shoulder, false otherwise.
*/
forward void TP_OnThirdPersonChanged(int iClientbool bIsThirdPerson); 

Plugin Includes fixes when c_thirdpersonshoulder = true
but client is still first person.

Plugins that use this:
[L4D/L4D2]Lux's Model Changer
[L4D/L4D2] Shotgun Sound Fix
[L4D2]Survivor_Legs

GitHub

Lux 06-27-2017 22:00

What's updated Pointer
 
update to 1.2 please refer to Github on code changes
https://github.com/LuxLuma/-L4D-L4D2...a?diff=unified

Lux 07-18-2017 11:26

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.2.2 - 28/6/2017)
 
1.4
Rolled back to more simple backend

Alot of bug regarding map changing reporting invalid varables for non thirdperson should users i can't replicate it so until i can, i'm rolling back update.

please refer to Github on code changes
https://github.com/LuxLuma/-L4D-L4D2...f916ce7bfa0f84

ShineKia 04-27-2018 04:35

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
 
So I found a bug that sometimes when your teammate is incapped, you can see their drop down animation gets repeated more than several times. It has fixed the defib animation being two models though. Possible to fix right?

Lux 04-27-2018 11:08

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
 
Quote:

Originally Posted by ShineKia (Post 2589644)
So I found a bug that sometimes when your teammate is incapped, you can see their drop down animation gets repeated more than several times. It has fixed the defib animation being two models though. Possible to fix right?

All this plugin does is query a cvar and forwards it query,
also minor fixes to stop it being in your face, but does no checking at all with incapped stuff.

What plugin are you talking about?

ShineKia 05-27-2018 07:27

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
 
I have no idea, I'm just reporting the problem I have to see if you might have a solution. So with the survivor_leg plugin, we'd have the defib animation being weird seeing multiple models of yourself when you wake up. After installing this, that problem is fixed, but sometimes when your teammate incapped, the drop down animation will repeat multiple times

Lux 06-02-2018 07:59

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
 
dunno i don't mess with drop down anims on clients

axelnieves2012 01-30-2019 15:14

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
 
can you please make a "3rd person detect" (for L4D1) too, please?
Survivors can get into 3rd person when:
# start healing
# pounced by hunter
# tied by smoker
# stuned when a hunter pounces other survivor (in survival and vs mode).
# stuned by boomer
# stuned by witch
#stuned by close explosion

Dragokas 03-02-2019 16:26

Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
 
1 Attachment(s)
Quote:

Originally Posted by Lux (Post 2529779)
... so querying the client convar c_thirdpersonshoulder only happens once not multiple at once by otherplugins, just by using a simple forward.

That is not correct at all.
Otherplugins, using your plugin's forward, never query for that convar.
And vice versa, your plugin query for that convar multiple times (once each 0.25 sec.).

Also, I noticed several bugs when testing and when observing the source code.
1) I don't see a description of your forward meaning. However "TP_OnThirdPersonChanged" - I think that should mean - call forward only once as soon as person view mode is changed.
However, it is called infinite times for me (see screenshot) - L4d1. Test plugin:

Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>

public void TP_OnThirdPersonChanged(int iClient, bool bIsThirdPerson)
{
        PrintToChat(iClient, "3rd person is changed to: %b", bIsThirdPerson);
}

EDIT. Ok, I found description of forward: "Forwards the varable of c_thirdpersonshoulder client convar".
However, in that case, the name of the forward does not match the meaning. Why not make that forward do exactly how it is named, call the forward only once when person view mode is really changed instead of spamming.

2) You are creating forward call every time QueryClientConVarCallback of "c_thirdpersonshoulder" is raised. It's incorrect. Because if you set third person view, next exit the server, next enter the server again, "c_thirdpersonshoulder" will be initially == 1, but player is in 1st person mode! As soon as I use command "thirdpersonshoulder", "c_thirdpersonshoulder" is changed to "0", but real person view is not changed and at the same time according your logic new forward will be created when it shouldn't. I see you are using some fix, but it is intended for "bIsThirdPerson" value correction only.

Lux 03-02-2019 22:57

RE: Dragokas
 
Quote:

Originally Posted by axelnieves2012 (Post 2637330)
can you please make a "3rd person detect" (for L4D1) too, please?
Survivors can get into 3rd person when:
# start healing
# pounced by hunter
# tied by smoker
# stuned when a hunter pounces other survivor (in survival and vs mode).
# stuned by boomer
# stuned by witch
#stuned by close explosion

This is just for querying "c_thirdpersonshoulder" clientcvar.

Quote:

Originally Posted by Dragokas (Post 2641638)
However, in that case, the name of the forward does not match the meaning. Why not make that forward do exactly how it is named, call the forward only once when person view mode is really changed instead of spamming.

I changed this to match forward meaning,
Even tho english is my native language i'm very bad at it :D

Quote:

Originally Posted by Dragokas (Post 2641638)
You are creating forward call every time QueryClientConVarCallback of "c_thirdpersonshoulder" is raised. It's incorrect. Because if you set third person view, next exit the server, next enter the server again, "c_thirdpersonshoulder" will be initially == 1, but player is in 1st person mode! As soon as I use command "thirdpersonshoulder", "c_thirdpersonshoulder" is changed to "0", but real person view is not changed and at the same time according your logic new forward will be created when it shouldn't. I see you are using some fix, but it is intended for "bIsThirdPerson" value correction only.

Using "sm_map" will put you in firstperson, however using map_vote function built into l4d will leave you in firstperson this is apart of the fix.

I only try to guarantee that they are first person to avoid any mishap with people who don't use thirdperson shoulder, as I can't guarantee weather they are in firstperson or thirdpersonshoulder I can only try to make a best guess, people who actively use thirdpersonshoulder should can always toggle again this is due to valve not matching the cvar with the clientview correctly.

Thanks for your input i'v improved the plugin and optimized with reducing other plugins receiving forward calls.


All times are GMT -4. The time now is 16:12.

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