AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2]Charger_Collision_patch[Left 4 Fix][05/03/2024] (https://forums.alliedmods.net/showthread.php?t=315482)

Lux 04-10-2019 15:49

[L4D2]Charger_Collision_patch[Left 4 Fix][05/03/2024]
 
1 Attachment(s)
Charger Collision patch apart of Left 4 Fix.
https://github.com/LuxLuma/Left-4-fix

Huge thanks to silvers in helping me learn alot of stuff about disassembly, IDA, memory patching and finding windows signatures.

Charger_Collision_patch
Fixes charging only allowing to hit 1 of each survivor character index and allows charger smashing into the same survivor more than once, survivors no longer become a brick wall after being charger smashed once, damage should only be delt once per survivor per charge.



Requirements:

Source Scramble (memory patching and allocation natives)

Installation:

1.Download the .zip file.
2.Merge with \addons\sourcemod\ folder.
3.Restart the server.

TrueSurvivor 04-30-2019 23:33

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Neat plugin idea, everything looked in order so I decided to run it on the Servers for a day and I came across this issue (Twitch Clip)

When glancing over the source code it should prevent the damage just fine, could it be possible that m_carryVictim is changed briefly upon charger_impact?

Lux 05-01-2019 00:06

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Hmm i tested this problem alot and thought i fixed it, ill try and replicate it and see what happens, also a note do you use this plugin?

https://forums.alliedmods.net/showth...27934?t=127934

TrueSurvivor 05-01-2019 00:17

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2649532)
Hmm i tested this problem alot and thought i fixed it, ill try and replicate it and see what happens, also a note do you use this plugin?

https://forums.alliedmods.net/showth...27934?t=127934

Yes, I am.
I didn't even stop to think that OnTakeDamage calls can interfere with one another, it's a likely cause, especially as I've had to deal with this in the past. :oops:

Lux 05-01-2019 00:19

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Ok noproblem that makes testing for me easier, if that plugin is the reason why it is happening, i'm unsure if ill be able to work around and would have to leave a note on the plugin thread.

Lux 05-01-2019 00:38

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Alright that godframes plugin does not conflict with this plugin regardless of load order,
did you by any chance load the plugin mid game?

TrueSurvivor 05-01-2019 01:22

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2649541)
Alright that godframes plugin does not conflict with this plugin regardless of load order,
did you by any chance load the plugin mid game?

No, the plugin was loaded and the map got restarted.
It's also the first plugin that uses OnTakeDamage (order-wise) that gets loaded.

Lux 05-01-2019 01:47

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
I have no idea what could cause this, most likely a conflict somewhere causing my checks to fail.

Try doing this
PHP Code:

public Action BlockRecursiveDamage(int iVictimint &iChargerint &iInflictorfloat &fDamageint &iDamagetype)
{
    if(
GetClientTeam(iVictim) != 2)
        return 
Plugin_Continue;
    
    if(
iCharger || iCharger MaxClients || 
        
GetClientTeam(iCharger) != || !IsPlayerAlive(iCharger) || 
        
GetEntProp(iChargerProp_Send"m_zombieClass"1) != )
        return 
Plugin_Continue;
    
    
int iAbility GetEntPropEnt(iChargerProp_Send"m_customAbility");
    if(
iAbility <= MaxClients || !HasEntProp(iAbilityProp_Send"m_isCharging"))
        return 
Plugin_Continue;
    
    if(
GetEntProp(iAbilityProp_Send"m_isCharging"1))
    {
        if(
GetEntPropEnt(iVictimProp_Send"m_carryAttacker") == iCharger &&
            
GetEntPropEnt(iChargerProp_Send"m_carryVictim") == iVictim)
            return 
Plugin_Continue;
            
        if(
g_fPreventDamage[iCharger][iVictim] > GetEngineTime())
            return 
Plugin_Handled;
        
        
g_fPreventDamage[iCharger][iVictim] = GetEngineTime() + 0.5;
    }
    return 
Plugin_Continue;


Creating an block in the damage hook for next collision if this don't work i'v no idea how to help you.

Besure to restart server.

Quote:

Originally Posted by TrueSurvivor (Post 2649544)
could it be possible that m_carryVictim is changed briefly upon charger_impact?

Not that i know of.

eyal282 05-01-2019 11:40

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
THANK YOU!!!

Spirit_12 05-02-2019 02:52

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
From your explanation it seems like a straight up port of the extension as opposed to a new fix. Does it do anything different than the bugfix extension?

Lux 05-02-2019 06:47

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Spirit_12 (Post 2649752)
From your explanation it seems like a straight up port of the extension as opposed to a new fix. Does it do anything different than the bugfix extension?

Not a port the extension keeps track of people who the charger hits and prevents collision again, i allow the collision to happen as many times as it needs to, with extension/vanilla once you hit someone once they can nolonger be hit again and become a brickwall.

In small rooms/hallways this is a huge problem at times more survivors easier for this to happen.

Making this was apart of the reason i did not use the extension.
another thing because the cvar is scales down angle of impacted can determine how far and high you go head on impact is far worse than a side a little tap.

Spirit_12 05-02-2019 11:36

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2649772)
Not a port the extension keeps track of people who the charger hits and prevents collision again, i allow the collision to happen as many times as it needs to, with extension/vanilla once you hit someone once they can nolonger be hit again and become a brickwall.

