New Health System V3 (SetMaxHealth, AddMaxHealth)

Author Topic: New Health System V3 (SetMaxHealth, AddMaxHealth)  (Read 13994 times)

I decided to share this method I made for my RPG mod.

The new system includes the following events:

- Adds max health to the object, can be subtracted too (less than 1 will go back to 1), you can refill the health if needed.
- Sets the max health of the object.
- Their max health is at 0 (invincible) for # seconds.

These work for bots, vehicles, and players.

The new %shapebase.getHealth() and %shapebase.getMaxHealth() support will tell if it will use "real" health or datablock health. This can be very useful.
There is a health saver, but you can also disable it by /ToggleHealthSaver. It's save path is in: config/server/MaxHealth/*

Download Zzerver_NewHealth
These also overwrite vce's health crap since this mod will obviously not work with it. This is Zzerver_* because it will be most likely the first to exec.

Mod's listed below that use this mod to support (means if this mod is installed the health system will work correctly with this mod, otherwise, it will be glitchy):
Weapon_TF2MedicPack

Please fill out the name of the mod, and the link to it, so I can fix it to have this support.

There is a difference using the real health system and this one, it is pretty obvious, but I like how this one is a lot better.

---Updates---
V1: Crappy health system

-v2-
+ New release, remodded, cleaned up code.

-v2.1-
+ Mini tweaks to the kill function, and the addHealth function.

-v2.15-
+ Fixed the health functions instead of ShapeBase, since it doesn't work that way.

-v3-
+ Added a save script to save and load health. If you have this mod, I suggest not using it if you have this mod since it already exists. It can be disabled by /ToggleHealthSaver. -> This was requested before the other topic was made
« Last Edit: April 12, 2015, 12:01:14 PM by Advanced Bot »

Woah cool, this is useful.


I love you :D

marry meh pls

Oh boy this is so useful, thanks a lot!

will it fake kill brick or make it disapear to -1?


will it fake kill brick or make it disapear to -1?
not the brick, the player/vehicle

Why is it a System_ mod? Those are large game-changing things like RTB. Name it either Event_, Server_, or Script_.

Why is it a System_ mod? Those are large game-changing things like RTB. Name it either Event_, Server_, or Script_.

He could just call it asdasdsgd_ if he wanted to.

I decided to share this method I made for my RPG mod.

The new system includes the following events:

- Adds max health to the object, can be subtracted too (less than 1 will go back to 1), you can refill the health if needed.



I'm guessing the checkbox beside the addplayerhealth is for restoring health?

This is nice, however overwriting that many functions could break other add-ons. You should use the Support_Preload to overwrite the functions before any other add-on.