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

[L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6897
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Overrides the Hunter and Tank to allow targeting incapacitated and vomitted players.
    Unapprover:
    Reason for Unapproving:
    Unapproved by request of author
    Old 01-13-2020 , 06:42   [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #1

    THIS PLUGIN IS OBSOLETE. USE THIS INSTEAD: [L4D & L4D2] Target Override



    Related Plugins:

    About:
    • Restores L4D1 game behaviour so the Hunter and Tank can attack incapacitated and vomited players.
    • This overrides the ChooseVictim function, by setting the nearest survivor as target.
    • Can also prevent specific Special Infected from targeting incapacitated survivors.
    • Does not account for line of sight which would need constant inefficient trace rays.
    • Trace rays could be fired every half a second or so. Only request if really needed.


    Thanks:
    • Sev - For the idea and request.
    • BlackSabbarh - Also for the request.
    • Lux - For fixing God Frames detour which is similar to this, and would not be possible without.


    Cvars:

    Saved to l4d2_target_patch.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_target_patch_allow "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_target_patch_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d2_target_patch_modes_off ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_target_patch_modes_tog "0"

    // Which Special Infected should override victims. 1=Hunters. 2=Tanks. 3=Both.
    l4d2_target_patch_special "3"

    // 0=Off. Block these Special Infected from targeting incapped players: 1=Smoker, 2=Boomer, 4=Hunter, 8=Spitter, 16=Jockey, 32=Charger, 64=Tank, 127=All. Add numbers together.
    l4d2_target_patch_targets "0"

    // Target Patch plugin version.
    l4d2_target_patch_version 


    Changes:
    Code:
    1.3 (14-Jan-2020)
        - Added cvar "l4d2_target_patch_wait" to delay between switching targets unless current target is invalid.
        - Now using "GetClientsInRange" to select potentially visible clients. Thanks to "Peace-Maker" for recommending.
    
    1.2 (13-Jan-2020)
        - Added cvar "l4d2_target_patch_targets" to control which Special Infected cannot target incapped survivors.
        - If used, this will change those specified Special Infected to target the nearest non-incapped survivor.
    
    1.1 (13-Jan-2020)
        - Fixed mistake causing error with "m_isHangingFromLedge". Thanks to "Astrostar" for reporting.
    
    1.0 (13-Jan-2020)
        - Initial release.


    Requirements:

    Installation:
    DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires DHooks!
    1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder.
    2. Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.


    Updating from 1.1 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    __________________

    Last edited by Silvers; 03-23-2020 at 10:28.
    Silvers is offline
    Astrostar
    Junior Member
    Join Date: Nov 2019
    Old 01-13-2020 , 08:53   Re: [L4D2] Target Patch - Hunter and Tank (1.0) [13-Jan-2020]
    Reply With Quote #2

    Nice! but the plugin failed to compile first of all, but after I compiled it with .sp file and tried it and... well... got this error...
    L 01/13/2020 - 12:23:00: [SM] Call stack trace:
    L 01/13/2020 - 12:23:00: [SM] [0] GetEntProp
    L 01/13/2020 - 12:23:00: [SM] [1] Line 250, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d2_ target_patch.sp::ChooseVictim
    L 01/13/2020 - 12:23:01: [SM] Exception reported: Property "m_isHangingFromLedge" not found (entity 0/worldspawn)
    L 01/13/2020 - 12:23:01: [SM] Blaming: l4d2_target_patch.smx
    Astrostar is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Location: cl
    Old 01-13-2020 , 09:27   Re: [L4D2] Target Patch - Hunter and Tank (1.0) [13-Jan-2020]
    Reply With Quote #3

    nice job, but I have a doubt, with this gamedata could the opposite be done ?, prevent tank from attacking incapped players.

    if I'm not mistaken I think you should change line 250 for this:
    Spoiler
    xZk is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-13-2020 , 09:51   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #4

    Quote:
    Originally Posted by Astrostar View Post
    but the plugin failed to compile first of all
    Because it requires DHooks.

    Quote:
    Originally Posted by Astrostar View Post
    got this error...
    Oops thanks fixed.

    Quote:
    Originally Posted by xZk View Post
    with this gamedata could the opposite be done ?, prevent tank from attacking incapped players.
    For L4D2? The tank already does not target incapped unless they are blocking it's path. Could prevent any type of infected targeting incapped, but this will make the code more complicated and shit. Really not something I want to do.
    __________________

    Last edited by Silvers; 01-13-2020 at 10:02.
    Silvers is offline
    Astrostar
    Junior Member
    Join Date: Nov 2019
    Old 01-13-2020 , 10:09   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #5

    That's better... it works now thank you Silvers! ^^
    I do have dhooks... But it says the same compile error.... ah well nice plugin anyway thanks for fixing it

    Last edited by Astrostar; 01-13-2020 at 10:14.
    Astrostar is offline
    hoanganh81097
    Senior Member
    Join Date: Apr 2016
    Old 01-13-2020 , 10:45   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #6

    can you add % chance attack incapacitated and vomited players.

    Last edited by hoanganh81097; 01-13-2020 at 10:45.
    hoanganh81097 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-13-2020 , 11:06   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #7

    no
    __________________
    Silvers is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Location: cl
    Old 01-13-2020 , 11:39   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #8

    Quote:
    Originally Posted by Silvers View Post
    For L4D2? The tank already does not target incapped unless they are blocking it's path. Could prevent any type of infected targeting incapped, but this will make the code more complicated and shit. Really not something I want to do.
    ok i understand, the idea of this is to prevent the tank from attacking the incapped player when other player tries to revive. I tried to do that using CommandABot(vscript), but although it changes its target the tank always seems to be forced to attack the player incapped :/

    Last edited by xZk; 01-13-2020 at 11:41.
    xZk is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-13-2020 , 12:31   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #9

    THIS PLUGIN IS OBSOLETE. USE THIS INSTEAD: [L4D & L4D2] Target Override



    I'm placing this here for now because it's untested. Please let me know if it's working or any problems.

    Code:
    1.4 (14-Jan-2020)
        - Fixed not actually using the GetClientsInRange array. Thanks to "Peace-Maker" for reporting.
    
    1.3 (14-Jan-2020)
        - Added cvar "l4d2_target_patch_wait" to delay between switching targets unless current target is invalid.
        - Now using "GetClientsInRange" to select potentially visible clients. Thanks to "Peace-Maker" for recommending.
    
    1.2 (13-Jan-2020)
        - Added cvar "l4d2_target_patch_targets" to control which Special Infected cannot target incapped survivors.
        - If used, this will change those specific Special Infected to target the nearest non-incapped survivor.
    PHP Code:
    l4d2_target_patch_special "3" // Which Special Infected should target incapacitated victims. 1=Hunters. 2=Tanks. 3=Both.
    l4d2_target_patch_targets "0" // 0=Off. Block these Special Infected from targeting incapped players: 1=Smoker, 2=Boomer, 4=Hunter, 8=Spitter, 16=Jockey, 32=Charger, 64=Tank, 127=All. Add numbers together.
    l4d2_target_patch_wait "1.5" // Delay in seconds between switching targets unless the current target is invalid. 
    __________________

    Last edited by Silvers; 03-23-2020 at 10:29.
    Silvers is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 01-13-2020 , 16:14   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
    Reply With Quote #10

    Good work!

    Another item from L4D1 brought over.

    Last edited by Sev; 01-13-2020 at 16:14.
    Sev is offline
    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 19:06.


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