Editing Falling Damage

  • Thread starter Thread starter Tokette
  • Start date Start date
T

Tokette

Guest
Is there a way to nullify the falling damage when the player crouch jumps or if they are crouched when they land?
I multiplied the jump height by 4 on the crouch jump but when you fall back down to the ground, you take about 30 damage. :(
 
Im also looking for something similar, but not so complex.

I simply want to increase falling damage, so it's much more realistic and doesnt start at 10 dmg.

Tokette, i assume you would just have to declare an integer, set its value in the crouch event and then reset the value after crouching.

You would then place this variable in your falling damage code, but i just cant find it myself.
 
They have a thing in FortressForever where (as a Spy) if you crouch when you fall, you recieve 1/2 damage. I take it that this is the type if thing your looking for. I will look into this.
 
I found it! its in gamemovement.cpp. You just go down to the CheckFalling() function and you can edit the falling damage through that by changing the fvol float. (I think thats the right variable...) This is what I did, it simply stops the falling damage and tips their view forwards but only if theyre falling fast enough to get hurt and crouched. I added this code right at the beginning.
Code:
 if( player->IsDucking() || player->IsDucked() )
	{
		if( player->GetGroundEntity() != NULL && player->m_Local.m_flFallVelocity > PLAYER_MAX_SAFE_FALL_SPEED )
		{
			player->m_Local.m_flFallVelocity = 0;
			player->m_Local.m_vecPunchAngle.Set( PITCH, 160 );
			return;
		}
	}
 
Ok, i've been playing with this a little now.

I've basically increased the damage multiplier (so that you fall from a lower height and take damage) but i havnt been able to find how to edit the lower bounds (damage starting at 10 from a fairly high height).

Anyone know how i would go about lowering this lower bound?
 
Back
Top