Garry's Mod

Garry's Mod

Regeneration Health and Armor (Server side)
103 Comments
Elliot-_- 14 Apr @ 6:40pm 
I'm noticing an issue related to armor regen addons, my armor randomly drops to an insanely low negative digits whenever i'm taking a lot of damage
UglyFour02 14 Apr @ 6:39am 
is possible to set to a single player, and not all is connected to the server?
for example set armor for xplayer to 100 and for yplayer only 10?
DolphinNotQA 11 Feb @ 7:43am 
Козах крут
A_Swarm_of_Wasps 31 Jul, 2024 @ 3:07pm 
you can still heal over it with medkits
linkclick  [author] 30 Jul, 2024 @ 11:58am 
Updated, added a setting to spawn with the amount of health you put as max
A_Swarm_of_Wasps 29 Jul, 2024 @ 7:15pm 
max health doesnt work i can still go over the limit. also can you add a setting to spawn with the amount of health you put as max?
Technical Difficulties 28 Jul, 2024 @ 7:54pm 
I wonder, would it be possible to set health/armor "breakpoints"? For example, if you wanted to regen up to the nearest multiple of 25, it would regen up to 100 if you only lost 20, but if you lost 40 it would only regen back up to 75.

It's not a big deal, but would be really neat to see, as it would still provide a major reason to use other, more direct healing items/addons such as stims or medpacks. That is, assuming that it isn't too much effort on your part.
linkclick  [author] 28 Jul, 2024 @ 10:15am 
Updated
gm_Redlerman16 28 Jul, 2024 @ 9:42am 
found this error, fix?

[Regeneration Health and Armor (Server side)] lua/includes/extensions/net.lua:154: bad argument #1 to 'pairs' (table expected, got nil)
1. pairs - [C]:-1
2. WriteTable - lua/includes/extensions/net.lua:154
3. SendConVars - lua/g4fregen/sv_regen.lua:43
4. unknown - lua/g4fregen/sv_regen.lua:92
Eipcorion 20 Jul, 2024 @ 4:21pm 
I changed my max health and it wasn't effected. I changed the regen time to zero and the shield regenerated instead. Something was definitely screwed up.
The Door to Guf 20 Jul, 2024 @ 12:15pm 
does nothing
ג҉א҉ָ҉ן҉ 13 Jul, 2024 @ 1:10pm 
small addon
caring creator
linkclick  [author] 11 Jul, 2024 @ 5:03pm 
Updated, fixed File was not delivered to the client
Ducky1234 11 Jul, 2024 @ 10:38am 
[Regeneration Health and Armor (Server side)] Couldn't include file 'g4fregen\cl_regen.lua' - File not found or is empty (@lua/autorun/g4fregen_init.lua (line 2))
1. unknown - lua/autorun/g4fregen_init.lua:2 what is this
Carlos Lopez 26 Jun, 2024 @ 5:09am 
Thank you so much!
linkclick  [author] 26 Jun, 2024 @ 2:29am 
Updated, fixed delay
Carlos Lopez 25 Jun, 2024 @ 11:45pm 
The update broke delays under 1. I usually use a delay of 0.01 with a regen of one health per 0.01 seconds to replicate call of duty's healing system, but now it can only do a minimum of 1 second delay. If you put the delay at a value under 1, it will only do a delay of 1 second.
linkclick  [author] 25 Jun, 2024 @ 12:50pm 
Updated, fixed darkui
E-Barb 25 Jun, 2024 @ 5:40am 
Why does this addon remove my black themein spawnmenu? :steamfacepalm:
LostSoul 22 Jan, 2024 @ 8:48am 
:steamthumbsup:
MakTima 13 Oct, 2023 @ 2:25pm 
It stopped walking backwards but, I still get the vignetta effect.
MakTima 13 Oct, 2023 @ 2:17pm 
This has never happened to me before, but I decided to have a little fun and cranked up regen to max, but then I got a vignetta effect, and then I started to walk backwards without pressing anything.
Searls 11 Jul, 2023 @ 10:28am 
It may not work with ragmod, but when i take damage while ragdolled it doesnt heal, even if i get up
linkclick  [author] 10 Jul, 2023 @ 11:14pm 
In which case?
Searls 10 Jul, 2023 @ 2:20pm 
why does this not work half the time?
linkclick  [author] 16 Jun, 2023 @ 10:11am 
you have an old version installed
[14e][LFA]Varian 16 Jun, 2023 @ 2:16am 
It possible to régénération affecte a only one job or player
Arcane Teuton 23 May, 2023 @ 5:48pm 
Well as I said, the following addons cause the issue:
NPC Health Regeneration by Hds46
TFA Base
Extinguishing Water by GaussTheWizard

And there are others, but these are some I have narrowed the issue down to. I don't necessarily know how each changes taking damage, all I know is that they cause issues with this addon.

