[L4D2] Tank hits multi players with one punch in Coop?
In L4D coop/realism mode, each time tank can hit only one player with a punch.
But in versus/survival, tank can hit multi players with a punch. So I want to ask is it possible that tank can hit multi players with one punch in coop/realism mode. Edit: Thanks Forgetest and everyone, plugin here |
Re: [L4D2] Tank hits multi players with one punch in Coop?
You can detour "CTankClaw::SweepFist" and patch this line:
L4D1: PHP Code:
PHP Code:
PHP Code:
PHP Code:
1a. (L4D1) Search "ValveBiped.Bip01_R_Hand" string which will lead you to "CTankClaw::DoSwing". 1b. (L4D2) Search "ValveBiped.Bip01_L_Hand" string which will lead you to "CTankClaw::DoSwing". 2. Look for "CTankClaw::SweepFist" as the very last function call. I recommend detouring "CTankClaw::SweepFist" with a pre and post hook so you can patch in pre and revert back in post. Seeing as how "CTankClaw::DoSwing" can be called in multiple cases, it's best to remove the patch after the swing. (Not 100% sure on this so you decide.) |
Re: [L4D2] Tank hits multi players with one punch in Coop?
Can I know how to patch those values?
Started from straight reading a single byte from signature HasPlayerControlledZombies, and it failed with crashing the server. I'm confused as there seems to be no clue to find out whether it was missing offset to the value, or just made no sense to do so. |
Re: [L4D2] Tank hits multi players with one punch in Coop?
Quote:
|
Re: [L4D2] Tank hits multi players with one punch in Coop?
The reason I recommend detouring the function first and patching those lines within the detour is to give more flexibility. If HP wants a global patch, then yeah, there’s no need for a detour, just patch it right on OnPluginStart() and call it a day. But if he wants to apply the patch only in certain scenarios, then the detour allows him to do just that.
I also stated that I’m not entirely sure if those lines can affect other scenarios that we’re not thinking of right now aside from when hitting all survivors within range of the swing, hence why I think it’s best to take the safe route from the start and just patch those lines when we actually need to. |
Re: [L4D2] Tank hits multi players with one punch in Coop?
Quote:
|
Re: [L4D2] Tank hits multi players with one punch in Coop?
No, the detour method is safe. It's what you do inside the detour that would determine the server's vulnerability to crashes.
Here's a list of functions I've detoured in Mutant Tanks that are called way more often than "CTankClaw::SweepFist": CTerrorGameMovement::DoJump - called for each player which can get very spammy on servers with high gravity. CEnvRockLauncher::LaunchCurrentDir - can be called very often since one of the Tank abilities I coded spawns 1-2 rocks every second. CTankClaw::OnPlayerHit - called each time a player gets hit; basically "CTankClaw::SweepFist" x number of survivors within range of the swing; so this would be more unsafe than detouring "CTankClaw::SweepFist" if anything. CTerrorWeapon::SecondaryAttack - called very often considering my server doesn't have shove penalty and in some cases, the shove rate is increased. CTerrorPlayer::StartReviving - can be spammed by players trolling their teammates. CTankRock::Create - called after "CEnvRockLauncher::LaunchCurrentDir" which can be very often since one of the Tank abilities I coded spawns 1-2 rocks every second. CTerrorPlayer::DoAnimationEvent - called multiple times because of all the different animations that each survivor can have even when just standing completely still. CTerrorGun::FireBullet - self-explanatory CTerrorMeleeWeapon::SecondaryAttack - called very often considering my server doesn't have shove penalty and in some cases, the shove rate is increased. CBaseBackpackItem::StartAction - called each time an action starts which can get spammy when players cancel their actions. CTerrorMeleeWeapon::TestMeleeSwingCollision - called very often depending on the swing rate of each player. For context, I've had these detours for months now and my server hasn't crashed from any of these detours nor have I experienced any performance issues related to them even during high traffic. |
Re: [L4D2] Tank hits multi players with one punch in Coop?
Quote:
Keep in mind that I haven't tested this out thoroughly. I've only watched the Tank beat up all survivors at the same time in a corner. I've only tested on Windows so far for both games. Here's the relevant gamedata info you will need: Detour: PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: [L4D2] Tank hits multi players with one punch in Coop?
I do recommend using sourcescramble crasher if you are applying and removing a patch within a detour.
https://forums.alliedmods.net/showthread.php?t=317175 |
Re: [L4D2] Tank hits multi players with one punch in Coop?
Quote:
|
All times are GMT -4. The time now is 06:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.