increase walking speed by 5 and reduce fall damage by 30?
5 posters
Elite Square :: Blockland :: Coding Help
Page 1 of 1
increase walking speed by 5 and reduce fall damage by 30?
I need help to increase walking speed by 5 and reduce fall damage by 30 when picking up an item/model or whatever.
Thanks.
Thanks.
Wound- Blocklandian
- Posts : 16
Join date : 2013-01-01
Age : 25
Location : USA
Re: increase walking speed by 5 and reduce fall damage by 30?
Well first, you'd need to have a seperate player datablock in order to have the walking speed increase, and I'm not sure about the fall damage, but I think that's also controlled by the player datablock.
Re: increase walking speed by 5 and reduce fall damage by 30?
for fall damage, you will need to parent onImpact for armor
function PlayerArmorName::onImpact(%this, %b, %c, %d, %e, %f, %g)
function PlayerArmorName::onImpact(%this, %b, %c, %d, %e, %f, %g)
Re: increase walking speed by 5 and reduce fall damage by 30?
I've been around some tests and here's the variable for : function PlayerStandardArmor::onImpact(%this, %b, %c, %d, %e)
%this = The datablock (in this case "PlayerStandardArmor")
%b = The player
%c = The object you've hit; can be FxPlane, A brick, A player...
%d = The velocity at wich you've hit the wall. (Only the one via you've hit the wall will have a value) Because this one might be hard to understand, I'ma make examples:
If you hit the FxPlane in diagonal, only the third velocity will have a value.. Even if you were dashing foward. ("0 0 ?")
If you hit a wall, only the velocity in the direction of the brick will have a value so: ("? 0 0") or ("0 ? 0")
%e = The "Speed".. The relative ? from %d.. Use this one
I've made an experience, to know what dmg it would do relatively to the velocity you hit the wall.. The formula is exponantial.. I can't give you an EXACT number..
But my 1st experience gave me the multipler 2.88767 (Velocity * MULTIPLIER = damage)
And my 2nd experience gave me the multiplier 2.84999
So, knowing that:
I see 2 way to remove 30 dmg from the impact:
1st. addhealth(30); to the player who just had an impact ( The problem is, if he died, the addhealth(30) won't do shit.
2nd. modify the value of %e to %e -= 10; (30 divided by the multiplier wich is APPROX. 3)
PS: Sorry if my english sucks.. I'm french soz :P Anyway, I've hope you understood everything :)
%this = The datablock (in this case "PlayerStandardArmor")
%b = The player
%c = The object you've hit; can be FxPlane, A brick, A player...
%d = The velocity at wich you've hit the wall. (Only the one via you've hit the wall will have a value) Because this one might be hard to understand, I'ma make examples:
If you hit the FxPlane in diagonal, only the third velocity will have a value.. Even if you were dashing foward. ("0 0 ?")
If you hit a wall, only the velocity in the direction of the brick will have a value so: ("? 0 0") or ("0 ? 0")
%e = The "Speed".. The relative ? from %d.. Use this one
I've made an experience, to know what dmg it would do relatively to the velocity you hit the wall.. The formula is exponantial.. I can't give you an EXACT number..
But my 1st experience gave me the multipler 2.88767 (Velocity * MULTIPLIER = damage)
And my 2nd experience gave me the multiplier 2.84999
So, knowing that:
I see 2 way to remove 30 dmg from the impact:
1st. addhealth(30); to the player who just had an impact ( The problem is, if he died, the addhealth(30) won't do shit.
2nd. modify the value of %e to %e -= 10; (30 divided by the multiplier wich is APPROX. 3)
PS: Sorry if my english sucks.. I'm french soz :P Anyway, I've hope you understood everything :)
Innocent- Blocklandian
- Posts : 17
Join date : 2012-12-31
Age : 28
Location : Montreal
Re: increase walking speed by 5 and reduce fall damage by 30?
Very detailed explanation, thankyou Innocent.
Re: increase walking speed by 5 and reduce fall damage by 30?
Let's use this for now:Innocent wrote:I've been around some tests and here's the variable for : function PlayerStandardArmor::onImpact(%this, %b, %c, %d, %e)
function ArmorName::onImpact(%this, %player, %collisionObject, %velocity, %speed)
Re: increase walking speed by 5 and reduce fall damage by 30?
Meshiest wrote:Let's use this for now:
function ArmorName::onImpact(%this, %player, %collisionObject, %velocity, %speed)
Thanks :) Wasn't sure on what to name them ;p
And thanks honor :D
Innocent- Blocklandian
- Posts : 17
Join date : 2012-12-31
Age : 28
Location : Montreal
Elite Square :: Blockland :: Coding Help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|