Raised This Month: $32 Target: $400
 8% 

Solved [L4D2] Tank hits multi players with one punch in Coop?


Post New Thread Reply   
 
Thread Tools Display Modes
Forgetest
Member
Join Date: Aug 2020
Old 05-03-2021 , 15:30   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #21

Quote:
Originally Posted by yzybb View Post
L 05/02/2021 - 17:02:43: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:02:43: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:02:43: [SM] Call stack trace:
L 05/02/2021 - 17:02:43: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:02:43: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:02:43: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:02:43: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged

But any map that can generate tank with buttons will make mistakes. Who can fix this mistake?

@Forgetest @Crasher_3637 @HarryPotter
Pushed an implement to escape such errors. But I actually have no idea why this would happen since map was literally loaded.
Forgetest is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-03-2021 , 15:34   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #22

btw, Forgetest, I made pull request for adding L4D1 linux support (without breaking anything else).
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-03-2021 , 15:37   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #23

Quote:
Originally Posted by Forgetest View Post
Pushed an implement to escape such errors. But I actually have no idea why this would happen since map was literally loaded.
I remember Silvers also implemented a walkaround against this not so long (at least, in the latest plugins).
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 05-04-2021 , 06:14   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #24

I can't help but see a scenario where the patch would fail occasionally. That scenario being with multiple Tanks in play at once where the punches may come consecutively. I know the chances of that happening is slim due to the function being called in different frames but it grows gradually the more Tanks spawn.

Last edited by cravenge; 05-04-2021 at 06:15.
cravenge is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 05-04-2021 , 23:11   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #25

Quote:
Originally Posted by cravenge View Post
I can't help but see a scenario where the patch would fail occasionally. That scenario being with multiple Tanks in play at once where the punches may come consecutively. I know the chances of that happening is slim due to the function being called in different frames but it grows gradually the more Tanks spawn.
The game logic is single-threaded. That means nothing can happen between the end of a function and its post hook. Once a patch is applied, only the post hook can remove it. You don’t have to worry about the patch being removed for one Tank swing while being applied for another because the detours won’t overlap no matter how many Tanks are swinging at the same time.
__________________
Psyk0tik is offline
XYZC
New Member
Join Date: May 2021
Old 05-10-2021 , 20:26   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #26

Quote:
Originally Posted by Forgetest View Post
https://github.com/Target5150/MoYu_S...eep_fist_patch

Plugin packaging done. But didn't test on entire L4D1 and Linux L4D2.
Is it possible to also support hitting multiple targets while one of the targets is incapacitated?

In Survival mode while the tank is pounding on an incapacitated survivor, any other survivors near the punching range would get punched as well, using this plugin it only works if all targets are standing on their feet, if one of the targets is in incapacitated state the tank's punch would only connect with one of the targets (either the standing or the incapacitated target).
XYZC is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 05-11-2021 , 02:54   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #27

Quote:
Originally Posted by XYZC View Post
using this plugin it only works if all targets are standing on their feet, if one of the targets is in incapacitated state the tank's punch would only connect with one of the targets (either the standing or the incapacitated target).
Yea, I noticed that issue. Hope someone can help.
__________________
HarryPotter is offline
Forgetest
Member
Join Date: Aug 2020
Old 08-16-2021 , 06:39   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #28

Quote:
Originally Posted by XYZC View Post
Is it possible to also support hitting multiple targets while one of the targets is incapacitated?

In Survival mode while the tank is pounding on an incapacitated survivor, any other survivors near the punching range would get punched as well, using this plugin it only works if all targets are standing on their feet, if one of the targets is in incapacitated state the tank's punch would only connect with one of the targets (either the standing or the incapacitated target).
I think I successfully addressed this just now.
Unfortunately, it seems I cannot get the detour setup right, so it's a global patch for now.
There are only L4d2 Linux & Windows supports for now, available in the repo. Will add for more when I have time.

