Left 4 Dead 2

Left 4 Dead 2

106 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)
50 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)
1
24 Aug @ 11:00am
Possible to balance items between bots?
暮雨初晴
10
31 Dec, 2023 @ 8:55am
About Bot healing prevention system
WuChan
0
25 Aug @ 9:14am
PINNED: Bot Healing Prevention Bug Reports
kurochama
59 Comments
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 :>
kurochama  [author] 24 Aug @ 5:11am 
@ kouga , probably the best solution for custom models would be adding a feature to make bots store healing items in a shared virtual inventory instead, just like the suggestion on the thread, https://gtm.steamproxy.vip/workshop/filedetails/discussion/3124174557/598534026474754156/ . A shared virtual inventory will gather all stored items in one place, & if a player shoves any bots, healing items from the inventory can be taken without having to memorize which bots store the most healing items in their personal virtual inventory.
kouga 24 Aug @ 5:00am 
i think ive figured it out @kurochama, it might be clashing with the functions of Custom Survivor Takeover because both of your mods scans for the vanilla survivor .mdl files, but the problem is that CST scans those models in order to replace them with custom characters with custom .mdls, effectively rendering your mod useless on those custom bots. could you maybe make an update with an extra cfg file where we can register their custom .mdls so this mod would apply to them? what do you think?
kouga 21 Aug @ 1:07am 
thats weird then. in my case it feels like the ai just doesnt abide by the mod after 2 incaps, and tries to heal me even when im not black white. maybe i overlooked a conflict somewhere...
kurochama  [author] 21 Aug @ 12:54am 
@ kouga , if it's "Heal Only In Black White", it uses a netprops to check the current revive count.If the revive count is the same as the value on "survivor_max_incapacitated_count". So if you set the max revive count to 4, it only takes effects after incapacitation for 4 times & the screen goes black & white.
kouga 21 Aug @ 12:26am 
hey there. how exactly does this mod work? does it know when exactly you are in black and white or is it counting if youve gotten incapped twice? because im having a weird issue with this when paired with cvars that change the incap count to more than 4. after only 2 incaps the bots start pestering me again. so i wanted to know. thanks!