Raised This Month: $ Target: $400
 0% 

[L4D2] Healing Alternative (v1.0.1) [19-May-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Plugin ID:
8701
Plugin Version:
1.0.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Improve when healing items (first aid kits, pain pills, and adrenaline shots) are used.
Old 05-12-2024 , 08:17   [L4D2] Healing Alternative (v1.0.1) [19-May-2024]
Reply With Quote #1

.
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/give pills/adrenaline instead of first aid kits.
  • Bots will wait longer to use first aid kits on self or others.
  • Bots will never heal another player that has their own healing items.
  • Survivors with a first aid kit are healed using the standard algorithm during map changes.
  • Survivors without a first aid kit are healed to 50, same as a respawned dead player, during map changes.
  • All survivors are given a first aid kit during map changes.


Options:

For proper operation, set the following Valve ConVars in your server.cfg file:
  • sb_toughness_buffer 0
  • sb_temp_health_consider_factor 0.0
  • pain_pills_health_threshold 90


Notes:

By default, this plugin will only run in the cooperative (coop) gamemode and is intended to only be used on dedicated servers that have not modified the default values of player health or healing items.

I plan to eventually add handling for first aid kits found outside of safe rooms.
I will not be adding support for L4D1.

Please let me know if you find any bugs, but before reporting, connect to the dedicated server system console and type:

sm plugins list;sm_cvar mp_gamemode

Check that the gamemode is "coop" and whether you see "[L4D2] Healing Alternative" or error messages, especially errors related to missing prerequisites.

Languages currently supported: EN, ES, FR, RU, ZHO
Most of the language support comes from various translators and may sound weird to native speakers.
If you have better or new translations, just let me know, I am happy to include them.


Code / Discussion:

GitHub
AlliedModders


Acknowledgements and Thanks:

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:


Prerequisites:


Installation:

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.

.
Attached Files
File Type: zip l4d2_HealAlt.zip (34.7 KB, 18 views)
__________________

Last edited by Mystik Spiral; 05-19-2024 at 15:47. Reason: Released new version
Mystik Spiral is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 05-13-2024 , 18:45   Re: [L4D2] Healing Alternative (v1.0) [12-May-2024]
Reply With Quote #2

I created the plugin above to deal with a couple of issues I saw happen frequently in public games with random online players:

01. 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.

02. One or more players enter the ending checkpoint and take a first aid kit, heal, then take a second first aid kit, so it is not possible for other players entering the checkpoint to heal because there are no more first aid kits available. More often than not, the players that took two first aid kits do not heal the player without a first aid kit that needs to heal.

For problem 01, the bots will use pills 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.

Problem 02 is eliminated because players cannot take a first aid kit from a checkpoint, much less two. Besides insta-heal on map change if the player already has a first aid kit, each player is given one first aid kit, and they can use it to heal themselves, someone else, or save it for later. Saving for later is nearly always the best strategy since all players will have at least 50 health when they leave the checkpoint.

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 39 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 health is 23 or lower or any time they are black&white (third strike). The 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 varies.
__________________
Mystik Spiral is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 05-19-2024 , 08:30   Re: [L4D2] Healing Alternative (v1.0.1) [19-May-2024]
Reply With Quote #3

Released new version 1.0.1.

19-May-2024 v1.0.1
  • Minor code fixes.
    - Detect player healing someone else when map transition begins.
    - Improvements to late loading.
  • Improved Russian translation (Спасибо Blueberryy)
__________________

Last edited by Mystik Spiral; 05-19-2024 at 09:13.
Mystik Spiral is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode