Immunity to Hexen Fall damage

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Immunity to Hexen Fall damage

Postby 4page » Thu Nov 07, 2019 6:49 pm

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?
User avatar
4page
 
Joined: 06 Aug 2019

Re: Immunity to Hexen Fall damage

Postby Void Weaver » Fri Nov 08, 2019 5:17 am

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
}
User avatar
Void Weaver
Keeper of the Diablo bestiary storage Also amateur DECORATE-spaghetti weaver ಠ_ಠ
 
Joined: 18 Dec 2014

Re: Immunity to Hexen Fall damage

Postby 4page » Sat Nov 09, 2019 9:33 pm

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.
User avatar
4page
 
Joined: 06 Aug 2019

Re: Immunity to Hexen Fall damage

Postby Void Weaver » Sun Nov 10, 2019 3:16 am

Yeah, check for floorz are interferes here, so only VelZ check needed.
User avatar
Void Weaver
Keeper of the Diablo bestiary storage Also amateur DECORATE-spaghetti weaver ಠ_ಠ
 
Joined: 18 Dec 2014

Re: Immunity to Hexen Fall damage

Postby Blue Shadow » Mon Nov 11, 2019 2:40 pm

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.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Immunity to Hexen Fall damage

Postby Void Weaver » Mon Nov 11, 2019 3:21 pm

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.
User avatar
Void Weaver
Keeper of the Diablo bestiary storage Also amateur DECORATE-spaghetti weaver ಠ_ಠ
 
Joined: 18 Dec 2014

Re: Immunity to Hexen Fall damage

Postby 4page » Mon Nov 11, 2019 5:47 pm

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.
User avatar
4page
 
Joined: 06 Aug 2019


Return to Scripting

Who is online

Users browsing this forum: Kappes Buur and 1 guest