Overiding kJumpForce
Soul_Rider
Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
in Modding
The force used when a player is jumping is stored as a local variable in the JumpMoveMixin. I need to override the force as i have increased gravity. Although I have increased the players JumpHeight, he doesn't have sufficient force in the jump to reach the height.
In the code, the only example of a kJumpForce override is the Onos who sets Onos.kJumpForce = 20. I have tried this method, but my player does not jump any higher. By reducing the gravity slightly I got a bit more height.
I tried to set Avatar.kJumpForce = 100, but still no improvement. Does anyone know a good way to override this? I am not sure why it has been hidden away in a core mixin file, jump force is a very basic attribute to be modded, yet it appears difficult to mod.
In the code, the only example of a kJumpForce override is the Onos who sets Onos.kJumpForce = 20. I have tried this method, but my player does not jump any higher. By reducing the gravity slightly I got a bit more height.
I tried to set Avatar.kJumpForce = 100, but still no improvement. Does anyone know a good way to override this? I am not sure why it has been hidden away in a core mixin file, jump force is a very basic attribute to be modded, yet it appears difficult to mod.
Comments
local kStrafeJumpForce = 1 local kStrafeJumpDelay = 0.7 function Marine:ModifyJump(input, velocity, jumpVelocity) local isStrafeJump = input.move.z == 0 and input.move.x ~= 0 if isStrafeJump and self:GetTimeGroundTouched() + kStrafeJumpDelay < Shared.GetTime() then local strafeJumpDirection = GetNormalizedVector(self:GetViewCoords():TransformVector(input.move)) jumpVelocity:Add(strafeJumpDirection * kStrafeJumpForce) jumpVelocity.y = jumpVelocity.y * 0.8 self.strafeJumped = true else self.strafeJumped = false end jumpVelocity:Scale(self:GetSlowSpeedModifier()) end