How would I keep the player alive, even when health is 0?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
How would I keep the player alive, even when health is 0?
For a mod I'm making, I'm trying to create some sort of hacky stuff that actually keeps the player alive even while his health is technically 0.
I want to do this, because I'm thinking of some cool tricks; revive the fallen player with some sort of medi-gun or something like that.
Help is greatly appreciated.
I want to do this, because I'm thinking of some cool tricks; revive the fallen player with some sort of medi-gun or something like that.
Help is greatly appreciated.
Re: How would I keep the player alive, even when health is 0?
When health hits 0 (Or below
), that's pretty much it. I don't think you can use a Death script to "revive" the player, since players are treated differently than monsters.

- Apothem
- Posts: 2070
- Joined: Sat Nov 29, 2003 7:13 pm
- Location: Performing open heart surgery on an ACS compiler.
Re: How would I keep the player alive, even when health is 0?
is there a way to prevent HP from going below 1? I've been wondering about the same thing myself, there were some interesting effects I wanted to try for.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: How would I keep the player alive, even when health is 0?
Console -> Buddha.Apothem wrote:is there a way to prevent HP from going below 1?
Like god mode, you can still be killed by extremely high damage. (10,000+ I think.)
Re: How would I keep the player alive, even when health is 0?
Buddha probably wouldn't help for Decorate/ACS effects. I've been thinking about how to accomplish this, myself, for a deathmatch powerup like the Relic of Redemption from Unreal Tournament.
-
- Posts: 57
- Joined: Sun Apr 09, 2006 12:54 pm
- Contact:
Re: How would I keep the player alive, even when health is 0?
If you use sector effect 4171, a player's health will never go below 1 in those sectors.
Re: How would I keep the player alive, even when health is 0?
Not too helpful for a generalized effect though.TimeOfDeath wrote:If you use sector effect 4171, a player's health will never go below 1 in those sectors.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: How would I keep the player alive, even when health is 0?
The closest I can give is an ACS option to enable the Buddha cheat.
A dead player is dead and that's it. Even the 'resurrect' cheat is just a hacky workaround that's not guaranteed to work in all cases.
A dead player is dead and that's it. Even the 'resurrect' cheat is just a hacky workaround that's not guaranteed to work in all cases.
- Kinsie
- Posts: 7402
- Joined: Fri Oct 22, 2004 9:22 am
- Graphics Processor: nVidia with Vulkan support
- Location: MAP33
- Contact:
Re: How would I keep the player alive, even when health is 0?
This would be useful, and I can think of at least one real-world situation where it would be useful (in one of Gooberman's old mods, there was a sequence where some explosions go off near the player, then it cuts to a cutscene to simulate getting KOed and getting back up. The first time I played, the explosions actually killed me, leading to the amusing sight of the player getting up, then the camera instantly flopping back down to his corpse.)Graf Zahl wrote:The closest I can give is an ACS option to enable the Buddha cheat.
Re: How would I keep the player alive, even when health is 0?
This is a very useful addition thank you. eg, in my Burghead mod, it is impossible to dodge enemy attacks whilst using the mounted minigun in the Inca headquarters, so it is very easy to lose loads of health and die. However, the minigun is mainly supposed to just be a bit of fun and I wanted the player to be able to use it. I worked around it with some ACS to check health and heal the player while he was using the gun but this new feature would have come in very handy had it been available then.
Re: How would I keep the player alive, even when health is 0?
Could there also be something to go with it to check when a player would have died, like activating a Death script?Graf Zahl wrote:The closest I can give is an ACS option to enable the Buddha cheat.
Re: How would I keep the player alive, even when health is 0?
Hm.. I was just thinking, and maybe I have an idea.
Spoiler: Some code
- InsanityBringer
- Posts: 3392
- Joined: Thu Jul 05, 2007 4:53 pm
- Location: opening the forbidden box
Re: How would I keep the player alive, even when health is 0?
I can only imagine how horribly wrong that hack will go
Re: How would I keep the player alive, even when health is 0?
The Wolf3DTC (by AFADoomer, IIRC) emulated the traditional 'dissolve to red' death of Wolfenstein 3D by actually treating the player as 'dead' if their health went below 50. The player had a maxhealth of 150. The status bar adjusted the display by subtracting 50 from the 'real' health before displaying it.
You could achieve something similar here, I'd guess.
You could achieve something similar here, I'd guess.
