Raised This Month: $12 Target: $400
 3% 

[L4D2] Saferoom Naps: Spawn Next Map With 50 HP


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ConnerRia
Junior Member
Join Date: Mar 2018
Plugin ID:
6060
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Prevent metagaming in harder gamemodes. If you have less than 50hp, spawn in saferooms with 50hp.
    Old 03-27-2018 , 01:26   [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #1

    Saferoom Naps: Spawn Next Map With 50 HP

    Made for L4D2. Not tested on L4D, but will work if the survivors are considered client team 2.

    Intended for co-op gamemodes. The plugin code still executes on versus, but is totally obsolete: code is fired before map transition, but in versus survivors start new rounds on a clean slate with full health.


    Description
    A very simple plugin that sets players below 50 permanent hp to 50 hp (configurable) on the next map.

    In hard coop gamemodes, a popular strategy is to kill low health players at the end of each map so that they can respawn with 50health on the next map. In a game that emphasizes teamwork and surviving together, this is pretty jarring and immersion-breaking.

    My plugin fixes that by healing lowhealth players to 50hp - or the server's "z_respawn_health" value - and resetting their incap counter (times you can be incapped before going black-and-white) before the map transition. This makes the need to kill one another redundant.


    Cvars

    SafeRoomNaps_CanWeUseCustomValue
    //Default 0.
    If set to 1, allows you to input your own health value to set lowhp players to. Otherwise uses the "z_respawn_health" value, which is 50 by default.

    SafeRoomNaps_CustomSaferoomHealth
    //Default 50. (Unused)
    Only used if CanWeUseCustomValue is set to 1.

    SafeRoomNaps_RemoveBlackAndWhite
    //Default 1
    Self explanatory. Whether to remove blackandwhite. Enabled by default.

    SafeRoomNaps_TempHealthMultiplier
    //Default 0
    Float to multiply lowhp players' temporary health by. Its zero by default, meaning all temporary health is removed.

    SafeRoomNaps_VeryHealthyTempHealthMultiplier
    //Default 1
    Float to multiply healthy (those above the saferoomhp value) players' temporary health by. Its 1 by default, meaning all temporary health is kept. Set to 0 for consistency: if low health players lose their temp health after resting, why shouldnt high hp players do so too?


    Credits

    kaffaljidhma - Inspiration. They were the first to make a plugin addressing the issue. Sadly their code is super clunky and totally bork.

    disawar1 - Their Say Event plugin helped me find the correct event to hook to.
    Attached Files
    File Type: sp Get Plugin or Get Source (SaferoomNaps.sp - 2024 views - 4.0 KB)
    File Type: smx SaferoomNaps.smx (6.5 KB, 951 views)

    Last edited by ConnerRia; 04-02-2018 at 01:37.
    ConnerRia is offline
    ShineKia
    Junior Member
    Join Date: Apr 2017
    Old 04-25-2018 , 20:11  
    Reply With Quote #2

    Noicee!

    After we take a saferoom nap, at the next chapter those who have had hp below 50 solid, would have 50 solid but the HUD is kinda bug, like shown in this pic:



    https://imgur.com/a/lhm0Cjx

    Last edited by DarkDeviL; 04-27-2018 at 07:21. Reason: Merged four posts in a row, there is an Edit button if you need to add more information while you're still the last one posting in the thread
    ShineKia is offline
    joyist
    Member
    Join Date: Apr 2018
    Old 06-03-2018 , 22:20   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #3

    Chinese translation, please ignore
    Attached Files
    File Type: sp Get Plugin or Get Source (SaferoomNaps-ch.sp - 1114 views - 4.0 KB)
    joyist is offline
    KoMiKoZa
    Senior Member
    Join Date: Dec 2017
    Location: Thy old times.
    Old 01-06-2019 , 08:44   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #4

    Great idea, but as ShineKia has already mentioned, there's a graphical hp scale glitch.
    KoMiKoZa is offline
    KoMiKoZa
    Senior Member
    Join Date: Dec 2017
    Location: Thy old times.
    Old 01-16-2019 , 08:29   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #5

    Quote:
    Originally Posted by ShineKia View Post
    After we take a saferoom nap, at the next chapter those who have had hp below 50 solid, would have 50 solid but the HUD is kinda bug
    With some great help from Dragokas, I present Saferoom Naps 2.0:

    Differences from the original:
    • Fixed graphical hp bugs.
    • Removed all temporary-health-related variables. Temporary hp will no longer be saved (it's a nap after all!).
    • Saved 3 original cvars:
    1. SafeRoomNaps_CanWeUseCustomValue
    2. SafeRoomNaps_CustomSaferoomHealth
    3. SafeRoomNaps_RemoveBlackAndWhite
    Attached Files
    File Type: smx SaferoomNaps2_0.smx (5.6 KB, 507 views)
    File Type: sp Get Plugin or Get Source (SafeRoomNaps2_0.sp - 450 views - 2.7 KB)
    File Type: inc SetHealthStock.inc (904 Bytes, 499 views)

    Last edited by KoMiKoZa; 01-16-2019 at 08:46. Reason: Added .inc and precompiled .smx
    KoMiKoZa is offline
    yagura40977
    Junior Member
    Join Date: Feb 2019
    Old 04-11-2019 , 07:43   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #6

    // Set to 1 if you want to input your own saferoom hp value. Uses the z_survivor_respawn_health value otherwise. Disabled by default.
    // -
    // Default: "0"
    SafeRoomNaps_CanWeUseCustomValue "1"

    SaferoomNaps2_0.smx => Does not work

    SaferoomNaps.smx 1.0 =>ok
    yagura40977 is offline
    ReCreator
    Member
    Join Date: Nov 2017
    Location: Ukraine,Kyiv
    Old 04-15-2019 , 08:22   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #7

    Quote:
    Originally Posted by KoMiKoZa View Post
    With some great help from Dragokas, I present Saferoom Naps 2.0:

    Differences from the original:
    • Fixed graphical hp bugs.
    • Removed all temporary-health-related variables. Temporary hp will no longer be saved (it's a nap after all!).
    • Saved 3 original cvars:
    1. SafeRoomNaps_CanWeUseCustomValue
    2. SafeRoomNaps_CustomSaferoomHealth
    3. SafeRoomNaps_RemoveBlackAndWhite
    L 04/15/2019 - 00:15:09: [SM] Exception reported: Property "m_bIsOnThirdStrike" not found (entity 1/player)
    L 04/15/2019 - 00:15:09: [SM] Blaming: SafeRoomNaps2_0.smx
    L 04/15/2019 - 00:15:09: [SM] Call stack trace:
    L 04/15/2019 - 00:15:09: [SM] [0] SetEntProp
    L 04/15/2019 - 00:15:09: [SM] [1] Line 45, SafeRoomNaps2_0.sp::Event_MapTransition

    L4D1/SM 1.9
    __________________
    Sorry for my pure English...
    ReCreator is offline
    Scp106
    Junior Member
    Join Date: Jun 2014
    Location: Russia, Moscow
    Old 04-16-2019 , 08:37   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #8

    Old Message

    After a month of waiting for response from KoMiKoZa - I've decided to edit his version of Saferoom Naps for myself.
    Looks like it works ok now - no crashes or UI bugs.

    Remember:

    1) Plugin has new simpler name - Saferoom HP Restore

    2) New convars:

    hpr_version - 1.0.1 (Obvious...)
    hpr_customvalue - "0" (Set to 1 if you want to input your own saferoom hp value. Uses the z_survivor_respawn_health value otherwise. Disabled by default.)
    hpr_customhealth - "50" (Not used unless hpr_customvalue is enabled. If your health is lower than the set value, it will be modified to that value when the next map loads.)
    hpr_removebw - "1.0" (Whether to remove black-and-white from players. Set to 0 to disable this feature.)

    3) New cfg filename
    cfg\sourcemod\SaferoomHPRestore.cfg
    .
    .
    Attached Files
    File Type: 7z SaferoomHPRestore.7z (7.5 KB, 548 views)
    __________________

    Last edited by Scp106; 05-22-2019 at 06:16. Reason: Edited
    Scp106 is offline
    KoMiKoZa
    Senior Member
    Join Date: Dec 2017
    Location: Thy old times.
    Old 05-27-2019 , 10:31   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #9

    I was busy with other stuff but thanks for taking care of things.

    The plugin worked ok on my server and never crashed it or presented any UI bugs, otherwise I wouldn't have posted it here.

    Last edited by KoMiKoZa; 06-01-2019 at 07:16.
    KoMiKoZa is offline
    ReCreator
    Member
    Join Date: Nov 2017
    Location: Ukraine,Kyiv
    Old 06-16-2019 , 19:25   Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
    Reply With Quote #10

    Here is edited version for L4D1.
    Also added HP restore for incaped player(usefull if enabled crawling).
    Attached Files
    File Type: sp Get Plugin or Get Source (SaferoomHPRestore.sp - 350 views - 2.7 KB)
    File Type: smx SaferoomHPRestore.smx (5.8 KB, 319 views)
    __________________
    Sorry for my pure English...
    ReCreator 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 06:13.


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