This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[L4D/L4D2]ThirdPersonShoulder_Detect(1.5.3 - 08/06/2020)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Plugin ID:
5665
Plugin Version:
1.5.3
Plugin Category:
Server Management
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Forwards the varable of c_thirdpersonshoulder client convar
    Old 03-02-2019 , 16:26   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.4 - 18/7/2017)
    Reply With Quote #1

    Quote:
    Originally Posted by Lux View Post
    ... 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.
    Attached Images
    File Type: jpg notify.jpg (36.7 KB, 935 views)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 03-02-2019 at 16:35.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-02-2019 , 23:14   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5 - 03/03/2019)
    Reply With Quote #2

    Quote:
    Originally Posted by Dragokas
    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!
    Sorry, I was wrong. Sometimes server put me on 3rd person mode on first join (when c_thirdpersonshoulder == 1).

    Quote:
    Thanks for your input i'v improved the plugin and optimized with reducing other plugins receiving forward calls.
    Thanks. Anyway, I used your previous code. Very useful.

    Do you know, is there netprop I can query for, to check current person view mode? (without using "c_thirdpersonshoulder" ConVar)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 03-02-2019 , 23:21   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5 - 03/03/2019)
    Reply With Quote #3

    if your looking for thirdpersonshoulder in netprops then no there is not, that is clientsided.

    It is a combo of netprops e.g. stagger ect.

    you can use this bool from LMC
    https://github.com/LuxLuma/Luxs-Mode...t.sp#L106-L226
    PHP Code:
    static bool IsSurvivorThirdPerson(int iClient)
    {
        if(
    bThirdPerson[iClient])
            return 
    true;
        if(
    GetEntPropEnt(iClientProp_Send"m_hViewEntity") > 0)
            return 
    true;
        if(
    GetEntPropFloat(iClientProp_Send"m_TimeForceExternalView") > GetGameTime())
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_iObserverMode") == 1)
            return 
    true;
        if(
    GetEntPropEnt(iClientProp_Send"m_pummelAttacker") > 0)
            return 
    true;
        if(
    GetEntPropEnt(iClientProp_Send"m_carryAttacker") > 0)
            return 
    true;
        if(
    GetEntPropEnt(iClientProp_Send"m_pounceAttacker") > 0)
            return 
    true;
        if(
    GetEntPropEnt(iClientProp_Send"m_jockeyAttacker") > 0)
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_isHangingFromLedge") > 0)
            return 
    true;
        if(
    GetEntPropEnt(iClientProp_Send"m_reviveTarget") > 0)
            return 
    true;
        if(
    GetEntPropFloat(iClientProp_Send"m_staggerTimer"1) > -1.0)
            return 
    true;
        
        switch(
    GetEntProp(iClientProp_Send"m_iCurrentUseAction"))
        {
            case 
    1:
            {
                static 
    int iTarget;
                
    iTarget GetEntPropEnt(iClientProp_Send"m_useActionTarget");
                
                if(
    iTarget == GetEntPropEnt(iClientProp_Send"m_useActionOwner"))
                    return 
    true;
                else if(
    iTarget != iClient)
                    return 
    true;
            }
            case 
    45678910:
            return 
    true;
        }
        
        static 
    char sModel[31];
        
    GetEntPropString(iClientProp_Data"m_ModelName"sModelsizeof(sModel));
        
        switch(
    sModel[29])
        {
            case 
    'b'://nick
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    626625624623622621661662664665666667668670671672673674620680616:
                    return 
    true;
                }
            }
            case 
    'd'://rochelle
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    674678679630631632633634668677681680676675673672671670687629625616:
                    return 
    true;
                }
            }
            case 
    'c'://coach
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    656622623624625626663662661660659658657654653652651621620669615:
                    return 
    true;
                }
            }
            case 
    'h'://ellis
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    625675626627628629630631678677676575674673672671670669668667666665684621:
                    return 
    true;
                }
            }
            case 
    'v'://bill
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    528759763764529530531532533534753676675761758757756755754527772762522:
                    return 
    true;
                }
            }
            case 
    'n'://zoey
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    537819823824538539540541542543813828825822821820818817816815814536809572:
                    return 
    true;
                }
            }
            case 
    'e'://francis
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    532533534535536537769768767766765764763762761760759758757756531530775525:
                    return 
    true;
                }
            }
            case 
    'a'://louis
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    529530531532533534766765764763762761760759758757756755754753527772528522:
                    return 
    true;
                }
            }
            case 
    'w'://adawong
            
    {
                switch(
    GetEntProp(iClientProp_Send"m_nSequence"))
                {
                    case 
    674678679630631632633634668677681680676675673672671670687629625616:
                    return 
    true;
                }
            }
        }
        return 
    false;

    Just remove
    PHP Code:
    if(bThirdPerson[iClient])
    return 
    true
    That is for the thirdpersonshoulder array.

    If you looking for l4d1 i'm not really starting on porting LMC stuff to l4d1 due differences of the netprops.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 03-02-2019 at 23:37.
    Lux is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-03-2019 , 09:24   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5 - 03/03/2019)
    Reply With Quote #4

    Thanks,
    in addition, here are netprops from the basic l4d1 port of ThirdPerson_To_POV by Mr.GameOver:

    PHP Code:
    static bool:bShouldBePov1(iClient
    {
        if(
    GetEntPropEnt(iClientProp_Send"m_pounceAttacker") > 0)
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_isHangingFromTongue") > 0)
            return 
    true
        if(
    GetEntProp(iClientProp_Send"m_tongueOwner") > 0)
            return 
    true;        
        if(
    GetEntProp(iClientProp_Send"m_reachedTongueOwner") > 0)
            return 
    true
        if(
    GetEntProp(iClientProp_Send"m_isHangingFromLedge") > 0)
            return 
    true;    
        if(
    GetEntPropEnt(iClientProp_Send"m_reviveTarget") > 0)
            return 
    true
        if(
    GetEntProp(iClientProp_Send"m_healOwner") > 0)
            return 
    true;    
        if(
    GetEntProp(iClientProp_Send"m_reviveOwner") > 0)  
            return 
    true;    
        if(
    GetEntProp(iClientProp_Send"m_healTarget") > 0
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_isFallingFromLedge") > 0
            return 
    true;    
        if(
    GetEntProp(iClientProp_Send"m_grenadeLayerSequence") > 0
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_usingMinigun") > 0
            return 
    true;    
         return 
    false;        

    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 03-03-2019 , 09:36   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5 - 03/03/2019)
    Reply With Quote #5

    Quote:
    Originally Posted by Dragokas View Post
    Thanks,
    in addition, here are netprops from the basic l4d1 port of ThirdPerson_To_POV by Mr.GameOver:

    PHP Code:
    static bool:bShouldBePov1(iClient
    {
        if(
    GetEntPropEnt(iClientProp_Send"m_pounceAttacker") > 0)
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_isHangingFromTongue") > 0)
            return 
    true
        if(
    GetEntProp(iClientProp_Send"m_tongueOwner") > 0)
            return 
    true;        
        if(
    GetEntProp(iClientProp_Send"m_reachedTongueOwner") > 0)
            return 
    true
        if(
    GetEntProp(iClientProp_Send"m_isHangingFromLedge") > 0)
            return 
    true;    
        if(
    GetEntPropEnt(iClientProp_Send"m_reviveTarget") > 0)
            return 
    true
        if(
    GetEntProp(iClientProp_Send"m_healOwner") > 0)
            return 
    true;    
        if(
    GetEntProp(iClientProp_Send"m_reviveOwner") > 0)  
            return 
    true;    
        if(
    GetEntProp(iClientProp_Send"m_healTarget") > 0
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_isFallingFromLedge") > 0
            return 
    true;    
        if(
    GetEntProp(iClientProp_Send"m_grenadeLayerSequence") > 0
            return 
    true;
        if(
    GetEntProp(iClientProp_Send"m_usingMinigun") > 0
            return 
    true;    
         return 
    false;        

    Thanks ill book mark these for whenever i start porting more modules to l4d1
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 05-11-2019 , 07:19   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5.2 - 15/03/2019)
    Reply With Quote #6

    Can you add there, please, RegPluginLibrary() for identification, so other plugins can be hybrid: supports your forward + be a standalone in case this plugin is not installed?
    The reason is: not need to query same convar twice (in standalone plugin, when your plugin is pre-installed e.g. together with LMC).
    Of course, I could add mandatory requirement: to install your plugin, but you know:
    1. People could forget.
    2. People could don't like dependencies.
    3. It breaks the original structure of initial plugin. I mean, for forks.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-12-2019 , 05:43   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5.2 - 15/03/2019)
    Reply With Quote #7

    Quote:
    Originally Posted by Dragokas View Post
    Can you add there, please, RegPluginLibrary() for identification, so other plugins can be hybrid: supports your forward + be a standalone in case this plugin is not installed?
    The reason is: not need to query same convar twice (in standalone plugin, when your plugin is pre-installed e.g. together with LMC).
    Of course
    https://github.com/LuxLuma/-L4D-L4D2...houlder_Detect

    Libname "ThirdPersonShoulder_Detect"

    Quote:
    Originally Posted by Dragokas View Post
    2. People could don't like dependencies.
    hand holding will not help, they want it they should install everything required if not good luck.

    Quote:
    Originally Posted by Dragokas View Post
    3. It breaks the original structure of initial plugin. I mean, for forks.
    If the plugin has changed that much it needs a new thread, as let the old thread die.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 07-21-2019 , 22:03   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5.2 - 15/03/2019)
    Reply With Quote #8

    Hello, I need help.
    Somehow this plugin is spamming my console. But it doesn't seem to spam every client's console.
    It just spams host console.
    I get this message every 0.1 second:
    Code:
    Cvar query (cookie: 25, status: 0) - name: c_thirdpersonshoulder, value: false
    How do I get rid of these annoying messages? I cannot use my console to get any info because this doesn't let me read anything.
    axelnieves2012 is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 07-22-2019 , 01:19   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5.2 - 15/03/2019)
    Reply With Quote #9

    Quote:
    Originally Posted by axelnieves2012 View Post
    Hello, I need help.
    Somehow this plugin is spamming my console. But it doesn't seem to spam every client's console.
    It just spams host console.
    I get this message every 0.1 second:
    Code:
    Cvar query (cookie: 25, status: 0) - name: c_thirdpersonshoulder, value: false
    How do I get rid of these annoying messages? I cannot use my console to get any info because this doesn't let me read anything.
    I have nothing much to help you,

    Fishy! on SM discord pointed me to

    Quote:
    It's prob being called from a mm ext, the arguments matches CEmptyServerPlugin::OnQueryCvarValueFinished
    https://github.com/alliedmodders/met....cpp#L277-L283

    remove any meta mod plugin that does not come with source mod

    Unless there is some logging level you have toggled i'm not sure.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 07-22-2019 at 01:26.
    Lux is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 07-25-2019 , 03:54   Re: [L4D/L4D2]ThirdPersonShoulder_Detect(1.5.2 - 15/03/2019)
    Reply With Quote #10

    Quote:
    Originally Posted by Lux View Post
    I have nothing much to help you,

    Fishy! on SM discord pointed me to



    https://github.com/alliedmodders/met....cpp#L277-L283

    remove any meta mod plugin that does not come with source mod

    Unless there is some logging level you have toggled i'm not sure.
    Thanks, I will keep trying. It was useful. Non SM extension I've installed are Left4deadToolz (to let my server have more than 8 players) and Left4Downtown.
    I'm not sure if I enabled any logging. Thanks.
    axelnieves2012 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 23:30.


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