Page 1 of 1

Immunity to Hexen Fall damage

PostPosted: Thu Nov 07, 2019 6:49 pm
by 4page
I'd like to avoid ACS or Zscript if possible, but if there's no other options I may have to branch out. So, I've tried to use a PowerProtection inherited item to make the player immune to fall damage, and it works like a charm. However, Hexen has a weird thing about it that it doesn't matter what kind of damage protection you use, at least from what I've found, if you're falling fast enough and hit the floor, it insta kills you. The only way I can figure to negate this so far is to just constantly check the players height against the floor, but even then it would be really hacky and complicated. Is there some easier and simpler way that I'm missing?

Re: Immunity to Hexen Fall damage

PostPosted: Fri Nov 08, 2019 5:17 am
by Void Weaver
Yep, for a some reason DamageFactor "Falling", 0.0 doesn't prevent from getting instakill damage (aka Minimum kill speed), which will guaranteed inflicted after reaching VelZ = -63. So you should be sure that player's VelZ will be less than -63 when landing will happen:
Code: Select allExpand view
ACTOR FallDmgProtector : CustomInventory
{
//+INVENTORY.UNCLEARABLE
+INVENTORY.KEEPDEPLETED
Inventory.MaxAmount 1
States
{
Spawn:
TLGL A 1 Bright
TLGL B 1
TLGL C 1 Bright
TLGL D 1
Loop

Pickup:
Use:
TNT1 A 0 A_GiveInventory("PowerFallingProtection")
TNT1 A 0 A_Overlay(5,"CriticalSpeedHandler",1) //Also you can call overlay directly from custom player's Spawn state, instead of CustomInventory.
Stop

CriticalSpeedHandler:
TNT1 A 1
{
If(VelZ<=-63){A_ChangeVelocity(VelX,VelY,-60,CVF_RELATIVE|CVF_REPLACE);Return state("");}
Else{Return state("");}
}
Wait
}
}

ACTOR PowerFallingProtection : PowerProtection
{
//+INVENTORY.UNCLEARABLE
DamageFactor "Falling", 0.0
Powerup.Duration 0x7FFFFFFF
}

Re: Immunity to Hexen Fall damage

PostPosted: Sat Nov 09, 2019 9:33 pm
by 4page
Ooof. That's a frustrating limitation. Thanks for the tips, though. I figured out a mild workaround that involved checking the distance between the player and the floor and if it was within the VelZ range, then adjusting the Velz to be slightly less than the distance between the player and the ground. Worked great until I found out that it didn't work on actors and you could still be instakilled by landing on top of them. Back to the drawing board, I guess.

Re: Immunity to Hexen Fall damage

PostPosted: Sun Nov 10, 2019 3:16 am
by Void Weaver
Yeah, check for floorz are interferes here, so only VelZ check needed.

Re: Immunity to Hexen Fall damage

PostPosted: Mon Nov 11, 2019 2:40 pm
by Blue Shadow
4page wrote:However, Hexen has a weird thing about it that it doesn't matter what kind of damage protection you use, at least from what I've found, if you're falling fast enough and hit the floor, it insta kills you.

What happens here is that the game does one million points of damage (referred to as "telefrag damage") upon hitting the floor. It's treated specially, and is meant to guarantee a death. That's why your powerup had no effect in protecting you from the fall in that case.

Although it's not a perfect solution, since its effect is universal, you can set the LAXTELEFRAGDMG flag on the player. The flag will allow the powerup to function as normal and do its thing.


If compatibility with Zandronum isn't important, you should really consider using ZScript. Lack of knowledge or laziness are weak excuses for not using it, if you ask me.

Re: Immunity to Hexen Fall damage

PostPosted: Mon Nov 11, 2019 3:21 pm
by Void Weaver
Wow! That's make sense, thank you for that tip. :)
Anyway the overlay above work for this goal like as swiss watch and prevent from taking lethal damage.

Re: Immunity to Hexen Fall damage

PostPosted: Mon Nov 11, 2019 5:47 pm
by 4page
If compatibility with Zandronum isn't important, you should really consider using ZScript. Lack of knowledge or laziness are weak excuses for not using it, if you ask me.


It's not important, but I started this mod with DECORATE and I want to finish it with DECORATE, or at least get it to a point where I don't know what else to do with it, then start learning zscript. I'll probably end up porting my mod to zscript as I learn and find better ways to do things. That's the plan at least.