Left 4 Dead 2

Left 4 Dead 2

229 ratings
Bots Throw Grenades (Vscript)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player, Co-op
Weapons: Throwable
File Size
Posted
Updated
27.402 KB
Mar 5 @ 4:06pm
Apr 11 @ 12:15am
5 Change Notes ( view )

Subscribe to download
Bots Throw Grenades (Vscript)

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
39 items
Description
This was originally a feature from "Cruel Bots", but as there's a request on gamemaps, so I made a standalone version. This mod allows bots to throw grenades, in simple ways.

Q: "How is it compared to the grenade feature on Left 4 Bots?"
A: "This mod is way simpler, like there are only 5 features to set. & bot's throwing direction follows where bots are looking at when they're preparing the grenades. More info will be explained below."


List of features available on "bots throw grenades.txt" cfg file:
  1. Grenadier Bots: When enabled, bots will be able to throw grenades.

  2. MobSize To Throw Grenade: How many zombies in a group until bots prepare to throw grenades. Default= 6 (6 zombies in a group). Max= no limit.

  3. Use Pipe Bomb: When enabled, bots will pick & use pipe bomb.

  4. Use Molotov: When enabled, bots will pick & use molotov. The value affects the molotov targets (common only/ tank only/ common + tank).

  5. Use Vomitjar: Same as molotov, but for bile bomb.

  6. Grenade Auto Give: Enabled by default. Bots will give a grenade to a survivor player they're looking at when that player doesn't have a grenade.


Simple mechanisms of this mod:
  • When "Grenadier Bots" is set to 1 & certain features of grenades are set to 1 or above, bots will start to pick grenades,

  • Bots will pick a grenade automatically when they walk close to it.

  • Shove a bot near grenade spot to force him to pick a grenade (in case if he refuses to pick).

  • To receive a grenade from a bot, there are 2 ways:
    1. Keep looking at a bot until he gives you one (if "Grenade Auto Give" is enabled).
    2. Shove him to take the grenade immediately.

  • Bots will throw grenades at a zombie they're looking at a zombie in medium range (around 4x melee range ahead).

  • Bots won't throw molotov at tank that's already on fire, but they'll still throw bile at the tank even if he's on fire.

  • Bots only throw grenades if certain conditions are met. The conditions are controlled by "MobSize To Throw Grenade" & the value on certain grenade features. Examples: If "Use Molotov" is set to 2, bots only throw molotov on a tank. If it's set to 1, they only throw at common infected. If "MobSize To Throw Grenade" is set to 10, they only throw a molotov at common infected when they detect 10 or more common infected at where they're looking.


Q: "Does this mod solve a problem about bots throwing molotov under your feet?"
A: "I'm not sure about that, but this should solve it because bot's throwing target is a zombie they're looking at, not the ground. But it also means than the molotov throw can miss & burn what behind the zombies instead if the zombies are too close. At least that won't burn your feet, as long as you're not near the zombie that the bot is throwing molotov at, hehehe..."


NOTES:
  • A video preview will be added later (maybe after ugc server bug on my Workshop Manager is fixed, as I used Crowbar Tool temporarily).
  • A known bug: Sometimes bots refuse to pick grenades. If this happens, just shove the bots when they're standing near a grenade on the ground or table.
73 Comments
kurochama  [author] Apr 19 @ 5:41pm 
@trionix742 , set the "Use Molotov" to 1 or 3. "1" is only for common infected, while "3" is for common & tank.
trionix742 Apr 19 @ 3:54pm 
The mod is very good, I only have one problem: the bots don't want to throw Molotov cocktails at the common infected. How do I configure it? Help!
kurochama  [author] Apr 14 @ 9:39am 
@Brian , you can try "Competitive Bots". It's also as good as "Improved Bots", but it's also newer & the last update wasn't that long compared to "Improved Bots". People usually use combination of "Competitive Bots" + "Left 4 Bots".
Brian Apr 14 @ 7:39am 
@kurochama, There is that possibility. There may be a compatibility issue with the Improved Bots mod by Ziggy. That is an older mod that hasn't been updated for years. I remember looking at the console. I didn't see any conflicts with that mod. The Mod Manager didn't show Improved Bots and Bots Throw Grenades as conflicting mods.
kurochama  [author] Apr 14 @ 7:25am 
@Brian , I set "Auto Give" with a condition in which it's only active when bots are looking at a survivor player that has no grenade, & when there's no survivor player or the player already has a grenade, "Auto Give" will stop checking. & the your problem with bots stopping shooting at anything is also strange. Last time I tested with "Left 4 Bots 2" in the first map of Hard Rain, they could still shoot zombies & throw grenades. I'm not sure about other bot mods, as I usually used "Left 4 Bots 1/ 2" to test because it's one of most frequently used bot mods. If your bot problem happened when you use some bot mods, you can try to disable the bot mods first, to check if the problem still happens or not.
Brian Apr 14 @ 6:38am 
@kurochama, You may never experience that problem. It may depend on how powerful your computer's processor is. I have a feeling the Auto-Give feature in this mod is using more of the computer's processing. I've never tried playing a custom map with that disabled. I remember playing the finale in Infected City. The bot players quit shooting at anything for a while. I had never experienced a problem like that until I installed this mod. A problem like that seems like it would be caused by a lack of processing power.
kurochama  [author] Apr 14 @ 12:28am 
@Brian , that "GrenadierBotsScript" is not an error, but it's a script to make bots throw grenades. You can ignore that. As for your problem of bots shooting nonstop, it's strange because I tested with only this mod & Left 4 Bots/ Left 4 Bots 2 enabled but that problem never happened to me.
Brian Apr 13 @ 9:21pm 
@kurochama, I do get a weird problem after I have this mod enabled for a while. The problem doesn't start immediately. One of the bot players will start shooting continuously until that bot player uses all of his ammo. I've never noticed the problem in a standard campaign like Dead Center. It seems to happen in certain custom maps. I was playing Left in Prypiat. I was at the place to be rescued. One bot player could not stop shooting. There were no zombies in sight. I experienced the same problem in the fourth map of Infected City.
Brian Apr 13 @ 6:37pm 
@kurochama, I disabled Ten Inventory Slots, Improved Bots, and every script mod that I had enabled except for your mod that allows the bot players to use grenades. I still saw those console errors. The error messages are white. They are not red.
Brian Apr 13 @ 6:19pm 
@kurochama, I do see a lot of console errors when I have this mod enabled. The mod sems to work fine, but there are dozens and dozens of these errors in the console. I have Improved Bots by Ziggy and Ten Inventory Slots by Sabeagle enabled. I just wanted to know what you think of these console errors. The errors look like this:
SCRIPT PERF WARNING --- "GrenadierBotsScript" ran long at 1.579484ms
SCRIPT PERF WARNING --- "GrenadierBotsScript" ran long at 1.957208ms
SCRIPT PERF WARNING --- "GrenadierBotsScript" ran long at 1.708407ms
SCRIPT PERF WARNING --- "GrenadierBotsScript" ran long at 1.606241ms