Left 4 Dead 2

Left 4 Dead 2

112 ratings
Bot Healing Prevention System
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player, Co-op
Items: Medkit, Pills
File Size
Posted
Updated
165.888 KB
27 Dec, 2023 @ 8:21am
24 Aug @ 10:55am
13 Change Notes ( view )

Subscribe to download
Bot Healing Prevention System

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
61 items
Description
As the title said, this mod prevents bots from healing too early by using a special feature "Virtual Inventory". What is "Virtual Inventory"? "Virtual Inventory" is a cfg file used to store data in game.

As bot's healing behavior is kind of hardcoded, & no matter how many times you stop bots from healing by using bot commands or disabling bot's buttons, or quickly switching to other items when they want to heal, bots will insist on switching to first aid kit or pills to heal. That's why, the "Virtual Inventory" was implemented to "hide" bot's first aid kit, pills & adrenaline if they want to use them too early. So if a bot tries to heal himself or other bot, he'll lose the first aid kit & the first aid kit is stored in the "Virtual Inventory". Once bots meet the conditions of healing, anytime they reload their guns or shove any objects, they'll automatically pick the first aid kits & pills stored in "Virtual Inventory". The items stored in "Virtual Inventory" won't disappear unless a player disconnects or starts a new campaign.

Here are some features available in "bot healing prevention cfg.txt" file:
- Healing Prevention Mode: This controls whether bots are prevented only when trying to heal themselves/ other bots, or when trying to heal other players.

- Heal Only In Black White: This controls whether bots are allowed to heal only when they're in white & black or not.

- Medic Use Prevention: The value of this feature affects how much health left until bots are allowed to heal (Example: value no 30 allows bots to heal only when their health bar is 30 left).

- Pills Use Prevention: Same as "Medic Use Prevention" but for pills & adrenaline shot.

- *NEW* Virtual Inventory Type: This controls whether bots use personal virtual inventory (default), or shared virtual inventory. Shared virtual inventory will store all bots' healing items in one place.

Some additional features:
- Walking Storage: As bots have ability to store first aid kits, adrenaline & pills when they use them too early, they can store as many items as possible in "Virtual Inventory". So, if bots keep stealing first aid kits & store them all in "Virtual Inventory", just let them do it, as you can take the items by using the next feature below.
- Take item from Virtual Inventory by shoving a bot: If you remember which bot keeps storing items in "Virtual Inventory", you can shove that bot to get items that you don't have (example: if you don't have first aid & bot has first aid in "Virtual Inventory", you'll take a first aid kit).

So with this mod, you only need to protect the bots who have items in "Virtual Inventory".

Notes:
- The healing prevention is only applied on bots. Players can still heal bots anytime they want.
- Let me know if you find any bugs on the "Virtual Inventory".
Popular Discussions View All (3)
10
31 Dec, 2023 @ 8:55am
About Bot healing prevention system
WuChan
1
24 Aug @ 11:00am
Possible to balance items between bots?
暮雨初晴
0
25 Aug @ 9:14am
PINNED: Bot Healing Prevention Bug Reports
kurochama
64 Comments
kouga 29 Sep @ 5:04am 
@kurochama, thanks for the input. in my case, im using left 4 bots 2, ill see what i can do to get that bug addressed
kurochama  [author] 29 Sep @ 4:54am 
@ kouga , this is usually a bug from mods that allow bots to use defib.Normally the modders of those mods should be the ones fixing it. It's possible to add defib on the virtual inventory, but as you said, it's kind of pointless & makes it more complicated to pick items from bot's virtual inventory, as item pickup priority will need to be set as well, like whether the medkit is the top priority when picking from virtual inventory, or defib is the top priority..
So, let the modders who created mods that allow bots to use defib try to fix that bug themselves first, as it shouldn't be difficult to them as there are several tricks that can be used, like forcing bots to switch to other items, or preventing them from accessing defib if there's no dead survivor, etc.
kouga 28 Sep @ 11:50pm 
could you maybe add defibs as a viable item? i know this sounds pointless but i sometimes get weird behavior from the bots where they just shove me endlessly with defibs when my health is low
kurochama  [author] 12 Sep @ 9:37am 
@Yorukaze , you can use mode 2 of "Virtual Inventory Type". Mode 2 is shared virtual inventory, so all bots share one virtual inventory. It means that as long as 1 bot is still alive, you can take healing items from bot's virtual inventory.
Yorukaze 12 Sep @ 7:56am 
Can be both good and bad.. Like them taking another kit and putting it in their virtual inventory wasting a kit in the process, and not being able to drop their kit when they die. Very nice idea though, a virtual inventory.
kurochama  [author] 25 Aug @ 9:12am 
@ Nanashi , it's possible, but I'm not sure if that will create a problem or not. Dropping all items in inventory is good if there are not so many items inside. But if bots already store many healing items & then they die, those many items will spawn together at once, & many healing items will be wasted (like, people won't keep eating pills if there are more than 3 pills on the ground while their total health is already 100).Probably it's safer to make bots keep them, & always carry at least one defib to revive the walking storage :steamhappy: . You can also set "Virtual Inventory Type" to 1, to make bots share same virtual inventory, so, as long as there's still one bot alive, you can pick the healing items in the inventory.

@ kouga , you're welcome.Let me know if you find any problems.
kouga 25 Aug @ 8:57am 
@kurochama, thank you!
Kwidam 24 Aug @ 1:45pm 
Would it be possible to make an option for the bots to drop all the items in their inventory when they die? That'd be pretty neat.
kurochama  [author] 24 Aug @ 10:57am 
@ kouga , I updated a new feature "Virtual Inventory Type". You'll need to delete the old cfg file to generate the new one with this feature added.
kouga 24 Aug @ 7:23am 
@kurochama, thats fine by me i suppose, as long as i can have Heal Only in Black White again :>