In small rooms/hallways this is a huge problem at times more survivors easier for this to happen.

Making this was apart of the reason i did not use the extension.
another thing because the cvar is scales down angle of impacted can determine how far and high you go head on impact is far worse than a side a little tap.

Thanks for the explanation. I never really noticed it not hitting the other survivors.

Lux 11-05-2019 14:35

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Update 1.1

Added restore patch code to save me from headaches of reload errors.
Added restore convar to put collsion force restore.

a2121858 09-29-2020 02:06

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Hello, LUX:wink:. On my server, it happens occasionally that the person who was hit by the Charger immediately died immediately, and the survivor was still in full health. It's just a very accidental event, but sometimes I die right after I get out of the security door. There is no error log. Could you please check it?:)

Lux 09-29-2020 02:53

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by a2121858 (Post 2719490)
Hello, LUX:wink:. On my server, it happens occasionally that the person who was hit by the Charger immediately died immediately, and the survivor was still in full health. It's just a very accidental event, but sometimes I die right after I get out of the security door. There is no error log. Could you please check it?:)

Already checked this last year i could not replicate it no matter how much i tried.

Since you are the second person who reported this ill have to approch it another way with handling damage.

Post your plugin list please too.

Accelerator 09-29-2020 04:40

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2719505)
Already checked this last year i could not replicate it no matter how much i tried.

After the update, something has changed and this problem can be found more often. I have noticed her on all 4 servers (coop/versus).

ProdigySim says:
Quote:

Charger Chestbumps are fixed in the update, and you shouldn't need to fix this with a plugin anymore.
https://gist.github.com/ProdigySim/b...9e3d9f5634996f

Lux 09-29-2020 04:56

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Accelerator74 (Post 2719514)
After the update, something has changed and this problem can be found more often. I have noticed her on all 4 servers (coop/versus).

ProdigySim says:
https://gist.github.com/ProdigySim/b...9e3d9f5634996f

This is a different issue mentioned here.
https://forums.alliedmods.net/showpo...2&postcount=11

The most idea way is for valve to disable collsion between survivors that have been hit already to avoid the charger getting stuck on them, and god forbid they don't use characters to keep track of them.

a2121858 09-29-2020 05:26

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Although it happened several times, I still don't know the specific conditions under which it happened. It was very accidental, and suddenly died after a hit.:) I have changed the collision damage time to 1.5 and the impact force to *0.1, but it still happens. My server is 10VS10, I hope the information I provided is helpful. Anyway, thank you for your work.:stupid:

