Raised This Month: $ Target: $400
 0% 

[L4D/L4D2] Grenade Throwing Bots


Post New Thread Reply   
 
Thread Tools Display Modes
Tonblader
Senior Member
Join Date: Jul 2011
Location: Peru
Old 10-21-2020 , 18:12   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #151

Quote:
Originally Posted by Crasher_3637 View Post
Well, here you go. I haven't tested it yet, but I basically copied the entire code for the L4D2 version and just removed any references to the bile bomb.
L 10/21/2020 - 17:09:26: [SM] Exception reported: Client 2 is not in game
L 10/21/2020 - 17:09:26: [SM] Blaming: functions\grenade_throwing_bots-l4d2.smx
L 10/21/2020 - 17:09:26: [SM] Call stack trace:
L 10/21/2020 - 17:09:26: [SM] [0] GetClientEyePosition
L 10/21/2020 - 17:09:26: [SM] [1] Line 298, /home/forums/content/files/1/8/1/1/6/6/184193.attach::TankDelayThrow
Tonblader is offline
MasterMe
Member
Join Date: Mar 2010
Location: Netherlands
Old 10-22-2020 , 19:55   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #152

[L4D(2)] Grenade Throwing Bots (1.9) [2020-10-23]

I have updated the version posted by Crasher_3637 above and made the following changes:
  • Support L4D1 and L4D2 in a single plugin.
  • Add cvar to specify if bots are allowed to use bile (default YES).
  • Add cvar to specify if bots are allowed to use molotov (default NO).
  • Add cvar to specify if bots are allowed to use pipe (default YES).
  • Add cvar to specify if bots can target (throw grenades at) tank (default NO).

The reason molotov and tank targeting are disabled by default is because these are too dangerous and unreliable on harder difficulty, such as advanced or expert. It happened to me that a bot really messed up a molotov throw in realism expert, killing the entire team. If you play on easier difficulties, or versus, enabling molotov and tank targeting should be ok.

New cvars, see cfg/sourcemod/l4d_grenade_throwing_bots.cfg (for L4D1, the l4d_gtb_allowbile will not be created, plugin autocreates cfg file on first load.)

Code:
// Allow bots to use bile. 0=Off, 1=On.
// -
// Default: "1"
l4d_gtb_allowbile "1"

// Allow bots to use molotov. 0=Off, 1=On.
// -
// Default: "0"
l4d_gtb_allowmolotov "0"

// Allow bots to use pipe. 0=Off, 1=On.
// -
// Default: "1"
l4d_gtb_allowpipe "1"

// Target tank with bile (L4D2) or molotov, if grenade type is allowed. 0=Off, 1=On.
// -
// Default: "0"
l4d_gtb_targettank "0"
Requires Left 4 Dhooks, just like previous versions.

Tested in L4D2 without any issues, can someone test on L4D1 and say if it works properly?

The plugin has been renamed, make sure to delete the old one!
Attached Files
File Type: sp Get Plugin or Get Source (l4d_grenade_throwing_bots.sp - 722 views - 16.8 KB)
File Type: smx l4d_grenade_throwing_bots.smx (11.4 KB, 829 views)
__________________

Last edited by MasterMe; 10-22-2020 at 20:05. Reason: Add compiled version for convenience (sourcemod 1.10, Linux), fix typo.
MasterMe is offline
deedeedee
Junior Member
Join Date: Oct 2020
Old 10-23-2020 , 16:43   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #153

Quote:
Originally Posted by MasterMe View Post
[L4D(2)] Grenade Throwing Bots (1.9) [2020-10-23]

I have updated the version posted by Crasher_3637 above and made the following changes:
  • Support L4D1 and L4D2 in a single plugin.
  • Add cvar to specify if bots are allowed to use bile (default YES).
  • Add cvar to specify if bots are allowed to use molotov (default NO).
  • Add cvar to specify if bots are allowed to use pipe (default YES).
  • Add cvar to specify if bots can target (throw grenades at) tank (default NO).

The reason molotov and tank targeting are disabled by default is because these are too dangerous and unreliable on harder difficulty, such as advanced or expert. It happened to me that a bot really messed up a molotov throw in realism expert, killing the entire team. If you play on easier difficulties, or versus, enabling molotov and tank targeting should be ok.

New cvars, see cfg/sourcemod/l4d_grenade_throwing_bots.cfg (for L4D1, the l4d_gtb_allowbile will not be created, plugin autocreates cfg file on first load.)

Code:
// Allow bots to use bile. 0=Off, 1=On.
// -
// Default: "1"
l4d_gtb_allowbile "1"

// Allow bots to use molotov. 0=Off, 1=On.
// -
// Default: "0"
l4d_gtb_allowmolotov "0"

// Allow bots to use pipe. 0=Off, 1=On.
// -
// Default: "1"
l4d_gtb_allowpipe "1"

// Target tank with bile (L4D2) or molotov, if grenade type is allowed. 0=Off, 1=On.
// -
// Default: "0"
l4d_gtb_targettank "0"
Requires Left 4 Dhooks, just like previous versions.

Tested in L4D2 without any issues, can someone test on L4D1 and say if it works properly?

The plugin has been renamed, make sure to delete the old one!
Gave this a go on L4D1, bots do basically nothing now. Whenever there's a tank or horde, they don't throw any molotovs nor pipebombs.
deedeedee is offline
MasterMe
Member
Join Date: Mar 2010
Location: Netherlands
Old 10-23-2020 , 16:55   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #154

Quote:
Originally Posted by deedeedee View Post
Gave this a go on L4D1, bots do basically nothing now. Whenever there's a tank or horde, they don't throw any molotovs nor pipebombs.
Strange, I was very careful and diffed between versions many times to make sure things are set properly depending on the game.

