Left 4 Dead 2

Left 4 Dead 2

81 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
150.607 KB
Dec 27, 2023 @ 8:21am
May 24, 2024 @ 5:19am
12 Change Notes ( view )

Subscribe to download
Bot Healing Prevention System

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
39 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.

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.
- Video preview might be added later when I feel like uploading it.
- Let me know if you find any bugs on the "Virtual Inventory".
Popular Discussions View All (1)
10
Dec 31, 2023 @ 8:55am
About Bot healing prevention system
WuChan
43 Comments
kurochama  [author] May 4 @ 12:20pm 
@CodE>102 928 8218 , thanks for the review. As for the healing item when a bot dies, it's still saved in the virtual inventory, so if the bot is revived or spawned in the rescue closet, the healing item can be retrieved by shoving the bot.
CodE>102 928 8218 May 4 @ 7:33am 
中文评论 3 ————————————————————————
不过任然不知道,BOT在达到可以治疗的标准时,能否成功的重新拿回治疗道具。所以我。都是手动帮助他们拿回来的,另外此MOD也有一定风险,如果BOT没有添加,增强防御的脚本,专家难度下,在遭遇"TANK"或者“女巫”的攻击时,AI一旦死亡,那么他的治疗道具,似乎就再也拿不回来了.能否更新一下,让AI死亡后,能正常掉落道具了?
CodE>102 928 8218 May 4 @ 7:33am 
中文评论 2 ————————————————————————
第一项,一定要设置成为2,因为我除此之外,还装了一个,右键可以交换物品的MOD,如果你设置成了1,有几率会导致,BOT,将投掷道具错认为治疗道具,因而发生一直递给你投掷道具的情况。而如果你设置成了2,BOT将只会切换到治疗道具,但是无法右键传递给你,也让物品,不会存进“虚拟内存”。尽管AI与AI之间的治疗,会导致治疗道具,被放进虚拟内存。从而在场一个受伤的AI,导致所有AI都把治疗道具放进了虚拟内存,你得自己帮助他们拿出来。不过也胜过,我在被"坦克“追击时,BOT强行给我治疗的情况...。
CodE>102 928 8218 May 4 @ 7:33am 
中文评论 1————————————————————————
完美,这或许是整个L4D2,创意工坊中。真正意义上,解决了。电脑在你不该需要治疗的时候,轮流来给你治疗,让你原地罚站.
这是我的设置参数:

HealingPreventionMode 2
HealOnlyInBlackWhite 0
MedicUsePrevention 10
PillsUsePrevention 39
CodE>102 928 8218 May 4 @ 7:31am 
Comment 3: ————————————————————
I still don’t know whether bots are able to successfully retrieve their healing items once they meet the healing criteria. So I usually just help them get the items back manually.
Also, this mod comes with some risks: if your bots don’t have enhanced defense scripts, then on Expert difficulty, when facing a Tank or a Witch, once a bot dies, it seems their healing item can no longer be retrieved.
Would it be possible to update the mod so that bots drop their items properly after death?
CodE>102 928 8218 May 4 @ 7:27am 
Comment 2: ————————————————————

Make sure the first setting is set to 2. That’s crucial, because I also use a mod that allows item trading via right-click. If you set it to 1, bots might mistakenly treat throwable items as healing items, leading to a bug where they keep trying to hand you throwables. But if you set it to 2, bots will only switch to healing items but won’t be able to hand them over via right-click. This also prevents items from being stored in "virtual memory."
Although, to be fair, AI healing other AIs can still cause healing items to go into virtual memory. This can lead to a situation where a single injured AI causes all bots to store their medkits away — and you’ll have to retrieve them manually.
Still, that’s better than having a bot forcibly heal me while I’m being chased by a Tank...
CodE>102 928 8218 May 4 @ 7:27am 
Comment 1: ————————————————————

Perfect. This might be the one true solution in the entire L4D2 Workshop that genuinely fixes the issue where bots insist on healing you when you absolutely don’t need it, forcing you to stand still and do nothing.

Here are my settings:

HealingPreventionMode 2
HealOnlyInBlackWhite 0
MedicUsePrevention 10
PillsUsePrevention 39
kurochama  [author] Apr 17 @ 1:39pm 
@Jakiy , that will cause another problem. For example, bots will keep picking medkits nearby & try to heal & then lose the medkits. This will make all medkit supplies disappear one by one just because one bot tries to heal. The virtual inventory is to prevent this problem.
Jakiy Apr 17 @ 1:23pm 
Is it possible to disable the virtual inventory completely? I don't want bots to hide their medkit and it osho hide it from the HUD too.
Meow Dec 2, 2024 @ 4:39am 
Thank you for explaining that. i thought it has a bug