How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 1:57 pm
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 3:30 pm
by randi
You don't.
Re: How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 4:22 pm
by Ghastly
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 5:05 pm
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 6:03 pm
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.)
Re: How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 7:22 pm
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sat Jan 23, 2010 8:19 pm
by TimeOfDeath
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?
Posted: Sat Jan 23, 2010 8:47 pm
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 2:19 am
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 3:03 am
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.)
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 5:31 am
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.
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 7:23 am
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?
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 7:37 am
by Recurracy
Hm.. I was just thinking, and maybe I have an idea.
Actor FallingDoomplayer : Doomplayer replaces Doomplayer
{
DamageFactor "Medigun" -1 //Dunno if this works, haven't tested it
States
{
Pain:
PLAY G 0 A_JumpIfInventory("Mortallywounded",1,"Woundedpain")
PLAY G 4 A_JumpIfHealthLower(11,"Mortalwoundedinit")
PLAY G 4 A_Pain
Goto Spawn
Woundedpain:
PLAM IJKL 3
Goto Mortallywounded
MortalWoundedInit:
PLAH H 0 A_ChangeFlag("Nonshootable",1)
PLAH H 0 A_GiveInventory("Mortallywounded",1)
PLAH H 0 A_ChangeFlag("NoTarget",1)
PLAY H 10
PLAY I 10
PLAY J 10 A_NoBlocking
PLAY J 0 A_ChangeFlag("Nonshootable",0)
MortallyWounded:
PLAM ABCDEFGH 3
Pain.Medigun:
PLAM H 0 A_TakeInventory("Mortallywounded",999)
PLAM H 0 A_GiveInventory("Health",100)
PLAM MNOPQR 2
Goto Spawn
}
}
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 9:08 am
by InsanityBringer
I can only imagine how horribly wrong that hack will go
Re: How would I keep the player alive, even when health is 0?
Posted: Sun Jan 24, 2010 11:10 am
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.