AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Incapacitated Automatic Health Regen And Self Revive v2.12【2024-03-24】 (https://forums.alliedmods.net/showthread.php?t=333666)

little_froy 07-28-2021 07:14

[L4D2] Incapacitated Automatic Health Regen And Self Revive v2.12【2024-03-24】
 
3 Attachment(s)
Description
  • Allow survivor automatically regenerate health when been incapacitated and get self revive when health reaches the max.
  • if everyone is incapacitated, special infecteds will lose attack target. use Target Override to fix.

Cvars
PHP Code:

// default health when down
// -
// Default: "240"
// Minimum: "1.000000"
incap_self_revive_down_default_health "240"

// how long need to wait after health reaches the max when down
// -
// Default: "1.0"
// Minimum: "0.000000"
incap_self_revive_down_finish_time "1.0"

// how many health heal once when down
// -
// Default: "5"
// Minimum: "1.000000"
incap_self_revive_down_health "5"

// how long time will count to hit time if takedamage or pinned by special infected when down
// -
// Default: "1.0"
// Minimum: "0.000000"
incap_self_revive_down_hit_duration "1.0"

// if keeping takedamage or pinned by special infected longer than this, instantly failed. 0.0 or lower = disable
// -
// Default: "40.0"
incap_self_revive_down_hit_time_max "40.0"

// 1 = enable, 0 = disable. interrupt healing on hurt when down?
// -
// Default: "1"
incap_self_revive_down_interrupt_on_hurt "1"

// repeat interval after healing start when down
// -
// Default: "1.0"
// Minimum: "0.000000"
incap_self_revive_down_repeat_interval "1.0"

// how long need to wait to heal after takedamage or pinned by special when down
// -
// Default: "2.0"
// Minimum: "0.000000"
incap_self_revive_down_start_wait "2.0"

// default health when ledge
// -
// Default: "240"
// Minimum: "1.000000"
incap_self_revive_ledge_default_health "240"

// how long need to wait after health reaches the max when ledge
// -
// Default: "1.0"
// Minimum: "0.000000"
incap_self_revive_ledge_finish_time "1.0"

// how many health heal once when ledge
// -
// Default: "5"
// Minimum: "1.000000"
incap_self_revive_ledge_health "5"

// how many health will decay after revived from ledge
// -
// Default: "10"
// Minimum: "0.000000"
incap_self_revive_ledge_health_decay "10"

// how long time will count to hit time if takedamage or pinned by special infected when ledge
// -
// Default: "1.0"
// Minimum: "0.000000"
incap_self_revive_ledge_hit_duration "1.0"

// if keeping takedamage or pinned by special infected longer than this, instantly failed. 0.0 or lower = disable
// -
// Default: "40.0"
incap_self_revive_ledge_hit_time_max "40.0"

// 1 = enable, 0 = disable. interrupt healing on hurt when ledge?
// -
// Default: "1"
incap_self_revive_ledge_interrupt_on_hurt "1"

// repeat interval after healing start when ledge
// -
// Default: "1.0"
// Minimum: "0.000000"
incap_self_revive_ledge_repeat_interval "1.0"

// how long need to wait to heal after takedamage or pinned by special when ledge
// -
// Default: "2.0"
// Minimum: "0.000000"
incap_self_revive_ledge_start_wait "2.0" 

Natives and Forwards
Spoiler


Related Plugins
Change Log
Spoiler

Toranks 12-02-2021 08:57

Re: [L4D2] Incapacitated Automatic Health Regen and Self Revive Enhanced v4.3.0
 
If I pause the game, the health regeneration continues. When unpause, they recover all the life that corresponds to them for the elapsed time of pause. If you fix it, it's will be a perfect mod

Bots do not pause regeneration when attacked. This is fine by me, as bots are clumsier than the player, but I would like it to be configurable with a separate command like incap_bot_reviveXXXX

Toranks 04-26-2022 18:35

Re: [L4D2] Incapacitated Automatic Health Regen and Self Revive Enhanced【unapproved】
 
Oh, what a pity that this mod was unapproved and deprecated. It was very useful for me because allows you to choose how much temporary health you start with when a Survivor get incapped on a ledge, including the corresponding animation. Then, survivor begins to fall down (80 HP), and gradually stands up on his own, with his own animations. It's very realistic like that and I've been playing that way for a year now.
On the other hand, since I am not interested on normal incapped autorecovery, I have edited the code so it allows for negative values of incap_self_revive_ledge_point, which I use to customize the rate at which a survivor loses life while incapacitated. Is mandatory to use incap_self_revive_down_default "299" instead of "300" or there will be a bug. I don't know how to disable the mod during normal incapacitation due to lack of cvars and so far I haven't really looked at the code much I was already satisfied with it.

I can post the source code if anyone is interested and the author or administrators allow it. In the meantime, I'll keep it as a little treasure.

little_froy 12-06-2022 00:11

Re: [L4D2] Incapacitated Automatic Health Regen and Self Revive v1.5.0 【2022-12-06】
 
Code:

1.5.0 (2022-12-06:
mission will failed when every died or incapped, remove translation and commands.


Silvers 12-06-2022 01:53

Re: [L4D2] Incapacitated Automatic Health Regen and Self Revive v1.5.1 【2022-12-06】
 
- You should be putting the clients userid into timers and validating in the timer callback otherwise you're likely going to affect someone else.
- Alternatively since you're storing the timer handle in a client array you could delete that if they disconnect.
- Your OnGameFrame stuff is crazy, I don't think you need to be using this forward for these things, and other plugins of yours are also using it a lot.
- You have multiple client loops in OnGameFrame which could be consolidated into 1. You really should be optimizing stuff that goes inside OnGameFrame, Think hooks and SetTransmit, since these are called so often it can easily have an impact on the server if the code is doing a lot of stuff.
- You don't need "public" before callbacks that you have named yourself, only for SM forwards and 3rd party plugin forwards.

Zheka 12-27-2022 01:00

Re: [L4D2] Incapacitated Automatic Health Regen and Self Revive v1.10【2022-12-24】
 
Сan you add an animation to play when standing up?

Zheka 12-27-2022 12:08

Re: [L4D2] Incapacitated Automatic Health Regen and Self Revive v1.10【2022-12-24】
 
Quote:

Originally Posted by Marttt (Post 2796022)
You should provide an English translation too, since here is mainly an English forum. (also mentioned in the rules)

Google Translate: "Can you add an animation to play while standing up?"

I'm sorry, I just made a mistake and inserted the original text in the message instead of the translated one and didn't notice it.

49459317 02-22-2023 13:21

Re: [L4D2] Incapacitated Automatic Health Regen And Self Revive v1.22【Final】
 
666666

little_froy 02-22-2024 09:43

Re: [L4D2] Incapacitated Automatic Health Regen And Self Revive v2.0【2024-02-22】
 
Code:

2.0 (2024-02-22:
-totally rewrite the code, much safer and faster.
-add cvar to control max hit time to prevent infinite healing.



All times are GMT -4. The time now is 04:40.

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