These are the mods I have enabled for testing:
Ablative Armor by Arctic (how to test the bug and only take armor damage)
+
You can use one of any of the following, or all to trigger the bug:
NPC Health Regeneration
TFA Base
Extinguishing Water
linkclick  [author] 20 May, 2023 @ 10:08pm 
changed EntityTakeDamage to PostEntityTakeDamage, now it should work better but, tell me which addon changes taking damage
linkclick  [author] 20 May, 2023 @ 10:01pm 
Unfortunately, addons use their own methods of taking damage that are not documented in the gmod wiki, I tried to fix any conflicts by adding 'gaf' at the beginning of each function.
Arcane Teuton 20 May, 2023 @ 9:56pm 
Yours alone without any other addon interference works perfectly as of testing it today, but the fact it kind of gets troubled by some of the most popular addons (namely TFA base,) is a cause for concern.
Arcane Teuton 20 May, 2023 @ 9:56pm 
In testing Armor & Health Regeneration by Detox, it seems his addon has a problem very similar to what I have described here. The difference being, it is not caused by addons, and I have not seen any extra issues caused by addons. And the problem is slightly different, yet similar.

The delay is never called if your armor just takes damage. I've documented this on this addon. However, the difference is, that when you reach full armor and get damaged, it still regens, even though it doesn't activate the "delay after hurt" function after receiving pure armor damage. This is probably because the regeneration function is constantly running and never stops, it just cannot exceed max armor and health, while my guess is that your addon disables the regeneration once reaching max, and reactivates upon taking damage.
Arcane Teuton 20 May, 2023 @ 9:46pm 
I did the testing late last night so I don't remember if I did the standard "disable all mods except for the one you are testing." So it's possible that the previous way you had it could've worked. So I apologize for that.

However, I made sure to do it today, and for some reason this mod has an incompatibility with NPC Health Regeneration by Hds46. Despite the addon not seeming to affect player regeneration at all. It creates the issue I documented earlier.

TFA base also helps create the issue, as well as Extinguishing Water by GaussTheWizard. There are others, but I have spent quite a bit of time troubleshooting this far and I think there's a decent variety here already.
linkclick  [author] 19 May, 2023 @ 2:48pm 
All convars are automatically saved in (client.vdf or server.vdf), maybe you just deleted this file or reinstalled Garry's mod
[WindVex] 19 May, 2023 @ 1:51pm 
It didn't save my configurations for how fast it regenerates n stuff.

I don't know what could cause incompatibility in that area though.
linkclick  [author] 19 May, 2023 @ 5:02am 
Changed the PlayerHurt hook to EntityTakeDamage (should fix), changed the loops for faster work with a large number of players
Arcane Teuton 19 May, 2023 @ 1:06am 
Bug+: Oh, and probably very much related to the issue, if armor has started to regen, it will not trigger the delay upon taking damage, health has to take damage for the delay to start again.
Arcane Teuton 19 May, 2023 @ 1:02am 
Bug: It appears that the armor regeneration part of your mod only starts the delay countdown/triggers regen if it detects that health has been damaged. This makes it largely incompatible with addons like Arctic's Ablative Armor, since under such circumstances the armor never starts to regenerate unless the health takes at least one chip of damage.
Guavo 29 Apr, 2023 @ 9:48am 
idk what happened but ur update just fixed it i guess cause now i got the regen menu and it works so tyty. Hope you're having a good day and same to anyone else reading this! :8bitheart:
linkclick  [author] 28 Apr, 2023 @ 6:25pm 
Updated the version, added a red bar when activating maxplayer(health, armor)
Guavo 28 Apr, 2023 @ 4:49pm 
here i made a collection of all my mods https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2968544309 hope it helps :ccknight:
Guavo 28 Apr, 2023 @ 1:19pm 
how do i do that, i am very uneducated with how steam works or how to share the mods i have downloaded
linkclick  [author] 27 Apr, 2023 @ 11:23pm 
Share your collection so I can find out what went wrong
Guavo 27 Apr, 2023 @ 7:03pm 
nope just simply dont have it in the utilitys or any other tab, i reinstalled the mod twice and still nothing. I can use the commands though just would rather use the sliders tbh
linkclick  [author] 27 Apr, 2023 @ 2:47pm 
are there any errors in the console?
Guavo 27 Apr, 2023 @ 1:45pm 
the regeneration tab just doesnt show up, no idea why
linkclick  [author] 6 Feb, 2023 @ 11:07am 
and the fact that in brackets (true) and (false) is also just an explanation
linkclick  [author] 6 Feb, 2023 @ 11:05am 
sec it's just second, no need to write it to the console
linkclick  [author] 6 Feb, 2023 @ 11:03am 
gaf_armor_delay - 1sec
gaf_armor_hurtdelay - 10sec
gaf_armor - 1
gaf_armor_playermax - 0(false)
gaf_armor_enable - 1(true)
gaf_armor_adminonly - 0(false)
gaf_armor_maxarmor - 100

gaf_health_delay - 1sec
gaf_health_hurtdelay - 10sec
gaf_health - 1
gaf_health_playermax - 0(false)
gaf_health_enable - 1(true)
gaf_health_adminonly - 0(false)
gaf_health_maxhealth - 100
grimreapershoots 6 Feb, 2023 @ 10:54am 
What is the default settings of the armor and health regeneration?