Jump speed and height boosting

R

Red15

Guest
I've been trying to change the height and speed you get when jumping...

I was unable to get anything working that was visible in the game itself... :'(

Let me eplain what I tried :

In game_shared\gamemovement.cpp

Line 46:
Code:
bool g_bMovementOptimizations = false;

I've set this boolean to false, otherwise
the g_bMovementOptimizations makes some other functions
use constant variables to determine how high you jump.

For example:
Line 1940:
Code:
	float flMul;
	if ( g_bMovementOptimizations )
	{
#if defined(HL2_DLL) || defined(HL2_CLIENT_DLL)
		Assert( sv_gravity.GetFloat() == 600.0f );
		flMul = 160.0f;	// approx. 21 units.
#else
		Assert( sv_gravity.GetFloat() == 800.0f );
		flMul = 268.3281572999747f;
#endif

	}
	else
	{
		flMul = sqrt(2 * sv_gravity.GetFloat() * GAMEMOVEMENT_JUMP_HEIGHT);
	}

As you can see, I want the "else" clause to get to work, otherwise some fixed number is used.
I've also adapted GAMEMOVEMENT_JUMP_HEIGHT to my wishes.
This can be found in game_shared\gamemovement.h around line 24.

Just above this line I have also adjusted the time to jump.
For example, in the SDK itself they use 21.0f for jumpheight. I wanted 64.0f. The GAMEMOVEMENT_JUMP_TIME they use is 510.0f.
So I've scaled both equally up.

so :
Code:
64.0f * (510.0f / 21.0f) = new GAMEMOVEMENT_JUMP_TIME
Which makes 1555.0f.

And _still_ I jump only jey high... :(

I'm so puzzled by this...

If anyone could help...
 
All the g_bMovementOptimizations does is assume its a certain gravity, and skips the calculation. If you wont be using different gravitys, why not alter the flMul directly? If 160 is 21 units, then 64 would be around 480.
 
dawdler said:
All the g_bMovementOptimizations does is assume its a certain gravity, and skips the calculation. If you wont be using different gravitys, why not alter the flMul directly? If 160 is 21 units, then 64 would be around 480.

Actually I want to be able to use different gravities, that's why I only adjust/play around with the parameters which calculate flMul.
 
well you can always assume different preset gravs, heh.
 
So anyway,
I've tried adjusting flMul but to no avail,
nothing changed in jump height...

I'm trying to start from scratch now.

Oh btw, I've been ill last week so that's why it took so long for me to reply/actually try out the suggestion.
 
I've been messing about with this adding rocketboots. I'll have a look when I get home.

use DevMsg("%f",flMul); to check flMul (or other variables). Makes a very effective debugging tool (run mod using the run_mod.bat file).
 
Back
Top