Did the separate L4D1 version posted by Crasher_3637 above work for you? https://forums.alliedmods.net/showpo...&postcount=141

Can you run "sm_l4dhooks_detours" in the server and post the output here?

Same results with all the cvars set to 1?

Thanks.
__________________
MasterMe is offline
deedeedee
Junior Member
Join Date: Oct 2020
Old 10-23-2020 , 17:11   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #155

Quote:
Originally Posted by MasterMe View Post
Strange, I was very careful and diffed between versions many times to make sure things are set properly depending on the game.

Did the separate L4D1 version posted by Crasher_3637 above work for you? https://forums.alliedmods.net/showpo...&postcount=141

Can you run "sm_l4dhooks_detours" in the server and post the output here?

Same results with all the cvars set to 1?

Thanks.
Tried running the command, says it unknown. I do have L4DHooks installed and put in the right files, so I'm not sure what to do. Crasher's plugin was working before, but it suddenly stopped working a few days ago when I last used it.
deedeedee is offline
MasterMe
Member
Join Date: Mar 2010
Location: Netherlands
Old 10-23-2020 , 19:17   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #156

Quote:
Originally Posted by deedeedee View Post
Tried running the command, says it unknown. I do have L4DHooks installed and put in the right files, so I'm not sure what to do. Crasher's plugin was working before, but it suddenly stopped working a few days ago when I last used it.
Can you verify you have the following? Perhaps try reinstalling or updating these.

After this, running "sm_l4dhooks_detours" in the server console has to produce output, and it should include something for the grenade throwing plugin.
__________________
MasterMe is offline
SombiMan
Junior Member
Join Date: Jun 2020
Old 10-24-2020 , 02:17   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #157

@deedeedee I tried using your version. The bots throw pipebombs too early that there's barely anyone they kill, one time a bot threw a pipebomb after I've already killed most zombies with a gasoline, and two bots threw pipebombs at the same time. I didn't encounter any of these when I was using silvers's version.
SombiMan is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 10-24-2020 , 03:12   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #158

Aight, seeing this as mostly requested to be updated, I'll update the plugin when I have time.
cravenge is offline
MasterMe
Member
Join Date: Mar 2010
Location: Netherlands
Old 10-24-2020 , 06:41   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #159

Quote:
Originally Posted by SombiMan View Post
@deedeedee I tried using your version ... I didn't encounter any of these when I was using silvers's version.
I assume you mean my version from https://forums.alliedmods.net/showpo...&postcount=152 and Silvers' version from https://forums.alliedmods.net/showpo...&postcount=123.

Quote:
Originally Posted by SombiMan View Post
The bots throw pipebombs too early that there's barely anyone they kill
I diffed the versions, and indeed there is a timing difference. The original plugin by cravenge and Silvers' version have the timer set to 5 seconds for horde events. The later version by Crasher_3637 sets this to 3 seconds before throwing, and I used that version as a base.

This is the only significant difference I can find, and I agree 3 seconds is often too short based upon my own playing with the plugin. Maybe Crasher had a reason for changing this though. Can you try changing the timer from 3.0 to 5.0 on line 542 of my plugin and see how that feels for you?

Code:
CreateTimer(3.0, CommonDelayThrow, GetClientUserId(lastChosen[2]), TIMER_FLAG_NO_MAPCHANGE);
Quote:
Originally Posted by SombiMan View Post
one time a bot threw a pipebomb after I've already killed most zombies with a gasoline
For all versions I checked the plugin simply hooks on the L4D_OnSpawnMob() event and throws a grenade. This means the bots are "dumb". They will always throw a grenade once they decide to. They don't know (or check) if commons are dead or if you use a gascan or grenade yourself. So this could also happen in any other version.

This may be why Crasher made them throw early, to make sure a player and bot don't throw at the same time?

Quote:
Originally Posted by SombiMan View Post
two bots threw pipebombs at the same time
Are you sure you disabled or removed the old version of the plugin? The filename changed for the version I posted, to make it consistent for the new cvars.

I think it may be possible for this to trigger in all versions. There is a trigger on the spawning of a horde and a trigger for when bots are being hurt and there are a lot of commons (as far as I can see). And it appears these don't check for each other.

So if bots are being attacked by commons and a horde spawns at the same time, both triggers may activate together. This means two grenades will be thrown with 1-3 seconds between them, depending on the plugin version. This is not unique to the version I posted though.

I have not seen this bug trigger in my own playing though, a duplicate plugin is way more likely to cause this. Maybe it's a realism feature, sometimes real players throw grenades at the same time too!
__________________
MasterMe is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 10-24-2020 , 06:53   Re: [L4D/L4D2] Grenade Throwing Bots
Reply With Quote #160

Quote:
Originally Posted by MasterMe View Post
The later version by Crasher_3637 sets this to 3 seconds before throwing, and I used that version as a base.
Quote:
Originally Posted by MasterMe View Post
Maybe Crasher had a reason for changing this though.
Quote:
Originally Posted by MasterMe View Post
This may be why Crasher made them throw early, to make sure a player and bot don't throw at the same time?
You are correct. Making them throw two seconds earlier helped to compensate for the bots' "dumbness" because they would often just stand there with a grenade in their hand while they get swarmed. By the time they would finally throw one, another bot would throw one as well. Plus, most of their health would already be gone on higher difficulties.

Quote:
Originally Posted by cravenge View Post
Aight, seeing this as mostly requested to be updated, I'll update the plugin when I have time.
I await your update with anticipation.
__________________
Psyk0tik 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 20:01.


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