Left 4 Dead 2

Left 4 Dead 2

291 ratings
Bots Throw Grenades (Vscript)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player, Co-op
Weapons: Throwable
File Size
Posted
Updated
28.911 KB
5 Mar @ 4:06pm
15 Jun @ 9:45am
6 Change Notes ( view )

Subscribe to download
Bots Throw Grenades (Vscript)

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
46 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.
  • Value no. 2 & 3 of "Use Pipe Bomb" are pretty useless on normal pipebomb because normal pipebomb only deals small damage on tank & special infected so it's a waste of pipebomb because bots will throw it at tank & it has high chance to miss because it takes time to explode. If you use normal pipe bomb, set "Use Pipe Bomb" to 1. You can set it to 2 or 3 only if you use custom pipebomb mods that can deal damage to tank, like "Saiyan Pipebomb", or "Laser Pipebomb" or other custom pipebomb mods.
85 Comments
kurochama  [author] 6 Jul @ 12:43am 
I think you can disable certain grenades on L4B2 & this mod. Both can't be active at the same time so you need to choose which one you need to disable (examples: You can use pipebomb from this mod, & then use L4B2 for the rest of grenades by setting "UsePipeBomb 1", "UseMolotov 0" & "UseVomitjar 0" on the cfg of this mod)
Thunder Wolf VX 5 Jul @ 11:13pm 
So I ran into a slight hiccup here that probably I am the only moron who cares about such a small issue, but here it is.
Long story short, Bots Throw Grenades overwrites the bot preferences I set up in Left 4 Bots 2, and I don't know if there's a way around that. I know, it's dumb, but I'd prefer to have Duke Nukem be the only one who uses his Pipe Bombs.
kurochama  [author] 15 Jun @ 9:48am 
@ SP-Calamitas , I updated the pipe bomb part. Now you can set the value to 2 or 3 to make bots throw pipebomb at tank. This is only useful on custom pipebomb mods, so for normal pipebomb, the best value is 1.
kurochama  [author] 15 Jun @ 12:48am 
@TBK Duy , I'm not sure about that. Defib mechanisms are slightly more complicated than grenades, as I also need to make bots exclude medkits when carrying defib, so they won't keep running to a medkit when seeing it.

@Јамеѕ , that crash never happened to me though I also use more than 50 vscript mods when playing with this mod. & that "SCRIPT PERF WARNING" can be ignored, as it's normal for that to show up on console when using vscript mods.
Јамеѕ 14 Jun @ 10:11pm 
Okay, this crashed my game (I use other Vscripts if that's any help).
Јамеѕ 14 Jun @ 9:42pm 
Is there anyway to stop "SCRIPT PERF WARNING --- "GrenadierBotsScript" ran long at 4.107131ms" being spammed in the console?
Јамеѕ 14 Jun @ 9:18pm 
Nevermind, found it.
TBK Duy 13 Jun @ 10:34pm 
Wonder if there's a defib bots standalone version, I don't want to install L4B2 because that's kinda messy mod for now
SP-Calamitas 4 Jun @ 4:02am 
yeah but i use some mods that make the pipbomb into a tank counter (staggers him). if you could add it as a optional feature it would be great, as a type of pseudo-compatibility with those mods. if its too much work then just ignore my request
kurochama  [author] 3 Jun @ 6:38am 
@SP-Calamitas , pipebomb doesn't deal much damage on special & tank though, & it's more like they'll waste the pipebomb because tank can avoid it. Unlike bile bomb that explodes when hit, pipebomb takes few seconds to explode.