Raised This Month: $ Target: $400
 0% 

[L4D2] Healing Alternative (v1.1) [04-Aug-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.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    Improve when healing items (first aid kits, pain pills, and adrenaline shots) are used.
    Old 05-12-2024 , 09:17   [L4D2] Healing Alternative (v1.1) [04-Aug-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 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


    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 (30.5 KB, 87 views)
    __________________

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

    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).
    __________________

    Last edited by Mystik Spiral; 08-04-2024 at 14:02. Reason: revised for changes in v1.1
    Mystik Spiral is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 05-19-2024 , 09: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 10:13.
    Mystik Spiral is offline
    Mystik Spiral
    Senior Member
    Join Date: Oct 2020
    Location: Orlando, FL
    Old 08-04-2024 , 13:53   Re: [L4D2] Healing Alternative (v1.1) [04-Aug-2024]
    Reply With Quote #4

    Released new version 1.1.

    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 uses fewer entries now but it is not required to update it.
    __________________

    Last edited by Mystik Spiral; 08-04-2024 at 14:17. Reason: fixed a typo
    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 16:41.


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