How would I keep the player alive, even when health is 0?

Archive of the old editing forum
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.
User avatar
Recurracy
Posts: 559
Joined: Fri Dec 19, 2008 12:11 pm

How would I keep the player alive, even when health is 0?

Post by Recurracy »

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.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: How would I keep the player alive, even when health is 0?

Post by randi »

You don't.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: How would I keep the player alive, even when health is 0?

Post by Ghastly »

When health hits 0 (Or below :P), 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.
User avatar
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?

Post by Apothem »

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.
User avatar
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?

Post by NeuralStunner »

Apothem wrote:is there a way to prevent HP from going below 1?
Console -> Buddha.

Like god mode, you can still be killed by extremely high damage. (10,000+ I think.)
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: How would I keep the player alive, even when health is 0?

Post by Ghastly »

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.
TimeOfDeath
Posts: 57
Joined: Sun Apr 09, 2006 12:54 pm
Contact:

Re: How would I keep the player alive, even when health is 0?

Post by TimeOfDeath »

If you use sector effect 4171, a player's health will never go below 1 in those sectors.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: How would I keep the player alive, even when health is 0?

Post by Ceeb »

TimeOfDeath wrote:If you use sector effect 4171, a player's health will never go below 1 in those sectors.
Not too helpful for a generalized effect though.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
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?

Post by Graf Zahl »

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.
User avatar
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?

Post by Kinsie »

Graf Zahl wrote:The closest I can give is an ACS option to enable the Buddha cheat.
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.)
User avatar
Enjay
 
 
Posts: 27115
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How would I keep the player alive, even when health is 0?

Post by Enjay »

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.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: How would I keep the player alive, even when health is 0?

Post by Ghastly »

Graf Zahl wrote:The closest I can give is an ACS option to enable the Buddha cheat.
Could there also be something to go with it to check when a player would have died, like activating a Death script?
User avatar
Recurracy
Posts: 559
Joined: Fri Dec 19, 2008 12:11 pm

Re: How would I keep the player alive, even when health is 0?

Post by Recurracy »

Hm.. I was just thinking, and maybe I have an idea.
Spoiler: Some code
User avatar
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?

Post by InsanityBringer »

I can only imagine how horribly wrong that hack will go
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: How would I keep the player alive, even when health is 0?

Post by Skippy »

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. :|
Locked

Return to “Editing (Archive)”