Allow survivor automatically recover their health.
Simplified version.
Cvars
PHP Code:
// 1 = enable, 0 = disable. always fix health buffer even the healing has not start?
// -
// Default: "0"
automatic_healing_always_fix "0"
// when need healing, behind the decimal point, how many health buffer will increase to, if it lower than the value. 0.0 or lower = disable
// -
// Default: "0.2"
// Maximum: "0.990000"
automatic_healing_fix "0.2"
// how many health buffer heal once
// -
// Default: "1.0"
// Minimum: "0.100000"
automatic_healing_health "1.0"
// how long time need to wait after the interruption to start healing
// -
// Default: "5.0"
// Minimum: "0.000000"
automatic_healing_wait_time "5.0"
Note
health type of regeneration is health buffer(temp health). since version 2.4, you have to set "automatic_healing_max" more than a litter one decimal point of your expected integer health value(higher "pain_pills_decay_rate" means it should be higher, higher server tick rate means it could be lower). else, regenerated health can't keep.
if enabled "automatic_healing_always_fix", calling native "AutomaticHealing_WaitToHeal2" will only reset the wait time, but not drop health keeping with decay health buffer.
Natives(for developers)
Spoiler
PHP Code:
/**
* @brief restart someone's healing
*
* @param client client index
* @param forceDecay force health buffer decay and restart healing, even the heal is done
*
* @return AutomaticHealing_WaitToHeal_Result_Success on success, otherwise failed
*
* @error client not an alive and none-incapacitated survivor.
*/
native AutomaticHealing_WaitToHeal_Result AutomaticHealing_WaitToHeal2(int client, bool forceDecay = true);
4.14 Simplified (2024-03-22:
-minor change of natives.
-update .inc file.
4.13 Simplified (2024-03-16:
-fix rare "client not in game" error.
4.12 Simplified (2024-03-15:
-remove unnecessary resetting variables in frame callbacks.
4.11 Simplified (2024-03-10:
-heal will start delayed at least 1 frame if interrupted. so keep calling "wait to heal" API can keep block healing.
4.10 Simplified (2024-02-23:
-better compatibility with my "incap_self_revive" plugin.
4.9 Simplified (2024-02-17:
-minor improve of code.
4.8 Simplified (2024-01-04:
-minor improve of code.
4.7 Simplified (2023-12-30:
-change current time type to gametime.
4.6 Simplified (2023-12-08:
-add native "AutomaticHealing_WaitToHeal2", deprecated native "AutomaticHealing_WaitToHeal".
4.5 Simplified (2023-10-20:
-instantly store cvars to variables after create them, to prevent sometimes using uninitialized variables before OnConfigsExecuted.
4.4 Simplified (2023-10-15:
-instantly reset state on changed.
4.3 Simplified (2023-10-12:
-instantly fix health buffer once before the first time healing, if enabled "automatic_healing_fix" but not "automatic_healing_always_fix".
4.2 Simplified (2023-10-04:
-remove unnecessary self .inc file.
-refactoring the underlying code, fix health buffer decay after client switch game process to bakcground then switch back,
but other plugin shouldn't directly set lower health without take damage, or create event "player_hurt" or call native "AutomaticHealing_WaitToHeal".
-remove cvar "decay_health_on_interrupt", since it automatically work if other plugin call native "AutomaticHealing_WaitToHeal".
-add new cvar "automatic_healing_always_fix".
-no longer work on level end map transition or final win vehicle leaving.
4.1 Simplified (2023-09-16:
fix sometimes native "AutomaticHealing_WaitToHeal" does not work for cvar "automatic_healing_decay_health_on_interrupt".
4.0 Simplified (2023-09-16:
add new cvar "automatic_healing_decay_health_on_interrupt".
3.7 Simplified (2023-08-08:
fix wrong detection of idled player of bot.
3.6 Simplified (2023-06-21:
add check for engine version, no longer load plugin in other games.
3.5 Simplified (2023-06-11:
remove cvar "automatic_healing_fix_type".
change cvar "automatic_healing_fix" only works when need healing.
change default value of cvar "automatic_healing_health" to "1.0".
3.4 Simplified (2023-06-07:
add cvar "automatic_healing_fix_type".
3.3 Simplified (2023-05-28:
add cvar "automatic_healing_fix".
3.2 Simplified (2023-05-15:
add native "AutomaticHealing_WaitToHeal" to restart someone's healing.
change cvar "automatic_healing_interrupt" to "automatic_healing_interrupt_on_hurt".
cvar "automatic_healing_medicine" has been port to plugin Medicine Health Buffer.
cvar "automatic_healing_interrupt" has been port to plugin Automatic Healing Addon: Interrupt Healing On Attack.
3.1 Simplified (2023-04-25:
refurbishment code format.
3.0 Simplified (2023-04-15:
use frame instead of timers, now you can custom smaller intervals lower than 0.1s.
2.12 Simplified (2023-04-12:
minor improve of code.
2.11 Simplified (2023-04-07:
minor improve of code.
2.10 Simplified (2023-04-03:
reset client index over than "MaxClients" on round start / plugin start by late-load, to be compatible with dynamic "MaxClients".
2.9 Simplified (2023-03-31:
mionr improve.
2.8 Simplified (2023-03-26 | reupload 2023-03-29:
check events to instantly stop healing when been dead/incapacitated.
2.7 Simplified (2023-03-25:
minor improve.
2.6 Simplified (2023-03-16 | reupload 2023-03-19:
TOTALLY remove feature that instantly heal to "automatic_healing_max" every level start or new survivor join. I'm sorry, it may not work sometimes, so I have to remove it.
but also try SafeRoom Naps.
2.5 Simplified (2023-03-14:
add late-load support to provide quotas of instantly-heal for clients not in game.
2.4 Simplified (2023-03-13:
minor improve of code.
2.3 Simplified (2023-03-13:
minor improve of code.
2.2 Simplified (2023-03-12 | rollback:
minor improve.
2.1 Simplified (2023-02-28:
minor improve of code.
2.0 Simplified (2023-02-26 | experimental:
restore extra checks of is client in game.
merge some features from old version 5.0.
change cvar "automatic_healing_interrupt_on_hurt" to "automatic_healing_interrupt",
allow interrupt healing on primary attack or shove.
experimental featurns may be removed in versions after.
1.0 Simplified (2023-02-19:
simplified version from now.
5.0 (2023-02-17:
removed feature on 4.0 is back!
check the .cfg config file, cvar "automatic_healing_interrupt" has been changed.
4.5 (2023-02-16:
minor improve.
4.4 (2023-02-15:
minor improve.
4.3 (2023-02-13 | reupload 2023-02-14:
minor improve.
4.2 (2023-02-13:
minor improve of code.
4.1 (2023-02-09:
add more check for survivor status in timers and every frame.
4.0 (2023-02-06:
sorry folks, since cvar "automatic_healing_interrupt" has some problems i can't solve, i simplified the option, remove "primary attack" and "shove" to interrupt.
if you want the older version, look at #6.
change cvar default value of "automatic_healing_health" and "automatic_healing_repeat_interval".
real max health can be higher than "automatic_healing_survivor_max_health".
3.1 (2023-01-30:
improve about cvar "automatic_healing_medicine" for pain pills and adrenaline.
3.0 (2023-01-30:
add cvar "automatic_healing_medicine" and "automatic_healing_survivor_max_health" to control which medicine will provide instantly heal when using.
2.11 (2023-01-27:
simplify detections in events.
2.10 (2023-01-24:
increase default value of cvar "automatic_healing_max" to 30.2.
2.9 (2023-01-22:
change the description of cvar "automatic_healing_interrupt".
2.8 (2023-01-20 | reupload 2023-01-22:
clean up code.
2.7 (2023-01-19:
minor improve.
2.6 (2023-01-18:
improve detection of if has released from edge.
2.5 (2023-01-16:
minor improve of code.
2.4 (2023-01-10:
sorry folks, since sound functions has some problems i can't solve, i remove the sound options.
new method to keep regenerated health, compatible with plugins directly set health without event "player_hurt".
2.3 (2022-12-25 | reupload 2023-01-01:
improve performance of detecting primary attack: use int weapon id instead of string weapon name.
2.2 (2022-12-20:
minor improve.
2.1 (2022-12-14 | reupload 2022-12-15 | reupload 2022-12-16:
improve survivor status deteciton.
merge cvar "automatic_healing_sound_during" and "automatic_healing_sound_done" into "automatic_healing_emit_sound".
2.0 (2022-12-13:
add cvar "automatic_healing_interrupt" to control which case(s) will interrupt healing.
remove cvar "automatic_healing_harder".
1.15 (2022-12-13:
new version naming style.
1.14.11 (2022-12-12:
optimize performance by using static char array.
1.14.10 (2022-12-08:
fix lack of detection of standing up when defibrillator used.
1.14.9 (2022-12-02:
improve detection for sound.
1.14.8 (2022-11-29:
minor improve.
1.14.7 (2022-11-28:
fix "automatic_healing_remove_native_heartbeat" not works for incapped survivors when "survivor_max_incapacitated_count" reduces during game play.
1.14.6 (2022-11-27:
heal will instantly be done if health reaches the integer value of "automatic_healing_max".
1.14.5 (2022-11-27:
minor improve.
1.14.4 (2022-11-26:
"automatic_healing_sound_done" no longer emit sound if heal be done by other case without this plugin.
1.14.3 (2022-11-25:
update plugin info.
1.14.2 (2022-11-25:
minor improve.
1.14.1 (2022-11-25:
if healing does not increase the integer value of whole health, sounds will not emit.
1.14.0 (2022-11-24 rollback:
add new cvar to control if it will emit tip sound when heal is done.
remove cvar "automatic_healing_keep_health_in_unhurt_conflict" since it not wokrs well in multiplay.
1.13.6 (2022-11-23:
try to fix issue that net lag makes "automatic_healing_keep_health_in_unhurt_conflict" not works.
1.13.5 (2022-11-21:
improve cvar descriptions.
1.13.4 (2022-11-17:
chagne cvar name "automatic_healing_remove_internal_heartbeat" to "automatic_healing_remove_native_heartbeat".
1.13.3 (2022-11-13:
change cvar names and descriptions.
1.13.2 (2022-11-07:
minor improve.
1.13.1 (2022-11-03:
minor improve.
1.13.0 (2022-10-31:
add new cvar to control if health will keep on conflict when heal is done.
1.12.12 (2022-10-28:
minor improve.
1.12.11 (2022-10-26:
rename some cvars.
1.12.10 (2022-10-25:
minor improve.
1.12.9 (2022-10-21:
minor improve.
1.12.8 (2022-10-20:
rename cvar "automatic_healing_remove" to "automatic_healing_remove_inernal_heartbeat".
1.12.7 (2022-10-11:
improve detect of grenade throwns for "automatic_healing_harder".
1.12.6 (2022-07-29:
minor improve.
1.12.5 (2022-07-28:
minor improve.
1.12.4 (2022-07-25:
remove cvar "automatic_healing_exclude" and make it functions enable as default :
"automatic_healing_harder"/hurt/stagger/pinned/strike fly and standing no longer take effect to healing when heal is done.
1.12.3 (2022-07-22:
recovery level start instantly heal and improve it.
1.12.2 (2022-07-22:
remove level start instantly heal.
1.12.1 (2022-07-22:
minor improve.
1.12.0 (2022-07-21:
add new cvar.
1.11.12 (2022-07-16:
minor improve.
1.11.11 (2022-07-15:
minor improve.
1.11.10 (2022-07-14:
minor improve.
1.11.9 (2022-07-10:
block healing when have fallen from edge.
1.11.8 (2022-07-09:
minor improve.
1.11.7 (2022-07-08:
minor improve.
1.11.6 (2022-07-07:
minor improve.
1.11.5 (2022-07-07 (rollback):
use OnPlayerRunCmdPre.
1.11.4 (2022-06-19:
add plugin info.
1.11.3 (2022-06-07:
minor improve.
1.11.2 (2022-05-28:
no longer set "m_isGoingToDie" to 0, damage taken compute now rightly.
1.11.1 (2022-05-27:
use SDKHook_OnTakeDamageAlive instead of SDKHook_OnTakeDamage.
1.11.0 (2022-05-23 (rollback):
always set entprop "m_isGoingToDie" to 0, simplify cvars.
1.10.2 (2022-05-23:
minor improve.
1.10.1 (2022-05-22:
"automatic_healing_fix" now only works on both health lower than heal max and heal started(or done).
1.10.0 (2022-05-05:
better shove detection.
1.9.6 (2022-04-30:
minor improve.
1.9.5 (2022-04-28:
minor improve.
1.9.4 (2022-04-27:
"automatic_healing_harder" now exclude get vomit by boomer.
1.9.3 (2022-04-21:
minor improve.
1.9.2 (2022-04-17:
minor improve.
1.9.1 (2022-04-17:
minor improve.
1.9.0 (2022-04-17:
"automatic_healing_harder" now include any shove action.
1.8.3 (2022-04-05:
minor improve.
1.8.2 (2022-04-01 (reupload):
fix some cases not really taked damage but healing pause.
1.8.1 (2022-03-21:
minor improve.
1.8.0 (2022-03-21:
ignore "automatic_healing_fix" when survivor is at god frame.
1.7.3 (2022-03-20:
minor fix up.
1.7.2 (2022-03-19:
minor improve.
1.7.1 (2022-03-19:
minor improve.
1.7.0 (2022-03-19:
instantly health every round start.
1.6.9 (2022-03-17:
minor improve.
1.6.8 (2022-03-08:
minor improve.
1.6.7 (2022-03-03:
minor improve.
1.6.6 (2022-03-01:
minor improve.
1.6.5 (2022-02-26:
kill timer when client is not ingame.
1.6.4 (2022-02-25:
minor improve.
1.6.3 (2022-25-25:
"automatic_healing_harder" now exclude item throw of item is holdable;
1.6.2 (2022-02-20 (rollback):
minor fix up.
1.6.1 (2022-02-17 (rollback):
minor fix up.
1.6.0 (2022-02-14:
fix lack of "m_nSequence" of when survivor is get strike fly or stading up.
1.5.5 (2022-02-11:
"automatic_healing_harder" now include if someone get vomit by boomer.
1.5.4 (2022-02-11:
minor fix up.
1.5.3 (2022-02-09:
better way to remove internal heartbeat when is on thirdstrike.
1.5.2 (2022-02-08:
"automatic_healing_harder" now include if someone save a teammate from smoker by shove teammate.
1.5.1 (2022-02-08:
minor code update.
1.5.0 (2022-02-07:
add new cvar, fork another old plugin's function.
1.4.0 (2022-02-04:
stop healing while get strike fly or standing up.
1.3.0 (2022-01-31) (reupload && rollback):
stop healing while get pinned by special infecteds or get staggerd.
1.2.2 (2022-01-27):
change file name.
1.2.1 (2022-01-26):
init public release.
1.14.0 (2022-11-24:
add new cvar to control if it will emit tip sound when heal is done.
remove cvar "automatic_healing_keep_health_in_unhurt_conflict" since it not wokrs well in multiplay.
Plugin not reading config. Plugin works as far as auto healing but it is not reading the config. i changed the value to heal up to 39 but still only heals to 30.
Plugin not reading config. Plugin works as far as auto healing but it is not reading the config. i changed the value to heal up to 39 but still only heals to 30.