Author Topic: What is the code for a playertype, that sets the falling damage?  (Read 519 times)

What is the code for a playertype that sets sorta, the falling damage? I don't mean like, I don't want this playertype to have fall damage. I want it to have different falling damage from different heights. Anyone know the code? Also I mean like the playertype from the bluzone, that has a less height for more falling damage.

You have to mess with playerTypeArmor::onImpact(%args, %unknown)

You have to mess with playerTypeArmor::onImpact(%args, %unknown)
What's playerTypeArmor, I'm still sorta new to code. Also what is the %unknown part.

What's playerTypeArmor, I'm still sorta new to code. Also what is the %unknown part.
like playerstandardarmor::onImpact
And idk the args

inb4portclearsproblem

.minImpactSpeed   (default 30)
This is how fast the player has to be moving to take falling damage.
.speedDamageScale   (default 3.8)
This is how much damage the player will take depending on how fast they're moving.

.minImpactSpeed   (default 30)
This is how fast the player has to be moving to take falling damage.
.speedDamageScale   (default 3.8)
This is how much damage the player will take depending on how fast they're moving.

So where would I put it in the code? Would it be in the like, canJet section, like that area? I mean like the default player variables.
Would I also remove the . on the start?

Heres all the arguments available

And idk the args
I think they are
Code: [Select]
%this,%obj,%col,%pos,%speed

When a player hits an object, if the magnitude of their velocity [1] is above or equal to the value of the minImpactSpeed field on the playertype, it calls playerDataBlockObject::onImpact. Otherwise, it calls playerDataBlockObject::onCollision. In ::onImpact, if it should deal falling damage (taking $Pref::Server::FallingDamage, mini-game falling damage, etc. into account) then it applies a specific amount of damage [2] to the player.



[1] vectorLen(velocity).
[2] The magnitude of their velocity multiplied by the value of the speedDamageScale field on the playertype.