ValveTime.co.uk | Valve News, Forums, Steam

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...
Back
Top