. Healing Alternative (l4d2_HealAlt) by Mystik Spiral
Improve when healing items (first aid kits, pain pills, and adrenaline shots) are used.
Summary of healing behavioral changes:
Bots prefer to use pills/adrenaline before first aid kits, except in safe rooms.
As long as they are available, bots will keep using pills/adrenaline instead of first aid kits when health < 40.
When pills or adrenaline are not available, bots will heal with first aid kits when health < 35.
Bots with a first aid kit will heal immediately when on third strike, regardless of health or other healing items.
Bots behavioral action redirection is relaxed (closer to standard behavior) for finale maps.
Bots will not use their first aid kit on a player that has their own first aid kit.
Bots with a first aid kit and health < 80 will automatically heal on map transition.
Survivors without a first aid kit and health < 40 will receive a minimal heal to 40 health on map transition.
Notes:
By default, this plugin will only run in the cooperative (coop) gamemode and will automatically enable/disable itself based on the active gamemode. It is intended to be used on dedicated servers that have not modified the default values of player health or healing items.
Bots will not usually try to heal self/others when they are under heavy attack and typically wait for some calm, so the actual health where they heal may vary slightly.
Previous versions removed first aid kits from ending saferooms then gave them out automatically on map transition including bots healing other players. Many players were confused by this and it has been reverted... first aid kits in safe rooms now behave normally.
These Valve ConVars will automatically be set when this plugin is active:
sb_temp_health_consider_factor 1
sb_toughness_buffer 0
pain_pills_health_threshold 90
The ConVars above will revert to their normal values whenever this plugin is not active.
I might add some new features in the future, but I will not be adding support for L4D1.
When reporting a bug, provide a description of the problem and the steps to reproduce it, and provide the output from this command on the dedicated server system console:
sm plugins list;sm exts list;meta list;sm_cvar mp_gamemode
Silvers: For the original Bot Healing Values plugin this is forked from, Left4DHooks, gamedata, Allowed Game Modes code, and many code examples.
BHaType: For help and code examples for custom Actions, and the Actions plugin.
nosoop: For the Source Scramble plugin.
Spirit_12: For help with determing navigation flow distance.
BRU7US: For help with the map_transition event.
Blueberryy: Improved Russian translation.
Changelog:
Code:
04-Aug-2024 v1.1
Added a few tweaks/fixes regarding when healing is allowed or redirected.
- When possible, redirect healing behavior, mostly using pain pills instead of first aid kits.
- When not redirected, do not block healing behavior except when target can heal themselves.
- Healing redirection now includes some randomness/chance so the healing behavior seems more natural.
Simplified bot healing during map transition for greater compatibility and less confusion.
- Bots with a first aid kit and < 80 health will heal self.
- Survivors without a first aid kit and < 40 health will receive a minimal heal to 40 health.
- No longer removes first aid kits in ending safe areas and they can be used normally.
Improved healing reliablity/timing when behavioral action is redirected.
Added a few miscellaneous code improvements.
Adjusted healing target values:
- Pills/Adrenaline < 40.
- First Aid Kit < 35.
The translation file ueses fewer entries now but it is not required to update it.
Code:
19-May-2024 v1.0.1
Minor code fixes.
- Detect player healing someone else when map transition begins.
- Improvements to late loading.
Easiest:
Download the l4d2_HealAlt.zip file, place it in the addons/sourcemod directory, unzip.
Manual:
Extract the l4d2_HealAlt.smx file to the "plugins" directory.
Extract the l4d2_HealAlt.txt file to the "gamedata" directory.
Extract the l4d2_HealAlt.phrases.txt file to the "translations" directory.
Extract the l4d2_HealAlt.sp file to the "scripting" directory.
I created the plugin above to deal with issues I saw happen frequently in public games with random online players. For example, bots and players healing with their first aid kit immediately after their first incap instead of popping pills and continuing (and looking for more pills along the way). There are far more pills in a typical map than first aid kits and it drives me crazy that players use their first aid kit when they have pills and are not black&white (third strike). It is usually a much better strategy (for self and team) to wait until you reach the next checkpoint before healing with a first aid kit.
With this plugin, the bots will use pills when available instead of first aid kits and will usually get MUCH further before they use their first aid kit, and an all bot team will nearly always clear every Valve map without restarts and still have their first aid kit when they reach the next checkpoint. Caveat, my server has other bot improvements too so that is also a factor. Human players can still waste use their first aid kit almost whenever they want, but at least the bots use a better strategy.
There are other healing-related improvements too, like preventing players with high health healing themselves when there are low health players in need of healing (they will see a message about the player they should heal instead of themselves).
Generally, bots will use/give pills at < 40 health (so they can keep moving at max speed) and keep taking pills when needed as long as they are available. Bots will use their first aid kit when they do not have pills and their total health < 35, or any time they are black&white (third strike).
Added a few tweaks/fixes regarding when healing is allowed or redirected.
- When possible, redirect healing behavior, mostly using pain pills instead of first aid kits.
- When not redirected, do not block healing behavior except when target can heal themselves.
- Healing redirection now includes some randomness/chance so the healing behavior seems more natural.
Simplified bot healing during map transition for greater compatibility and less confusion.
- Bots with a first aid kit and < 80 health will heal self.
- Survivors without a first aid kit and < 40 health will receive a minimal heal to 40 health.
- No longer removes first aid kits in ending safe areas and they can be used normally.
Improved healing reliablity/timing when behavioral action is redirected.
Added a few miscellaneous code improvements.
Adjusted healing target values.
- Pills/Adrenaline < 40.
- First Aid Kit < 35.
The translation file uses fewer entries now but it is not required to update it.