Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Common Infected Health - Damage Received (1.9) [10-Aug-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7665
Plugin Version:
1.9
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    Specify or scale the damage Pipebombs, Propane, Oxygen, Grenade Launcher, Melee and Chainsaw damage caused to common infected.
    Old 06-03-2021 , 16:14   [L4D & L4D2] Common Infected Health - Damage Received (1.9) [10-Aug-2022]
    Reply With Quote #1

    Related Plugins:

    About:
    • Specify or scale the damage Pipebombs, Propane, Oxygen, Melee and Chainsaw damage caused to common infected.
    • Prevent 1 shot headshot kills on Common Infected.
    • L4D2: Set the default health for Uncommon Infected.
    • Note: All cvars are set to default game behavior and must be changed to see any effect!


    Examples:
    • Can make melee weapons require 2 strikes to kill common.
    • Can make explosions only remove half the health of common infected.
    • Options to specify a damage value, scale the damage according to maximum health or scale the games original damage.


    Thanks:
    • Lux - For some ideas.


    Cvars:

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

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

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

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

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

    // 0.0=Ignore headshot damage. 1.0=100% damage. Scale damage value applied on headshots.
    l4d_common_health_headshot "0.0"

    // 0=Block instant kill headshots. 1=Allow instant kill headshots.
    l4d_common_health_headshot_one "1"

    // L4D2 only. 0.0=Ignore headshot damage. 1.0=100% damage. Scale damage value applied on headshots with melee weapons.
    l4d_common_health_headshot_melee "0.0"

    // L4D2 only. 0.0=Off (games default damage). Amount of damage each Chainsaw hit causes to a common infected, or scale according to related cvar.
    l4d_common_health_chainsaw "0.0"

    // L4D2 only. 0=Deal the damage value specified. 1=Deal the specified damage value as a percentage of their maximum health. 2=Scale original damage.
    l4d_common_health_chainsaw2 "2"

    //L4D2 only. 0.0=Off (games default damage). Amount of damage each Grenade Launcher hit causes to a common infected, or scale according to related cvar.
    l4d_common_health_launcher "0.0"

    // L4D2 only. 0=Deal the damage value specified. 1=Deal the specified damage value as a percentage of their maximum health. 2=Scale original damage.
    l4d_common_health_launcher2 "2"

    // L4D2 only. 0.0=Off (games default damage). Amount of damage each Melee weapon hit causes to a common infected, or scale according to related cvar.
    l4d_common_health_melee "0.0"

    // L4D2 only. 0=Deal the damage value specified. 1=Deal the specified damage value as a percentage of their maximum health. 2=Scale original damage.
    l4d_common_health_melee2 "2"

    // 0.0=Off (games default damage). Amount of damage each Oxygen Tank explosion causes to a common infected, or scale according to related cvar.
    l4d_common_health_oxygen "0.0"

    // 0=Deal the damage value specified. 1=Deal the specified damage value as a percentage of their maximum health. 2=Scale original damage.
    l4d_common_health_oxygen2 "2"

    // 0.0=Off (games default damage). Amount of damage each PipeBomb explosion causes to a common infected, or scale according to related cvar.
    l4d_common_health_pipebomb "0.0"

    // 0=Deal the damage value specified. 1=Deal the specified damage value as a percentage of their maximum health. 2=Scale original damage.
    l4d_common_health_pipebomb2 "2"

    // 0.0=Off (games default damage). Amount of damage each Propane explosion causes to a common infected, or scale according to related cvar.
    l4d_common_health_propane "0.0"

    // 0=Deal the damage value specified. 1=Deal the specified damage value as a percentage of their maximum health. 2=Scale original damage.
    l4d_common_health_propane2 "2"

    // L4D2 only. Default amount of health to give Ceda uncommon infected.
    l4d_common_health_u_ceda "150"

    // L4D2 only. Default amount of health to give Clown uncommon infected.
    l4d_common_health_u_clown "150"

    // L4D2 only. Default amount of health to give Fallen Survivor uncommon infected.
    l4d_common_health_u_fallen "1000"

    // L4D2 only. Default amount of health to give Jimmy Gibbs uncommon infected.
    l4d_common_health_u_jimmy "3000"

    // L4D2 only. Default amount of health to give Mud uncommon infected.
    l4d_common_health_u_mud "150"

    // L4D2 only. Default amount of health to give Riot uncommon infected.
    l4d_common_health_u_riot "50"

    // L4D2 only. Default amount of health to give Road Crew uncommon infected.
    l4d_common_health_u_road "150" 


    Changes:
    Code:
    1.9 (10-Aug-2022)
        - Fixed weapons not following the "l4d_common_health_headshot" scale value to prevent insta-kill headshots.
        - Fixed client crashes related to changing headless zombies into half-headless. Thanks to "Toranks" for reporting and testing.
    
    1.8 (29-May-2022)
        - Fixed errors in L4D1 about "m_iRequestedWound1" missing.
    
    1.7 (27-May-2022)
        - Combined code with "Common Headshot" plugin.
        - Better handling of wounds. Thanks to "Toranks" for help fixing.
        - Added new cvars "l4d_common_health_headshot", "l4d_common_health_headshot_melee" to control headshot damage.
        - Added new cvar "l4d_common_health_headshot_one" to control if single shots to common infected heads insta-kill them.
        - Fixed crashing clients when multiple common have wounds within the same frame.
    
        - Thanks to "Toranks" for tons of testing and feedback.
    
    1.6 (16-May-2022)
        - Now blocks insta-killing common infected when multiple common are struck by melee weapons. Thanks to "Toranks" for reporting.
        - Instant kills are only blocked when the cvar "l4d_common_health_melee" value is not "0.0".
    
    1.5 (29-Oct-2021)
        - Compatibility update for "Prototype Grenades" plugin. Now sets the "m_iMaxHealth" on Common Infected when the value is changed.
    
    1.4 (14-Jul-2021)
        - Compatibility update for "Bots Ignore PipeBombs and Shoot" plugin.
    
    1.3 (11-Jul-2021)
        - L4D2: Optimized model checks slightly.
    
    1.2 (20-Jun-2021)
        - L4D2: Added cvars to set default uncommon infected health:
            "l4d_common_health_u_ceda", "l4d_common_health_u_clown", "l4d_common_health_u_fallen", "l4d_common_health_u_jimmy",
            "l4d_common_health_u_mud", "l4d_common_health_u_riot", "l4d_common_health_u_road"
        - Requested by "Enduh".
    
    1.1 (04-Jun-2021)
        - L4D2: Added 2 new cvars and support to customize damage for the Grenade Launcher weapon.
    
    1.0 (03-Jun-2021)
        - Initial release.


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


    Installation:
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_common_health.sp - 951 views - 34.7 KB)
    __________________

    Last edited by Silvers; 08-10-2022 at 07:22.
    Silvers is offline
    Enduh
    New Member
    Join Date: Jun 2021
    Old 06-20-2021 , 10:32   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.1) [04-Jun-2021]
    Reply With Quote #2

    Hello! If it is not too much, I have a suggestion: add values for all types of zombies (common, workers, riots, hazmat guys, mud men). Like, man, the uncommon infected on Realism are worse than anything else. They are just insanely hard to kill without melee weapons, and when a horde of such zombies appear (on custom campaigns, especially unbalanced ones), it is worse than two Tanks at once. It also would be useful in general, I think.
    Enduh is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-20-2021 , 11:28   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.1) [04-Jun-2021]
    Reply With Quote #3

    You simply want to set the health for each Uncommon infected? For common infected you can set with the "z_health" cvar.

    Done.

    Code:
    1.2 (20-Jun-2021)
        - L4D2: Added cvars to set default uncommon infected health:
            "l4d_common_health_u_ceda", "l4d_common_health_u_clown", "l4d_common_health_u_fallen", "l4d_common_health_u_jimmy",
            "l4d_common_health_u_mud", "l4d_common_health_u_riot", "l4d_common_health_u_road"
        - Requested by "Enduh".
    __________________

    Last edited by Silvers; 06-20-2021 at 12:05.
    Silvers is offline
    Enduh
    New Member
    Join Date: Jun 2021
    Old 06-20-2021 , 13:05   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.1) [04-Jun-2021]
    Reply With Quote #4

    Quote:
    Originally Posted by Silvers View Post
    You simply want to set the health for each Uncommon infected? For common infected you can set with the "z_health" cvar.

    Done.

    Code:
    1.2 (20-Jun-2021)
        - L4D2: Added cvars to set default uncommon infected health:
            "l4d_common_health_u_ceda", "l4d_common_health_u_clown", "l4d_common_health_u_fallen", "l4d_common_health_u_jimmy",
            "l4d_common_health_u_mud", "l4d_common_health_u_riot", "l4d_common_health_u_road"
        - Requested by "Enduh".
    I know about the «z_health» (thanks anyway) and, actually, I was thinking about something more complicated like adding the amount of damage each type of uncommon zombie takes from a weapon (like, road worker takes XX amount of damage from an M16), but nevermind. Thanks a bunch for quick answer and the update!
    Enduh is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-20-2021 , 16:54   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.1) [04-Jun-2021]
    Reply With Quote #5

    Quote:
    Originally Posted by Enduh View Post
    I know about the «z_health» (thanks anyway) and, actually, I was thinking about something more complicated like adding the amount of damage each type of uncommon zombie takes from a weapon (like, road worker takes XX amount of damage from an M16), but nevermind. Thanks a bunch for quick answer and the update!
    Yeah that's way more than a simple request, something for another plugin maybe. I'm not interested in writing a whole config to change each individual weapon and common. This should cover the basics as is. If you want some more in depth post in the request section. I don't have time for something so complicated.
    __________________

    Last edited by Silvers; 06-20-2021 at 18:03.
    Silvers is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-16-2022 , 15:46   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.6) [16-May-2022]
    Reply With Quote #6

    Code:
    1.6 (16-May-2022)
        - Now blocks insta-killing common infected when multiple common are struck by melee weapons. Thanks to "Toranks" for reporting.
        - Instant kills are only blocked when the cvar "l4d_common_health_melee" value is not "0.0".
    __________________
    Silvers is offline
    Toranks
    Senior Member
    Join Date: Dec 2021
    Location: Spain
    Old 05-23-2022 , 03:18   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.6) [16-May-2022]
    Reply With Quote #7

    There is a server-sided crash (the client disconnect) when I attack Jimmy Gibbs with melee 100% of the time, between the first and fourth attacks, and I have a suspicion that also sometimes the fallen survivors and maybe others uncommons, but I have not been able to verify this 100%

    Also, all commons and uncommons always take the same wound, chest wound. (Value = 0) no matter where you hit them. Jimmy Gibbs has no wounds, maybe it's related to the greater chance of crash with him.

    Using my version of nerf damage commons which chooses which wounds to show (all but legs and full head), and setting the melee damage with same value as your plugin, all back to normal, no crashes and correct wounds. Although obviously, the problem that we talked about instakill hitting zombies in group returns.
    https://forums.alliedmods.net/showpo...6&postcount=54

    In case it helps, these are the values that identify the different commons when you request the gender value:
    int gender = GetEntProp(victim, Prop_Send, "m_Gender");
    In capital letters, the type of wounds have, detailed list in this post:
    https://forums.alliedmods.net/showpo...11&postcount=1
    Types: MALE, FEMALE, CEDA, RIOT, NO WOUNDS

    0=Standard common MALE
    21=Patients and bikers MALE
    20=Police MALE
    12=Mudmen MALE
    13=Uncommon workers MALE
    14=Superviviente caido MALE
    16=Clowns MALE
    22=Female L4D1 FEMALE
    2=Female L4D2 FEMALE
    15=Riot cops RIOT
    17=Jimmy Gibbs NO WOUNDS
    11=Ceda uncommons CEDA

    All other numbers MUST BE IGNORED and allow them to have vanilla wounds behavior, to avoid crashes with unique mod models like extended common infected.

    As an alternative, I would think of you to disable everything related to the wounds behavior (commons headshots plugins handles head wounds with the changes I say on its corresponding post) and allow nerf damage commons plugin to handle them, to avoid duplication in functions.

    Tested and happens with ONLY this plugin and Left4dHooks
    Dedicated server crash dump:
    https://crash.limetech.org/4w3cgegss3co
    https://crash.limetech.org/bdr4dl36jifj
    Listen server crash dumps:
    https://crash.limetech.org/wirk7dvyqjcy
    https://crash.limetech.org/5bhuscqiyedb
    https://crash.limetech.org/du4atwmulzwg
    https://crash.limetech.org/olfyi2akt5vf

    Last edited by Toranks; 05-23-2022 at 07:40.
    Toranks is offline
    Toranks
    Senior Member
    Join Date: Dec 2021
    Location: Spain
    Old 05-23-2022 , 03:41   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.6) [16-May-2022]
    Reply With Quote #8

    I found the cause, is this code, since the value "0" is Chest wounds. No wound is "-1"

    Code:
    // Prevent certain gibbed wounds, e.g. to stop legless zombies running around after multiple melee hits or explosions
    				if( health - damage > 0.0 )
    				{
    					SetEntProp(victim, Prop_Send, "m_iRequestedWound1", 0);
    					SetEntProp(victim, Prop_Send, "m_iRequestedWound2", 0);
    				}
    By removing this piece of code entirely, nerf damage commons handles the wounds and everything is back to normal.

    For those who don't use Nerf damage commons and still want to avoid legless zombies walking around, just change both "0" to "-1". Keep in mind that they will NOT have any kind of wounds, not even arms, chest, etc... For that reason I created the Nerf Damage Commons code snip.

    Last edited by Toranks; 05-23-2022 at 03:43.
    Toranks is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-27-2022 , 15:39   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.7) [27-May-2022]
    Reply With Quote #9

    Code:
    1.7 (27-May-2022)
        - Combined code with "Common Headshot" plugin.
        - Better handling of wounds. Thanks to "Toranks" for help fixing.
        - Added new cvars "l4d_common_health_headshot", "l4d_common_health_headshot_melee" to control headshot damage.
        - Added new cvar "l4d_common_health_headshot_one" to control if single shots to common infected heads insta-kill them.
        - Fixed crashing clients when multiple common have wounds within the same frame.
    
        - Thanks to "Toranks" for tons of testing and feedback.
    __________________
    Silvers is offline
    Toranks
    Senior Member
    Join Date: Dec 2021
    Location: Spain
    Old 05-27-2022 , 16:14   Re: [L4D & L4D2] Common Infected Health - Damage Received (1.7) [27-May-2022]
    Reply With Quote #10

    Repost here because I think is a very useful info for how to use differents plugins together:

    First, many thanks to Silvers for this amazing plugin. I think this is one of the best

    Thanks to this plugin I finally achieved my goal of removing all instakills from this game, which allows me to experiment more with different HP values for commons and specials without fear of imbalances of certain weapons against others, or even of shoves, which could kill commons and specials with a invariable number of shoves.
    I leave here a list of the plugins that I use in coordination to eliminate ABSOLUTELY ALL possible instakills, even fire and explosions if you wish.

    - This plugin, of course

    - [L4D2] Melee Fix by Mr. Zero
    No more kills to SI with an immovable number of melee hits, you can choose the exact amount of damage each hit deals based on the victim class. You can also choose if a melee hit to the head kills them instantly.
    Old, but stills works. You need to compile it by yourself. Confirm this works on a listen server, even though the plugin says not to support it, erasing the line that detect it on main.sp (!IsDedicatedServer). Dedicated server tested too. Not forget to erase '#define DEBUG' line on main.sp file or will get a chat message every hit, very useful to check if the plugin works, but not to play. This need to be recompiled with the tools included in the zip file.
    https://forums.alliedmods.net/showthread.php?t=154366
    Known bug: Some custom melee weapons made by the community, such as the Roku Hammer, lose their special stun-stagger SI property. Although that's fine for me, since it seems to me a too OP weapon, being able to stun tanks without them being able to avoid it in any way, with precise timing. Commons still can be stunned harder tan usual.

    - [L4D & L4D2] Shove Handler by Silvers
    Same function as the previous plugin, but instead of melee weapons, with shoves. You can choose the exact damage dealt to each individual enemy type, or the number of shoves needed to kill them.
    https://forums.alliedmods.net/showthread.php?t=337808

    - [L4D2] Nerf Damage To Commons by Marttt
    Nullifies the instakills with Rifle M60, Pistol Magnum, All Snipers (Hunting, Military, Scout, AWP), Chainsaw, All Melees (custom melees included), Explosive Ammo and Incendiary Ammo.
    I recommend using my edit, which allows zombies to lose body parts while alive with the sole exception of legs-related wounds (so no flying zombies), and is compatible with Commons mods as Extended Common Infected with new commons models with different wounds. The partial head can works with the headshots instakills prevention of Common Infected Health active (remember to activate it). Extensively tested on listen server and dedicated server.
    Together with this plugin, set l4d2_nerf_damage_common_melee_damage "0", and set your desired value on l4d_common_health_melee "XXX" instead, but don't forget to put l4d2_nerf_damage_common_melee_WEAPON "1" on the melee weapons you desired if you want the % of stuns, and other effects related on the other Nerf Commons Damage cvars
    https://forums.alliedmods.net/showpo...6&postcount=54

    Last edited by Toranks; 05-29-2022 at 09:20.
    Toranks 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 05:25.


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