Code:

  001 "Admin File Reader" (1.10.0.6497) by AlliedModders LLC
  002 "Admin Help" (1.10.0.6497) by AlliedModders LLC
  003 "Admin Menu" (1.10.0.6497) by AlliedModders LLC
  004 "AFK Manager" (2.0) by Accelerator
  005 "all4dead2.smx"
  006 "Anti-Flood" (1.10.0.6497) by AlliedModders LLC
  007 "Basic Ban Commands" (1.10.0.6497) by AlliedModders LLC
  008 "Basic Chat" (1.10.0.6497) by AlliedModders LLC
  009 "Basic Comm Control" (1.10.0.6497) by AlliedModders LLC
  010 "Basic Commands" (1.10.0.6497) by AlliedModders LLC
  011 "Basic Info Triggers" (1.10.0.6497) by AlliedModders LLC
  012 "Basic Votes" (1.10.0.6497) by AlliedModders LLC
  013 "brutal_hunter_pounce.smx"
  014 "Burners Announcements" (1.1.1) by [ru]In1ernal Error, cravenge
  015 "CampaignShift" (0.0.15(NR)) by Victor "NgBUCKWANGS" Gonzalez
  016 "[L4D2]Charger_Collision_Patch" (1.1) by Lux
  017 "[L4D2]Defib_Fix" (2.0) by Lux
  018 "Fast melee fix" (2.1) by sheo
  019 "Fun Commands" (1.10.0.6497) by AlliedModders LLC
  020 "Fun Votes" (1.10.0.6497) by AlliedModders LLC
  021 "L4D Ghost Fly" (1.1.1a) by Madcap (modified by dcx2)
  022 "Health Display" (2.12.45) by Chanz
  023 "[L4D2]hunter_pounce_alignment_fix" (2.0) by Lux
  024 "[L4D2] Bonus Healing" (1.31) by Mortiegama
  025 "L4D2Lib" (1.0) by Confogl Team
  026 "l4d2meleefix.smx"
  027 "L4D2 Utilities" (1.0) by Confogl Team
  028 "l4d2_changelevel" (1.2.1) by Lux
  029 "l4d2_character_manager.smx" (1.4.1) by Lux, $atanic $pirit
  030 "[L4D2] Charger Shoved Fix" (1.2) by SilverShot
  031 "l4d2_charger_steering.smx" (1.8) by Silvers
  032 "L4D2 Charger Jump.smx" (1.11) by Mortiegama
  033 "[L4D2] Custom admin commands" (1.3.7) by honorcode23, Shadowysn (improvements)
  034 "L4D2 Door Lock" (2.6a) by Glide Loading
  035 "L4D2 Get-Up Fix" (1.7.1) by Blade, ProdigySim, DieTeetasse, Stabby, Jahze, devilesk
  036 "Stagger Blocker" (1.3) by Standalone (aka Manu), Visor, Sir
  037 "L4D2 Incapped Meds Munch" (1.2.0) by AtomicStryker
  038 "[L4D2] Scavenge Score Fix - Gascan Pouring" (1.3) by SilverShot
  039 "l4d2_void_darkness.smx"
  040 "Witch Control" (1.4.2) by DJ_WEST
  041 "L4D2_WorldModel_Turnrate" (1.0) by Lux
  041 "Zombie Character Select" (0.9.6) by XBetaAlpha
  043 "l4d2_zoey_unlock.smx" (1.2) by Silvers
  044 "[L4D2] Zoom Level" (0.0.0) by BHaType
  045 "[L4D2] Air Patch" (0.0) by BHaType (thanks Vit_amin for testing on his Linux server)
  046 "Evil Witch" (2.0) by Pan XiaoHai, $atanic $pirit
  047 "[L4D & L4D2] Extinguisher and Flamethrower" (1.13) by SilverShot
  048 "[L4D & L4D2] Mission and Weapons - Info Editor" (1.11) by SilverShot
  049 "[L4D & L4D2] Reload Fix - Max Clip Size" (1.1) by SilverShot
  050 "L4D(2) Tank Rock Lag Compensation" (1.13) by Luckylockm,harry,Silvers
  051 "Saferoom Door Manager" (1.1) by Sir
  052 "Super Versus Reloaded" (2.0) by DDRKhat, Marcus101RR, and Merudo, editedby Foxhound27
  053 "tank's throw special infected" (1.2) by Pan Xiaohai
  054 "L4D2 Tank Control" (0.10.5) by arti, Sir, devilesk
  055 "[L4D & L4D2] Teammate Flashlight" (1.0) by SilverShot, sereky
  056 "l4d_teamspanel.smx"
  057 "SpecLister" (3.0) by waertf & bear modded by bman, l4d1 versus port by harry
  058 "[L4D & L4D2] Vomit extinguishing" (2.0) by Olj, Visual77, asto, raziEiL [disawar1]
  059 "[L4D & L4D2] Left 4 DHooks Direct" (1.24) by SilverShot
  060 "LerpTracker" (0.8) by ProdigySim
  061 "Upgrade Pack Fixes" (1) by bullet28, V10, Silvers
  062 "Heal Refuse" (2) by bullet28
  063 "Lightweight Spectating" (1.2) by Visor
  064 "LMC_Black_and_White_Notifier" (2.0.2) by Lux
  065 "[L4D2]M60_NoDrop_AmmoPile_patch" (1.0.7) by Lux
  066 "MultiTanks - Improved" (1.7) by Red Alex, cravenge, Harry Potter
  067 "perkmod2.smx" (2.2.2db) tPoncho (DB by muukis)
  068 "[L4D1/2]physics_object_pushfix" (1.0) by Lux
  069 "Player Commands" (1.10.0.6497) by AlliedModders LLC
  070 "[L4D2] Pummeled Survivor Fix" (1.31) by cravenge
  071 "RandomTank.smx" (1.0) by Ludastar (Armonic)
  072 "RandomWitch.smx" (1.0) by Ludastar (Armonic)
  073 "Reserved Slots" (1.10.0.6497) by AlliedModders LLC
  074 "SnareSpeak.smx"
  075 "Sound Commands" (1.10.0.6497) by AlliedModders LLC
  076 "SpeakingList" (1.5) by Accelerator
  077 "stop_air_revive" (1.0) by Lux
  078 "Tickrate Fixes" (1.1) by Sir, Griffin
  079 "[L4D1/2]Witch_allow_in_safezone" (1.1) by Lux & Harry Potter
  080 "Witch and Tankifier!" (1) by CanadaRox
  081 "[L4D2]Witch_Double_Start_Fix" (1.0) by Lux
  082 "Witch Glows" (1.1) by CanadaRox
  083 "[L4D1/2]witch_prevent_target_loss" (1.1.1) by Lux
  084 "[L4D1/2]Witch_Target_Patch" (1.4) by Lux
  085 "[L4D2]Witch_update_witch_nbm" (1.0) by Lux
  086 "[L4D2]Adrenaline_Recovery" (1.0.1) by Lux


