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

[L4D2] HUD Display Manager (April 9th, 2024)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Plugin ID:
8677
Plugin Version:
1.0.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    If there are more than 4 survivors on the team, only show the nearest 3 in the HUD.
    Old 04-07-2024 , 17:59   [L4D2] HUD Display Manager (April 9th, 2024)
    Reply With Quote #1

    HUD Display Manager
    Left 4 Dead 2 has a hard limit of how many players can display in the HUD at the same time, the real hard limit is 4 (Not counting you) but this is rather buggy. It will always show the first actors of the campaign.

    This plugin manipulates the data sent to the clients, displaying its nearest 3 teammates instead. You can see it in action in this video.



    ConVars
    • sm_l4d2_hud_display_enabled
      • Enables the plugin.
        • Default: 1
    • sm_l4d2_hud_display_query_time
      • Determines the time between position checks. Less is smoother, but may lead to increased overhead. 3.0 is my personal recommended value but you can adjust it as needed.
        • Default: 3

    Changelog
    • 1.0.1
      • Better checks to avoid possible errors when unhooking players and map ending
      • Included an alternative compile option to give support to SendProxy includes with an optional per_player parameter
    • 1.0.0
      • Initial Release

    Dependencies
    • SendProxy Manager with per_player support.
      • This plugin was mostly made and tested extensively with TheByKotik's version in mind. Other versions may theoretically work but intended behavior is not guaranteed!
      • I provide Binaries for Left 4 Dead 2 Linux here.

    Supported Games
    • Left 4 Dead 2

    Theoretically can work on Left 4 Dead 1 but it is untested.

    Download and Source Code:

    Download from AlliedModders:

    You need to download the .sp file and compile the plugin yourself as the AlliedModders' forum compiler lacks the necessary includes to provide you with a working binary.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_hud_display_manager.sp - 33 views - 9.6 KB)
    __________________

    Last edited by gabuch2; 04-09-2024 at 20:30.
    gabuch2 is offline
    liquidplasma
    Junior Member
    Join Date: May 2023
    Old 04-09-2024 , 17:48   Re: [L4D2] HUD Display Manager (April 7th, 2024)
    Reply With Quote #2

    After a bit of testing I've noticed my own HP bar disappears and there's like the other 4 survivors instead.

    Rarely I get Invalid timer handle error in logs
    Spoiler


    There was one instance where I got Invalid Edict Index
    Spoiler


    I'm on windows too if that could be the cause of these errors
    liquidplasma is offline
    gabuch2
    AlliedModders Donor
    Join Date: Mar 2011
    Location: Chile
    Old 04-09-2024 , 20:25   Re: [L4D2] HUD Display Manager (April 7th, 2024)
    Reply With Quote #3

    Quote:
    Originally Posted by liquidplasma View Post
    After a bit of testing I've noticed my own HP bar disappears and there's like the other 4 survivors instead.

    Rarely I get Invalid timer handle error in logs
    Spoiler


    There was one instance where I got Invalid Edict Index
    Spoiler


    I'm on windows too if that could be the cause of these errors
    The behavior you're describing is strange, and I think I know the issue. This plugin requires a version of SendProxy version with per_player support (I forgot to state it in the post). Like I said in the OP, I can provide Linux binaries but for Windows there might be a problem since I don't use that platform. SendProxy versions with optional per_player parameter (arthurisdead's) may not be compatible without making a small change, if you're sure you're using one of those make sure to update the plugin and recompile with the PER_PLAYER_OPTIONAL flag set to true.

    1.0.1
    • Better checks to avoid possible errors when unhooking players and map ending
    • Included an alternative compile option to give support to SendProxy includes with an optional per_player parameter
    __________________
    gabuch2 is offline
    R4to0.exe
    Member
    Join Date: Sep 2008
    Location: Sao Paulo,Brazil
    Old 04-09-2024 , 21:01   Re: [L4D2] HUD Display Manager (April 7th, 2024)
    Reply With Quote #4

    Quote:
    Originally Posted by gabuch2 View Post
    Like I said in the OP, I can provide Linux binaries but for Windows there might be a problem since I don't use that platform.
    Hello. I am the one who offered compiled Windows binaries for @liquidplasma. They were compiled straight from your repository fork, worked without any extra changes. I did also created signatures for Windows and provided to him.

    I've compiled with the following commands:
    Code:
    python ../configure.py --sm-path="../../../sourcemod" --enable-optimize --sdks="l4d2" --mms-path="../../../mmsource" --symbol-files
    ambuild
    You can probably add these to Github CI to automatically build Windows binaries. I know you can't test on Windows but I think the community can take care of that right?

    Here's the signatures in case you want to update in your repo, these worked pretty well for @liquidplasma. I used Ghidra with makesig.py script:

    Code:
        "left4dead2"
        {
            "Signatures"
            {
                /**
                 * Signature for CGameClient::ShouldSendMessages
                 * 
                 * How to find:
                 * - search for "%s overflowed reliable buffer\n"
                 * - there will be two matches, it's usually the first one
                 * - find a reference to the function at the top
                 * - pick the only "CALL FUN_XXXX" that is in the list
                 * 
                 */
                "CGameClient::ShouldSendMessages"
                {
                    "library"    "engine"
                    "windows"    "\x55\x8B\xEC\x51\x56\x8B\xF1\x80\xBE\x2A\x2A\x2A\x2A\x00\x74\x2A\x83\x3D\x2A\x2A\x2A\x2A\x00"
                }
    
                /**
                 * Signature for CGameServer::SendClientMessages
                 * 
                 * How to find:
                 *  - search for "SendClientMessages"
                 *  - there's 2 matches, it's usually the first one
                 *  - to make sure you're in the right method there will be a string called "sv_main.cpp" above "(%s)%s","Networking","SendClientMessages"
                 * 
                 */
                
                "CGameServer::SendClientMessages"
                {
                    "library"    "engine"
                    "windows"    "\x55\x8B\xEC\x81\xEC\xB4\x00\x00\x00\xA1\x2A\x2A\x2A\x2A\x53"
                }
                
                /**
                 * Signature for SV_ComputeClientPacks
                 * 
                 * How to find:
                 *  - Simply search for "SV_ComputeClientPack", or "sv_packedentities.cpp"
                 * 
                 */
                "SV_ComputeClientPacks"
                {
                    "library"    "engine"
                    "windows"    "\x55\x8B\xEC\x83\xEC\x44\xA1\x2A\x2A\x2A\x2A\x53"
                }
            }
        }
    Attached Files
    File Type: txt sendproxy.txt (3.5 KB, 17 views)

    Last edited by R4to0.exe; 04-09-2024 at 21:20.
    R4to0.exe is offline
    Send a message via MSN to R4to0.exe Send a message via Skype™ to R4to0.exe
    Reply


    Thread Tools
    Display Modes

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


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