Elite Square
Would you like to react to this message? Create an account in a few clicks or log in to continue.

increase walking speed by 5 and reduce fall damage by 30?

5 posters

Go down

increase walking speed by 5 and reduce fall damage by 30? Empty increase walking speed by 5 and reduce fall damage by 30?

Post  Wound Wed Jan 02, 2013 11:52 am

I need help to increase walking speed by 5 and reduce fall damage by 30 when picking up an item/model or whatever.

Thanks.
Wound
Wound
Blocklandian

Posts : 16
Join date : 2013-01-01
Age : 25
Location : USA

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Ipquarx Wed Jan 02, 2013 1:05 pm

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.
Ipquarx
Ipquarx
Blocklandian

Posts : 19
Join date : 2012-12-27
Age : 27
Location : Manitoba, Canada

http://www.Ipquarx.com

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Meshiest Wed Jan 02, 2013 6:27 pm

for fall damage, you will need to parent onImpact for armor
function PlayerArmorName::onImpact(%this, %b, %c, %d, %e, %f, %g)

Meshiest
Blocklandian

Posts : 68
Join date : 2013-01-02
Age : 26
Location : The Internet

http://marblemodz.forumotion.com

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Innocent Thu Jan 03, 2013 10:03 am

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 :)
Innocent
Innocent
Blocklandian

Posts : 17
Join date : 2012-12-31
Age : 28
Location : Montreal

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Honor Thu Jan 03, 2013 10:19 am

Very detailed explanation, thankyou Innocent.
Honor
Honor
Admin

Posts : 56
Join date : 2012-12-27
Age : 26

https://elitesq.forumotion.com

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Meshiest Thu Jan 03, 2013 9:39 pm

Innocent wrote:I've been around some tests and here's the variable for : function PlayerStandardArmor::onImpact(%this, %b, %c, %d, %e)
Let's use this for now:
function ArmorName::onImpact(%this, %player, %collisionObject, %velocity, %speed)

Meshiest
Blocklandian

Posts : 68
Join date : 2013-01-02
Age : 26
Location : The Internet

http://marblemodz.forumotion.com

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Innocent Fri Jan 04, 2013 6:42 pm

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
Innocent
Blocklandian

Posts : 17
Join date : 2012-12-31
Age : 28
Location : Montreal

Back to top Go down

increase walking speed by 5 and reduce fall damage by 30? Empty Re: increase walking speed by 5 and reduce fall damage by 30?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum