Author Topic: Fall Damage Settings  (Read 1284 times)

I want to make fall damage do more/less damage depending on the drop.
Is there any way I can do this?

if you are talking about fall damage not being constant, it already isn't
otherwise, yes, here's a crude way to modify fall damage; there's probably a better way but i'll just put this out for it to be improved

Code: [Select]
$fallDamageMultiplier = 2; //double fall damage

package smmDamagePackage {
function Armor::damage(%this, %obj, %src, %pos, %damage, %type) {
if (%type == $DamageType::Fall) {
%damage *= $fallDamageMultiplier;
}

return Parent::damage(%this, %obj, %src, %pos, %damage, %type);
}
};

activatePackage("smmDamagePackage");
as you can see i ripped this out of smm
if you want to change speed required for a fall to start damaging you'll have to change minImpactSpeed in the playerdata

Also in the playerdata, speedDamageScale also affects the damage ratio for falling damage.

Also in the playerdata, speedDamageScale also affects the damage ratio for falling damage.
yeah, totally overlooked that; you should probably use that instead of above code if you want it to be playertype specific, or you could just apply it to the default playertype if that's what you want

Yep. Also, he can package Armor::onImpact but I wouldn't recommend it. Although, I have no idea if he codes.

In terms, what the OP wants is possible, it's just the question of who wants to make it for him if he can't do it.

When I tried to make a playertype it didn't work but when I made a sound it worked.
I probably can't make this.

This... might actually be information I didn't know I needed to know but now that I think about it I really needed to know.

In the past I made a really wonky event system that would attach a variable to your player while at the top of a staircase and remove it once leaving the stair area. I already use a custom playertype for the game that build is on, so having fall damage start much sooner would be amazing.

If I were to put this into a playertype, what steps would I need to take? Is only the damage modifiable or is the distance also something that can be changed on a per-playertype basis?

No, but I'm sure you can still package Armor::onImpact to do this stuff and set variables on individual players, but on the datablock just make sure speedDamageScale is at 0 but leave everything else alone

Everyone uses that same datablock so if you modify it it'll affect everyone too.

Almost certain someone made this before.  Lemme see if I can find it.

Is this it?  Additionally, Port referenced something about it here.
« Last Edit: March 08, 2016, 06:06:29 PM by SWAT One »

Almost certain someone made this before.  Lemme see if I can find it.

Is this it?  Additionally, Port referenced something about it here.
I mean so you die if you fall a certain height and hit the ground.



Right, that would be
Did you even read it?
That's for dying in mid air, not when you hit the ground.

I also need a shortened fall damage.

Did you even read it?
That's for dying in mid air, not when you hit the ground.
Derp.

Well, in my other link, it includes details for adjusting that.  Not sure if that would help.

Also found my favorite quote regarding this.
dddown, the stai- OH MY GOD
« Last Edit: March 10, 2016, 04:40:28 AM by SWAT One »

Did anyone figure out a decent way to do it? I need it shortened to about 2 stories.