Raised This Month: $51 Target: $400
 12% 

[L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Venom1777
Junior Member
Join Date: Oct 2019
Old 01-13-2020 , 16:16   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #11

Quote:
Originally Posted by Silvers View Post
I'm placing this here for now because it's untested. Please let me know if it's working or any problems.

Code:
1.2 (13-Jan-2020)
    - Added cvar "l4d2_target_patch_targets" to control which Special Infected cannot target incapped survivors.
    - If used, this will change those specified Special Infected to target the nearest non-incapped survivor.
PHP Code:
l4d2_target_patch_targets "0" //0=Off. Block these Special Infected from targeting incapped players: 1=Smoker, 2=Boomer, 4=Hunter, 8=Spitter, 16=Jockey, 32=Charger, 64=Tank, 127=All. Add numbers together. 
Will it work for L4D1, so that the tank does not attack the incapped players?
Venom1777 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-13-2020 , 16:21   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #12

Quote:
Originally Posted by Venom1777 View Post
Will it work for L4D1, so that the tank does not attack the incapped players?
No. I'll release a standalone plugin for L4D1.

Edit: released: https://forums.alliedmods.net/showthread.php?t=320883
__________________

Last edited by Silvers; 01-13-2020 at 17:22.
Silvers is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 01-13-2020 , 18:25   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #13

Quote:
Originally Posted by Silvers View Post
I'm placing this here for now because it's untested. Please let me know if it's working or any problems.

Code:
1.2 (13-Jan-2020)
    - Added cvar "l4d2_target_patch_targets" to control which Special Infected cannot target incapped survivors.
    - If used, this will change those specified Special Infected to target the nearest non-incapped survivor.
PHP Code:
l4d2_target_patch_targets "0" //0=Off. Block these Special Infected from targeting incapped players: 1=Smoker, 2=Boomer, 4=Hunter, 8=Spitter, 16=Jockey, 32=Charger, 64=Tank, 127=All. Add numbers together. 
sadly this doesn't works :c, it's like the tank doesn't control its arms xd

Last edited by xZk; 01-13-2020 at 20:22.
xZk is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-13-2020 , 19:29   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #14

Quote:
Originally Posted by xZk View Post
sadly this doesn't works :c, it's like the tank doesn't control its arms xd
Which version? Cvars?
__________________
Silvers is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-13-2020 , 19:52   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #15

Have you tried using GetClientsInRange? It's SourceMod's way of accessing PVS. This might be faster than raytracing to every player while still ignoring obviously out-of-sight players.
__________________
Peace-Maker is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 01-13-2020 , 20:25   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #16

Quote:
Originally Posted by Silvers View Post
Which version? Cvars?
v1.2, i tested with:
Code:
l4d2_target_patch_targets 64
l4d2_target_patch_targets 127
xZk is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-14-2020 , 07:19   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #17

Quote:
Originally Posted by Peace-Maker View Post
Have you tried using GetClientsInRange? It's SourceMod's way of accessing PVS. This might be faster than raytracing to every player while still ignoring obviously out-of-sight players.
Thanks I didn't know about this, looks like a good method. I've not really looked at SM 1.10 as I'm still trying to support <= 1.9 instead of having people cry about plugins not working because the L4D community seemingly don't like updating their SM. But I should be forcing people to make the change for performance, new features and security reasons. From now on I'll only support 1.10 and force the change. Edit: I see this function isn't from 1.10 and much older, never seen it before.


Quote:
Originally Posted by xZk View Post
-
I guess the problem is ChooseVictim gets called often, like every frame or every 0.1 seconds. I could add a delay between choosing new victims. This is another reason I wanted to patch instead of detour the function. To allow the game to correctly choose a victim instead of some hackish style workaround as is the current method. With patching I could remove the parts of code ignoring incapped and vomited survivors, but it only worked on the Tank and not the Hunter for some reason, also required multiple patches and potentially affect all SI. So in the end I settled on detouring. The detour method opened up the ability to choose which Special Infected should ignore or target incapped.

Maybe I should add a forward for 3rd party plugins to choose victims themselves.


Edit: updated post #9 with 1.3. Again it's untested:
Code:
1.3 (14-Jan-2020)
    - Added cvar "l4d2_target_patch_wait" to delay between switching targets unless current target is invalid.
    - Now using "GetClientsInRange" to select potentially visible clients. Thanks to "Peace-Maker" for recommending.
__________________

Last edited by Silvers; 01-14-2020 at 08:21.
Silvers is offline
KoMiKoZa
Senior Member
Join Date: Dec 2017
Location: Thy old times.
Old 01-14-2020 , 11:25   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #18

This is such a coop gamechanger and such a wonderful plugin, thanks! Never understood why they had it removed in L4D2.
KoMiKoZa is offline
KoMiKoZa
Senior Member
Join Date: Dec 2017
Location: Thy old times.
Old 01-16-2020 , 10:34   Re: [L4D2] Target Patch - Hunter and Tank (1.1) [13-Jan-2020]
Reply With Quote #19

One thing I've observed (I'm not gonna claim that the reason is this plugin though because I'm 99,9% unsure) is that Tank sometimes disappears after killing a survivor or dying, like instantly. I've also seen that on the Witch and they're both modified to switch targets.

What could be the issue? Is it fixable? Is it a plugin conflict?
KoMiKoZa is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 01-16-2020 , 12:08   Re: [L4D2] Target Patch - Hunter and Tank (1.0) [13-Jan-2020]
Reply With Quote #20

Quote:
Originally Posted by xZk View Post
nice job, but I have a doubt, with this gamedata could the opposite be done ?, prevent tank from attacking incapped players.

if I'm not mistaken I think you should change line 250 for this:
CommandABot could be used to do this...
MasterMind420 is offline
Reply



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 16:22.


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