Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] God Frames Patch (1.7) [29-Apr-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6834
Plugin Version:
1.7
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    24 
    Plugin Description:
    Removes the IsInvulnerable function.
    Old 12-01-2019 , 13:14   [L4D & L4D2] God Frames Patch (1.7) [29-Apr-2022]
    Reply With Quote #1

    About:
    • Modern version of [L4D & L4D2] God Frames be Gone from AtomicStryker.
    • Players will instantly take damage instead of being dealt damage after a delay like the old plugin.
    • Reads the IsVulnerable function to detect god frames and overwrites.
    • Plugin #100


    Thanks:
    • Lux - For the patch method suggestions.
    • paul92 - For the request and testing.


    Forward for developers:
    Spoiler



    Cvars:

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

    PHP Code:
    // These cvars only affect damage being dealt during god frames.
    l4d_god_frames_damage_boomer    "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Boomer.
    l4d_god_frames_damage_charger   "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Charger.
    l4d_god_frames_damage_common    "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Common Infected.
    l4d_god_frames_damage_fire      "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Fire.
    l4d_god_frames_damage_hunter    "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Hunter.
    l4d_god_frames_damage_jockey    "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Jockey.
    l4d_god_frames_damage_smoker    "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Smoker.
    l4d_god_frames_damage_spitter   "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Spitter.
    l4d_god_frames_damage_survivor  "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by other Survivors.
    l4d_god_frames_damage_tank      "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Tank.
    l4d_god_frames_damage_witch     "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by Witch.
    l4d_god_frames_damage_world     "1.0"  // 0.0=None. 1.0=Full. Scale damage dealt by World.
    l4d_god_frames_delay_boomer     "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Boomer.
    l4d_god_frames_delay_charger    "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Charger.
    l4d_god_frames_delay_common     "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Common Infected.
    l4d_god_frames_delay_fire       "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Fire.
    l4d_god_frames_delay_hunter     "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Hunter.
    l4d_god_frames_delay_jockey     "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Jockey.
    l4d_god_frames_delay_smoker     "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Smoker.
    l4d_god_frames_delay_spitter    "0.1"  // 0.0=None. Minimum time before damage can be dealt again by Spitter.
    l4d_god_frames_delay_survivor   "0.0"  // 0.0=None. Minimum time before damage can be dealt again by other Survivors.
    l4d_god_frames_delay_tank       "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Tank.
    l4d_god_frames_delay_witch      "0.0"  // 0.0=None. Minimum time before damage can be dealt again by Witch.
    l4d_god_frames_delay_world      "0.0"  // 0.0=None. Minimum time before damage can be dealt again by World.
    l4d_god_frames_incapacitated    "0"    // 0=Remove God Frames from incapacitated players, 1=Allow God Frames.
    l4d_god_frames_allow            "1"    // 0=Plugin off, 1=Plugin on, 2=Enable forward only.
    l4d_god_frames_modes            ""     // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d_god_frames_modes_off        ""     // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d_god_frames_modes_tog        "0"    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together  
    l4d_god_frames_version                 // God Frames Patch plugin version. 


    Changes:
    Code:
    1.7 (26-Oct-2023)
        - Fixed errors if the "m_zombieClass" is out of range. Thanks to "chungocanh12" for reporting.
    
    1.6 (29-Apr-2022)
        - Added cvar "l4d_god_frames_incapacitated" to control damage on Incapacitated players. Requested by "ZBzibing".
        - Changed cvar "l4d_god_frames_allow" to allow the value "2" which only enables the forward.
        - Changed forward "OnTakeDamage_Invulnerable" params to show the damage type.
        - Potentially fixed reviving players instantly being incapacitated. Thanks to "Eyal282" for reporting.
    
    1.5 (10-May-2020)
        - Added better error log message when gamedata file is missing.
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
        - Fixed delay cvars being read wrong for: world, fire, common, witch, tank.
        - Various changes to tidy up code.
    
    1.4 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.3 (05-Feb-2020)
        - Moved forward creation to the correct place. Was rushed for demonstration.
    
    1.2 (21-Jan-2020)
        - Fixed L4D1 not using IsInvulnerable function in OnTakeDamage. Thanks to "fbef0102" for reporting.
        - Thanks to Lux for various help. L4D1 now reads and sets the IsInvulnerable timer directly.
        - L4D1 gamedata update required.
        - L4D2 gamedata update required if updating from 1.0.
    
    1.1.2 beta (13-Jan-2020)
        - Added forward "OnTakeDamage_Invulnerable" to allow 3rd party plugins to modify invulnerable damage.
    
    1.1.1 beta (13-Jan-2020)
        - Fixed not resetting delay timers OnMapEnd.
    
    1.1 beta (13-Jan-2020)
        - Added a heap of new cvars to control damage for individual infected etc.
        - New gamedata required.
    
    1.0 (01-Dec-2019)
        - 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.5 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    Attached Files
    File Type: txt l4d_god_frames.txt (904 Bytes, 999 views)
    File Type: smx l4d_god_frames.smx (10.8 KB, 247 views)
    File Type: sp Get Plugin or Get Source (l4d_god_frames.sp - 169 views - 22.7 KB)
    File Type: inc l4d_god_frames.inc (668 Bytes, 333 views)
    __________________

    Last edited by Silvers; 10-26-2023 at 02:29.
    Silvers is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 12-01-2019 , 14:26   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #2

    I would request individual SI godframes control. I would like for hunter pounces to ignore the godframes while don't want double spitters to incap players on the fly.

    Also congrats on hitting a 100 plugins!!
    __________________

    Last edited by Spirit_12; 12-01-2019 at 14:27.
    Spirit_12 is online now
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 12-01-2019 , 17:09   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #3

    Thanks!

    I was hoping no one would ask that...

    The problem is the games vulnerable function gets called from the middle of OnTakeDamage. Using OnTakeDamagePre hook might not give reliable data for the players actual damage since a bunch of stuff is calculated inside OnTakeDamage.

    Either using a pre hook and patching the function when required, or dhooks to detect when the function is called instead of patching, and allow or disallowing the damage according to cvars in OnTakeDamagePost.

    That would be the better option but requires dhooks (which is hopefully becoming standard for all servers anyway).
    __________________
    Silvers is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 12-03-2019 , 21:36   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #4

    Dhooks has been such a great extension I feel like it should be part of the base package now.
    __________________
    Spirit_12 is online now
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 12-05-2019 , 09:02   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #5

    I also made a similar "godframe gone and control" plugin before(l4d1 support only),
    have individual SI and received godframes control, based on
    here: https://github.com/Attano/L4D2-Compe...mes_control.sp

    and here: https://forums.alliedmods.net/showthread.php?t=127934

    but since I'm not such good programer and can not find the l4d1 "CTerrorPlayer::InvulnerabilityTimer" signature offset,
    I used a terrible method
    Spoiler

    It checks affected Survivors health after 0.1s an attack hit them, and if it finds player health wasn't reduced, using SetEntityHealth to set player's hp according to the damage .
    __________________

    Last edited by HarryPotter; 12-06-2019 at 05:57.
    HarryPotter is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 12-05-2019 , 09:46   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #6

    Quote:
    Originally Posted by fbef0102 View Post
    SetEntityHealth to set player's hp according to the damage .
    Really? So no credit to the actual attacker then...
    __________________
    Silvers is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 12-06-2019 , 06:03   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #7

    Quote:
    Originally Posted by Silvers View Post
    Really? So no credit to the actual attacker then...
    yes.., infected player get 0 reward point, it's wired I know
    that's why I am looking for better method to remove godframe for each player
    It seems that your plugin removes all players' godframe at pluginstart()
    __________________
    HarryPotter is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 12-06-2019 , 06:29   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #8

    Quote:
    Originally Posted by fbef0102 View Post
    yes.., infected player get 0 reward point, it's wired I know
    that's why I am looking for better method to remove godframe for each player
    It seems that your plugin removes all players' godframe at pluginstart()
    That's the whole point of the plugin to just outright remove them.

    You could however is Hook OnTakeDamage and control your own godframes.


    reference to this "CTerrorPlayer::InvulnerabilityTimer"
    Dunno if it's just me reading timers in l4d1 don't seem to read for me that much unlike l4d2
    maybe I am just stupid
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 12-06-2019 at 06:40.
    Lux is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 12-06-2019 , 16:27   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #9

    Quote:
    Originally Posted by Lux View Post
    You could however is Hook OnTakeDamage and control your own godframes.
    Thanks for tips
    I probably know how to do that, I will try to modify that
    __________________
    HarryPotter is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 12-09-2019 , 13:15   Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
    Reply With Quote #10

    Quote:
    Originally Posted by fbef0102 View Post
    It checks affected Survivors health after 0.1s an attack hit them, and if it finds player health wasn't reduced, using SetEntityHealth to set player's hp according to the damage .
    Maybe, use SDKHooks_TakeDamage function.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas 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:51.


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