Raised This Month: $252 Target: $400
 63% 

[L4D & L4D2] Incapped Weapons Patch (1.10) [10-May-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7026
Plugin Version:
1.10
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    Patches the game to allow using Weapons while Incapped, instead of changing weapons scripts.
    Old 04-05-2020 , 21:43   [L4D & L4D2] Incapped Weapons Patch (1.10) [10-May-2020]
    Reply With Quote #1

    Related Plugins:

    About:
    • Memory patch method to use weapons while incapped, instead of changing weapons scripts.
    • Press the keys 1, 2, 3, 4, 5 to switch Weapons. Mouse scroll does not work.
    • Grenades and Melee weapons can be used while incapped. Bug reported: Survivors appear to stand up to throw! Future update may optionally use Left4DHooks to fix.


    Weapon Fire Rate:
    • Recommended: WeaponHandling_API by Lux. Set wh_use_incap_cycle_cvar cvar to "0". This changes all weapon fire rates to their normal speed.
    • Alternatively set the games cvar survivor_incapacitated_cycle_time to "0.1" but this will modify it for all weapons and not return them to their correct speed.


    Thanks:
    • xZk - For the original plugin and ideas.
    • Lux - For scripting advice and melee patch method.
    • MasterMind420 - For scripting advice.


    Cvars:

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

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

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

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

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

    // L4D2 only: 0=Don't give pistol (allows Melee weapons to be used). 1=Give pistol (game default).
    l4d_incapped_weapons_pistol "0"

    // Empty string to allow all. Prevent these weapon IDs from being used while incapped. See below for details.
    // L4D2: default blocks all meds/upgrade ammo. To block grenades add "13,14,25"
    l4d_incapped_weapons_restrict "12,15,23,24,30,31"

    // L4D1: default blocks medkits/pills. To block grenades add "9,10" e.g: "8,12,9,10"
    l4d_incapped_weapons_restrict "8,12"

    // Incapped Weapons plugin version.
    l4d_incapped_weapons_version 

    Weapon Restriction Cvar:

    The cvar l4d_incapped_weapons_restrict uses Weapon IDs to restrict their usage. String must be comma separated.

    Complete list:

    Spoiler



    Changes:
    Code:
    1.10 (10-May-2020)
        - Added better error log message when gamedata file is missing.
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    
    1.9 (12-Apr-2020)
        - Now keeps the active weapon selected unless it's restricted.
        - Fixed not being able to switch to melee weapons.
        - Fixed pistols possibly disappearing sometimes.
        - Fixed potential of duped pistols when dropped after incap.
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    
    1.8 (09-Apr-2020)
        - Fixed again not always restricting weapons correctly on incap. Thanks to "MasterMind420" for reporting.
    
    1.7 (08-Apr-2020)
        - Fixed not equipping melee weapons when allowed on incap.
    
    1.6 (08-Apr-2020)
        - Fixed breaking pistols, due to the last update.
    
    1.5 (08-Apr-2020)
        - Fixed ammo being wiped when incapped, due to 1.3 update. Thanks to "Dragokas" for reporting.
        - Fixed not always restricting weapons correctly on incap. Thanks to "MasterMind420" for reporting.
    
    1.4 (07-Apr-2020)
        - Fixed throwing a pistol when dual wielding. Thanks to "MasterMind420" for reporting.
    
    1.3 (07-Apr-2020)
        - Fixed not equipping a valid weapon when the last equipped weapon was restricted.
        - Removed the ability to block pistols.
        - Thanks to "MasterMind420" for reporting.
    
    1.2 (07-Apr-2020)
        - Fixed L4D1 Linux crashing. Only the plugin updated. Thanks to "Dragokas" for testing.
    
    1.1 (07-Apr-2020)
        - Fixed hooking the L4D2 pistol cvar in L4D1. Thanks to "Alliance" for reporting.
    
    1.0 (06-Apr-2020)
        - Initial release.

    Installation:
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.
    Attached Files
    File Type: txt l4d_incapped_weapons.txt (3.0 KB, 551 views)
    File Type: sp Get Plugin or Get Source (l4d_incapped_weapons.sp - 470 views - 20.0 KB)
    __________________

    Last edited by Silvers; 05-10-2020 at 06:48.
    Silvers is offline
    SkiPlix
    Member
    Join Date: Dec 2016
    Location: Argentina
    Old 04-06-2020 , 00:52   Re: [L4D & L4D2] Incapped Weapons Patch (1.0) [06-Apr-2020]
    Reply With Quote #2

    Finally
    SkiPlix is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Old 04-06-2020 , 01:58   Re: [L4D & L4D2] Incapped Weapons Patch (1.0) [06-Apr-2020]
    Reply With Quote #3

    Nice, also while incapped, friendly fire seems to be deactivated, is it possible to add a toggle for this?
    __________________
    Marttt is offline
    rekcah
    Member
    Join Date: Jun 2019
    Old 04-06-2020 , 05:25   Re: [L4D & L4D2] Incapped Weapons Patch (1.0) [06-Apr-2020]
    Reply With Quote #4

    thankyou, works way better then the workshop addon I was using for incapped weapons, however I think the single shot shotguns may be bugged, I only tested briefly but it seemed like I couldn't freely swap back and forth between melee and shotgun.
    rekcah is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 04-06-2020 , 19:34   Re: [L4D & L4D2] Incapped Weapons Patch (1.0) [06-Apr-2020]
    Reply With Quote #5

    Code:
    1.1 (06-Apr-2020)
        - Fixed hooking the L4D2 pistol cvar in L4D1. Thanks to "Alliance" for reporting.

    Quote:
    Originally Posted by rekcah View Post
    thankyou, works way better then the workshop addon I was using for incapped weapons, however I think the single shot shotguns may be bugged, I only tested briefly but it seemed like I couldn't freely swap back and forth between melee and shotgun.
    Linux? I tested on Windows and could switch between all shotguns and melee etc. Can't see Linux being any different. Did you change the restriction cvar and block shotguns maybe?
    __________________
    Silvers is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 04-06-2020 , 22:06   Re: [L4D & L4D2] Incapped Weapons Patch (1.2) [07-Apr-2020]
    Reply With Quote #6

    Very useful. Thank you !!!
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
    [My plugins] [My tools] [GitHub] [Articles]
    Dragokas is offline
    bullet28
    Junior Member
    Join Date: Apr 2012
    Location: Ukraine
    Old 04-06-2020 , 23:24   Re: [L4D & L4D2] Incapped Weapons Patch (1.2) [07-Apr-2020]
    Reply With Quote #7

    Great plugin, thank you! Have you tried to make weapon fire cycletime as normal? I wondering if changing nextAttack prop will be enough.. but if you haven't done this as variable maybe I shouldn't even try And I hope there will be some workaround in future updates for a throwing animation (mayble block anim at all), coz when character stand up for a throw it's looks a bit confusing. I've recorded a video in case you didn't know about this https://youtu.be/g-voYwWSrug

    Last edited by bullet28; 04-07-2020 at 00:16.
    bullet28 is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 04-07-2020 , 01:00   Re: [L4D & L4D2] Incapped Weapons Patch (1.2) [07-Apr-2020]
    Reply With Quote #8

    Quote:
    Originally Posted by bullet28 View Post
    Great plugin, thank you! Have you tried to make weapon fire cycletime as normal? I wondering if changing nextAttack prop will be enough.. but if you haven't done this as variable maybe I shouldn't even try And I hope there will be some workaround in future updates for a throwing animation (mayble block anim at all), coz when character stand up for a throw it's looks a bit confusing. I've recorded a video in case you didn't know about this https://youtu.be/g-voYwWSrug
    haha uhm not sure what can be done. Would have to require Left4DHooks to block/change the animation. I mean that could be optional requirement, so maybe I'll add. Thanks for notifying.

    For weapon fire rates while incapped you can use: WeaponHandling_API by Lux. Or set survivor_incapacitated_cycle_time to "0.1".
    __________________

    Last edited by Silvers; 04-07-2020 at 15:19.
    Silvers is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 04-07-2020 , 19:16   Re: [L4D & L4D2] Incapped Weapons Patch (1.4) [07-Apr-2020]
    Reply With Quote #9

    When you go incapped, number of reserve ammo become zero.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
    [My plugins] [My tools] [GitHub] [Articles]
    Dragokas is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 04-07-2020 , 23:23   Re: [L4D & L4D2] Incapped Weapons Patch (1.5) [08-Apr-2020]
    Reply With Quote #10

    Thanks, fixed.

    Code:
    1.8 (09-Apr-2020)
        - Fixed again not always restricting weapons correctly on incap. Thanks to "MasterMind420" for reporting.
    
    1.7 (08-Apr-2020)
        - Fixed not equipping melee weapons when allowed on incap.
    
    1.6 (08-Apr-2020)
        - Fixed breaking pistols, due to the last update.
    
    1.5 (08-Apr-2020)
        - Fixed ammo being wiped when incapped, due to 1.3 update. Thanks to "Dragokas" for reporting.
        - Fixed not always restricting weapons correctly on incap. Thanks to "MasterMind420" for reporting.
    Now I think all these issues are finally fixes. Stupid index problems as usual, should it be != 0 or == 0. The simplest and most difficult side of programming sometimes.
    __________________

    Last edited by Silvers; 04-09-2020 at 06:12.
    Silvers 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 14:29.


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