Left 4 Dead 2

Left 4 Dead 2

Bots Throw Grenades (Vscript)
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.
SP-Calamitas 3 Jun @ 6:03am 
please add a function to throw pipbomb at tank
Froze 5 May @ 4:04pm 
yeah that happened haha
thanks for the info
kurochama  [author] 5 May @ 12:01pm 
@Froze , no. Only the host needs this mod. But try to set "sv_consistency 0" just in case to prevent your friends from being disconnected because of some mods.
Froze 5 May @ 9:21am 
if i host the local server do my friends need to also sub to this?
kurochama  [author] 19 Apr @ 5:41pm 
@trionix742 , set the "Use Molotov" to 1 or 3. "1" is only for common infected, while "3" is for common & tank.
trionix742 19 Apr @ 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] 14 Apr @ 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 14 Apr @ 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] 14 Apr @ 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 14 Apr @ 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] 14 Apr @ 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 13 Apr @ 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 13 Apr @ 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 13 Apr @ 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
kurochama  [author] 12 Apr @ 9:31am 
@Brian , I think I mentioned that random bug on the "Notes". Yeah, sometimes one bot refuses to pick a grenade. All you need to do is making them stand close to the grenade & then shoving them.
As for a feature to give a grenade to a bot, I didn't make it because people usually use this mod together with other bot mod or mods that allow to give items, like "Left 4 Bots" by smilzo, "Item Giver" by Nescius, or other item-giving mods. So you can use the mods I mentioned instead to give bots your grenade.
Brian 12 Apr @ 9:09am 
@kurochama, I never really thought about the problem that giving a grenade to a bot player might create until now. I'm sure the bot player would immediately give the grenade back to you. That's what they do with pills and adrenaline if you have less than 50 health points. They will not keep the pills or adrenaline.
Brian 12 Apr @ 7:59am 
@kurochama, I know the bots can give grenades to a human player. Is it possible for a human player to give a grenade to a bot player? The reason I ask is because there are some places where the bots will not pick up grenades regardless of how many times I walk near those places. That happens in standard campaigns like Dead Center.
kurochama  [author] 12 Apr @ 7:34am 
@Brian , if "Use Molotov" is set to 2 & "Use Vomitjar" is set to 2, bots will throw molotov or bile at tank only.
Brian 12 Apr @ 5:32am 
@kurochama, I appreciate your advice. I was able to edit Ten Inventory Slots with Notepad++. Each item in that mod uses a bucket number. I had to make all three grenade types use "bucket" "2". Then, I had a problem with the defibrillator. The defib unit was originally using bucket 2. I had to make the defib unit use bucket 6,7, or 8. Now, there are eight inventory slots, but at least it's compatible with your mod. Something I've noticed about the bot players is that they can really only use pipe bombs effectively. They often throw molotovs and bile jars when they are near too many zombies. I only let them throw molotovs and bile jars at Tanks.
kurochama  [author] 11 Apr @ 10:44pm 
@Brian , yes, unfortunately bots only pick grenades if the grenade slot is not changed (slot 4). Probably you can edit that "Ten Inventory Slots" to make it so grenade slot remains unchanged, so bots can still use it.
Brian 11 Apr @ 5:21pm 
I really like this mod, but it doesn't work with Ten Inventory Slots by Sablegle. The bots will pick up grenades, but they won't throw them. The grenades must be going into a slot that the bots can't use. I suppose a person would have to make a completely different version of this mod to make it compatible with Ten Inventory Slots. Ten Inventory Slots is good for carrying extra items like Explosive ammo, Incendiary ammo, and a Defibrillator.
kurochama  [author] 11 Apr @ 2:12am 
@Stvper , you're welcome. I also thank you for the bug report so I could pinpoint the root of the cause.
Stvper 11 Apr @ 1:21am 
@kurochama,Thank you so much for your efforts. After testing, the issue has largely disappeared. Although during intense grenade spamming, I occasionally retrieve my original grenade instead of a successful swap, this is a minor issue and rarely happens in actual combat scenarios, so the problem should be considered resolved.
kurochama  [author] 11 Apr @ 12:22am 
@Stvper , I updated & changed the grenade auto pickup timer to 1 second. This should prevent bots from picking the grenades they drop on grenade swap mechanisms on other mods.
kurochama  [author] 10 Apr @ 10:59pm 
@Stvper , probably it's related to the grenade auto pickup speed. Bots pick grenades in less than 1 second, while the grenade exchange on L4B1 & L4B1 probably require the grenade to be dropped first before it's transferred to other survivor. Probably I can increase the auto pickup timer to 1 second later, but this will make bots take some time to pick grenades.

