AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2] God Frames Patch (1.5) [10-May-2020] (https://forums.alliedmods.net/showthread.php?t=320023)

Silvers 12-01-2019 12:14

[L4D & L4D2] God Frames Patch (1.5) [10-May-2020]
 
9 Attachment(s)
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_allow            "1"    // 0=Plugin off, 1=Plugin on.
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.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.0:
  • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.

Spirit_12 12-01-2019 13:26

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
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!!

Silvers 12-01-2019 16:09

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
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).

Spirit_12 12-03-2019 20:36

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
Dhooks has been such a great extension I feel like it should be part of the base package now.

HarryPotter 12-05-2019 08:02

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
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 .

Silvers 12-05-2019 08:46

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
Quote:

Originally Posted by fbef0102 (Post 2675768)
SetEntityHealth to set player's hp according to the damage .

Really? So no credit to the actual attacker then...

HarryPotter 12-06-2019 05:03

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
Quote:

Originally Posted by Silvers (Post 2675774)
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()

Lux 12-06-2019 05:29

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
Quote:

Originally Posted by fbef0102 (Post 2675874)
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 :P

HarryPotter 12-06-2019 15:27

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
Quote:

Originally Posted by Lux (Post 2675876)
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

Dragokas 12-09-2019 12:15

Re: [L4D & L4D2] God Frames Patch (1.0) [01-Dec-2019]
 
Quote:

Originally Posted by fbef0102 (Post 2675768)
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.


All times are GMT -4. The time now is 14:03.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.