AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Saferoom Naps: Spawn Next Map With 50 HP (https://forums.alliedmods.net/showthread.php?t=306348)

ConnerRia 03-27-2018 01:26

[L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
2 Attachment(s)
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.

ShineKia 04-25-2018 20:11

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

https://imgur.com/a/lhm0Cjx

https://imgur.com/a/lhm0Cjx

joyist 06-03-2018 22:20

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
1 Attachment(s)
Chinese translation, please ignore

KoMiKoZa 01-06-2019 08:44

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
Great idea, but as ShineKia has already mentioned, there's a graphical hp scale glitch.

KoMiKoZa 01-16-2019 08:29

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
3 Attachment(s)
Quote:

Originally Posted by ShineKia (Post 2589414)
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

yagura40977 04-11-2019 07:43

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
// 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

ReCreator 04-15-2019 08:22

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

Originally Posted by KoMiKoZa (Post 2635009)
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

Scp106 04-16-2019 08:37

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
1 Attachment(s)
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
.
.

KoMiKoZa 05-27-2019 10:31

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
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.

ReCreator 06-16-2019 19:25

Re: [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
 
2 Attachment(s)
Here is edited version for L4D1.
Also added HP restore for incaped player(usefull if enabled crawling).


All times are GMT -4. The time now is 09:08.

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