MasterMe 10-11-2020 22:06

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
I can confirm the bug where a survivor with full health goes down in a single charge, it's rather rare but during some hours of play it happens at least once. Most of the times though I (and others) don't notice. Seems to happen mostly on long charges. I can post plugin list if useful, but perhaps more interesting is that I run on 100 ticks server.

Lux 06-16-2021 05:08

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
updated gamedata for 2.2.1.3

This also still needs a different approch :P

Psyk0tik 07-08-2021 13:36

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
The offsets for "CCharge::HandleCustomCollision" changed with today's update:
PHP Code:

"CCharge::HandleCustomCollision"
{
    
"linux"        "333" // was 327 //0x01
    
"windows"    "305" // was 297 //0x01



Lux 07-08-2021 22:22

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Crasher_3637 (Post 2752211)
The offsets for "CCharge::HandleCustomCollision" changed with today's update:
PHP Code:

"CCharge::HandleCustomCollision"
{
    
"linux"        "333" // was 327 //0x01
    
"windows"    "305" // was 297 //0x01



Thanks crasher!

Updated gamedata

Lux 04-06-2022 17:47

Re: [L4D2]Charger_Collision_patch[Left 4 Fix][06/04/2022]
 
Quote:

Originally Posted by TrueSurvivor (Post 2649531)
Neat plugin idea, everything looked in order so I decided to run it on the Servers for a day and I came across this issue (Twitch Clip)

When glancing over the source code it should prevent the damage just fine, could it be possible that m_carryVictim is changed briefly upon charger_impact?

It is very very very rare this damage bug, i'v only seen it on linux period should be fixed now if you fancy another try.


Update 2.0
Redid collision code semi custom.
Fix rare strange bug with damage(prevented damage from even being delt instead of SDKHooks way)
Prevented impulse velocity code from accounting current velocity, charger impact force is only accounted now (just sets velocity to 0)

Darkwob 11-01-2022 07:34

Re: [L4D2]Charger_Collision_patch[Left 4 Fix][06/04/2022]
 
Lux, does dhook conflict with left4dhooks? also i get sourcescramble.ext not executed error. can you help?


Quote:

Unable to load plugin "Game/Charger_Collision_patch.smx": Required extension "Source Scramble" file("sourcescramble.ext") not running
Quote:

Unable to load extension "sourcescramble.ext": /home/user5361/gameserver/27215/left4dead2/left4dead2/addons/sourcemod/extensions/sourcescramble.ext.so: cannot open shared object file: No such file or directory

HarryPotter 02-17-2024 05:59

Re: [L4D2]Charger_Collision_patch[Left 4 Fix][06/04/2022]
 
PHP Code:

L 02/17/2024 18:40:32: [SMException reportedClient 18 is not in game
L 02
/17/2024 18:40:32: [SMBlamingCharger_Collision_patch.smx
L 02
/17/2024 18:40:32: [SMCall stack trace:
L 02/17/2024 18:40:32: [SM]   [0GetClientTeam
L 02
/17/2024 18:40:32: [SM]   [1Line 201d:\Github\Private-Work\L4D2\scripting\Charger_Collision_patch.sp::ImpactSNDHook
L 02
/17/2024 18:40:32: [SM]   [3StopSound
L 02
/17/2024 18:40:32: [SM]   [4Line 740d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::ResetSound
L 02
/17/2024 18:40:32: [SM]   [5Line 616d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::Event_Spawned
L 02
/17/2024 18:40:32: [SMException reportedClient 18 is not in game
L 02
/17/2024 18:40:32: [SMBlamingCharger_Collision_patch.smx
L 02
/17/2024 18:40:32: [SMCall stack trace:
L 02/17/2024 18:40:32: [SM]   [0GetClientTeam
L 02
/17/2024 18:40:32: [SM]   [1Line 201d:\Github\Private-Work\L4D2\scripting_1.11\Charger_Collision_patch.sp::ImpactSNDHook
L 02
/17/2024 18:40:32: [SM]   [3StopSound
L 02
/17/2024 18:40:32: [SM]   [4Line 741d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::ResetSound
L 02
/17/2024 18:40:32: [SM]   [5Line 616d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::Event_Spawned 


Lux 03-05-2024 03:57

Re: [L4D2]Charger_Collision_patch[Left 4 Fix][06/04/2022]
 
Quote:

Originally Posted by HarryPotter (Post 2818160)
PHP Code:

L 02/17/2024 18:40:32: [SMException reportedClient 18 is not in game
L 02
/17/2024 18:40:32: [SMBlamingCharger_Collision_patch.smx
L 02
/17/2024 18:40:32: [SMCall stack trace:
L 02/17/2024 18:40:32: [SM]   [0GetClientTeam
L 02
/17/2024 18:40:32: [SM]   [1Line 201d:\Github\Private-Work\L4D2\scripting\Charger_Collision_patch.sp::ImpactSNDHook
L 02
/17/2024 18:40:32: [SM]   [3StopSound
L 02
/17/2024 18:40:32: [SM]   [4Line 740d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::ResetSound
L 02
/17/2024 18:40:32: [SM]   [5Line 616d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::Event_Spawned
L 02
/17/2024 18:40:32: [SMException reportedClient 18 is not in game
L 02
/17/2024 18:40:32: [SMBlamingCharger_Collision_patch.smx
L 02
/17/2024 18:40:32: [SMCall stack trace:
L 02/17/2024 18:40:32: [SM]   [0GetClientTeam
L 02
/17/2024 18:40:32: [SM]   [1Line 201d:\Github\Private-Work\L4D2\scripting_1.11\Charger_Collision_patch.sp::ImpactSNDHook
L 02
/17/2024 18:40:32: [SM]   [3StopSound
L 02
/17/2024 18:40:32: [SM]   [4Line 741d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::ResetSound
L 02
/17/2024 18:40:32: [SM]   [5Line 616d:\Github\Private-Work\L4D2\scripting\l4d_heartbeat.sp::Event_Spawned 


Thanks Ill add the check for that however this stopsound call for l4d_heartbeat is out of line should not be triggering this since client is not ingame anyway this plugin should check rather than just calling StopSound.


All times are GMT -4. The time now is 00:20.

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