@Poolsup (TH) , I also regularly tested in custom campaigns especially the new ones, like Vox Aeterna, Pasay City etc, but I didn't find the error on console. That's why I asked you to copy-paste the error on console here so I could check it.
Poolsup (TH) 10 Apr @ 10:06pm 
in some map even custom
Poolsup (TH) 10 Apr @ 10:06pm 
on start the bug error script show on console
Stvper 10 Apr @ 7:58pm 
I want to note that this issue existed even prior to your update of the Grenade Auto Give feature. The problem was already present before the modification.
Stvper 10 Apr @ 7:52pm 
@kurochama,I have already tried that, but there is still a chance of triggering this issue even after setting 'Grenade Auto Give' to 0. The problem occasionally persists under specific conditions.
kurochama  [author] 10 Apr @ 5:13pm 
@Stvper , if that's the case, you can disable "Grenade Auto Give". This feature makes bots give their grenades to players. If you use L4B1 or L4B2, you need to set "Grenade Auto Give" to 0 because L4B1 & L4B2 already have this feature on bots if I'm not mistaken.
Stvper 10 Apr @ 5:05pm 
In my testing, when using this mod with L4B2 , there are some issues that occur. When frequently swapping grenades with bots, there's a chance the player ends up with no grenades, causing bots to repeatedly attempt giving grenades without success. For example: when I swap grenades with a bot (I have a Molotov, the bot has a pipe bomb) using right-click, after the exchange my Molotov goes to the bot. The bot keeps saying "Here, take this" and repeatedly tries to give me grenades but fails. I haven't tested what issues might arise when swapping grenades with real players in multiplayer mode, so there are indeed some potential issues when using these two mods together.
kurochama  [author] 10 Apr @ 1:05pm 
@Poolsup (TH) , I checked just few minutes ago by using only this mod + Left 4 Bots, & then this mod + Left 4 Bots 2, & I found no error on console on both tests. Left 4 Bots was also working normally as I could still see the admin notification coming out from Left 4 Bots. Probably you can check some of your mods as probably one or some of them might cause some conflicts.
kurochama  [author] 10 Apr @ 12:19pm 
@Poolsup (TH) , that shouldn't possible, as the scripts I wrote are completely different & don't intervene any bot mods. Even I often used it with my bot mods & there's no problem either. That's why I asked about what error on the console, as it will be easier to check the problem from the error on the console.
Poolsup (TH) 10 Apr @ 11:40am 
the addon break each other on left 4 bot version 1 and 2
Poolsup (TH) 10 Apr @ 11:39am 
bot no grenade on it is bug going on
kurochama  [author] 10 Apr @ 10:30am 
@Poolsup (TH) , what error script in console? Could you write it here so I can take a look at it? I never encountered it so far as they threw grenades normally when I played.
Poolsup (TH) 10 Apr @ 9:33am 
but the bug going on the error script show up in console commands
RogerDatSoldier 15 Mar @ 2:22am 
@kurochama Thanks for the fast update! I'll go and check it right now
kurochama  [author] 14 Mar @ 12:17pm 
@RogerDatSoldier , there's a new feature, "Grenade Auto Give". You can disable bot's grenade auto give when looking at player with this.
RogerDatSoldier 14 Mar @ 10:32am 
@kurochama Alright, thank you for the update on that friendo