Eventually hope that someone could help me with the detour setup, and test it on Windows.

Function prototypes:
Code:
Windows:
  int __usercall sub_103D7C80@<eax>(int a1@<ecx>, int a2@<ebp>, int a3@<edi>, _DWORD *a4@<esi>)

Linux: 
  _DWORD __cdecl CTankClaw::GroundPound(CTankClaw *__hidden this)
  CBaseEntity *__cdecl CTankClaw::GroundPound(CTankClaw *this)
Forgetest is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 08-16-2021 , 08:46   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #29

Quote:
Originally Posted by Forgetest View Post
I think I successfully addressed this just now.
Unfortunately, it seems I cannot get the detour setup right, so it's a global patch for now.
There are only L4d2 Linux & Windows supports for now, available in the repo. Will add for more when I have time.

Eventually hope that someone could help me with the detour setup, and test it on Windows.

Function prototypes:
Code:
Windows:
  int __usercall sub_103D7C80@<eax>(int a1@<ecx>, int a2@<ebp>, int a3@<edi>, _DWORD *a4@<esi>)

Linux: 
  _DWORD __cdecl CTankClaw::GroundPound(CTankClaw *__hidden this)
  CBaseEntity *__cdecl CTankClaw::GroundPound(CTankClaw *this)
PHP Code:
"Games"
{
    
"left4dead2"
    
{
        
"Functions"
        
{
            
"CTankClaw::GroundPound"
            
{
                
"signature"        "CTankClaw::GroundPound"
                "callconv"        "thiscall"
                "return"        "void"
                "this"            "entity"
            
}
        }

        
"Signatures"
        
{
            
/* CTankClaw::GroundPound(CTankClaw *__hidden this) */
            
"CTankClaw::GroundPound"
            
{
                
"library"    "server"
                "linux"        "@_ZN9CTankClaw11GroundPoundEv"
                "windows"    "\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\x81\xEC\xA8\x01\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x56\x57"
                        
/* 53 8B DC 83 EC 08 83 E4 F0 83 C4 04 55 8B 6B 04 89 6C 24 04 8B EC 81 EC A8 01 00 00 A1 ? ? ? ? 33 C5 89 45 FC 56 57 */
            
}
        }
    }

The test on Windows is normal
sorallll is offline
Forgetest
Member
Join Date: Aug 2020
Old 08-16-2021 , 17:39   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #30

Quote:
Originally Posted by sorallll View Post
PHP Code:
"Games"
{
    
"left4dead2"
    
{
        
"Functions"
        
{
            
"CTankClaw::GroundPound"
            
{
                
"signature"        "CTankClaw::GroundPound"
                "callconv"        "thiscall"
                "return"        "void"
                "this"            "entity"
            
}
        }

        
"Signatures"
        
{
            
/* CTankClaw::GroundPound(CTankClaw *__hidden this) */
            
"CTankClaw::GroundPound"
            
{
                
"library"    "server"
                "linux"        "@_ZN9CTankClaw11GroundPoundEv"
                "windows"    "\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\x81\xEC\xA8\x01\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x56\x57"
                        
/* 53 8B DC 83 EC 08 83 E4 F0 83 C4 04 55 8B 6B 04 89 6C 24 04 8B EC 81 EC A8 01 00 00 A1 ? ? ? ? 33 C5 89 45 FC 56 57 */
            
}
        }
    }

The test on Windows is normal
Thanks, I was initially sticking to the return type being "cbaseentity" as IDA told me so. Well, can never just accept it blindly.

And I wouldn't be able to implement the fix as well as support for both Windows and Linux without plenties of help from @Psyk0tik. Thank you so much!

Plugin is now updated with the feature mentioned above covering both platforms.

However, unfortunately it might not be possible to test it myself either on L4D1, or on Windows especially. Hopefully someone can help me with this, much appreciated.

Last edited by Forgetest; 08-16-2021 at 17:43.
Forgetest 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 04:26.


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