1. Post #1
    Gold Member
    ducky5's Avatar
    April 2008
    1,475 Posts
    is there any way i can make it so that mp_falldamage 1 is always on? i know there is a auto run file but i want to make sure i'm doing it right
    Reply With Quote Edit / Delete Reply United States Show Events Artistic Artistic x 1 (list)

  2. Post #2
    ImageShack®'s Avatar
    July 2008
    4 Posts
    Add mp_falldamage 1 to autoexec.cfg or to server.cfg.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 2 (list)

  3. Post #3
    Gold Member
    ducky5's Avatar
    April 2008
    1,475 Posts
    and were do i find that?
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1 (list)

  4. Post #4
    Gold Member
    Aptann's Avatar
    March 2005
    260 Posts
    Shockingly enough in the folder labeled "cfg"
    Reply With Quote Edit / Delete Reply Show Events Funny Funny x 1Winner Winner x 1 (list)

  5. Post #5
    Gold Member
    ducky5's Avatar
    April 2008
    1,475 Posts
    can i also put that in console?

  6. Post #6
    Gold Member
    SBII Gunz's Avatar
    June 2008
    882 Posts
    ducky5 posted:
    can i also put that in console?


    yes.

  7. Post #7
    Holay3's Avatar
    October 2009
    8 Posts
    yay thanks :D

  8. Post #8
    AcidSoldier's Avatar
    July 2008
    543 Posts
    falldamage never does it properly for me.

  9. Post #9
    CptFuzzies's Avatar
    June 2007
    638 Posts
    Hold on... lemme strip some code real quick.

    Edited:

    C++ to Lua conversion straight from the Source SDK, to restore proper fall damage. :snoop:
    This fix is already present in GM+, this is the code straight from it.

    // HL2 has 600 gravity by default
    // NOTE: The discrete ticks can have quantization error, so these numbers are biased a little to
    // make the heights more exact
    PLAYER_FATAL_FALL_SPEED		= 922.5 // approx 60 feet sqrt( 2 * gravity * 60 * 12 )
    PLAYER_MAX_SAFE_FALL_SPEED	= 526.5 // approx 20 feet sqrt( 2 * gravity * 20 * 12 )
    PLAYER_LAND_ON_FLOATING_OBJECT	= 173 // Can fall another 173 in/sec without getting hurt
    PLAYER_MIN_BOUNCE_SPEED		= 173
    PLAYER_FALL_PUNCH_THRESHOLD = 303.0 // won't punch player's screen/make scrape noise unless player falling at least this fast - at least a 76" fall (sqrt( 2 * g * 76))
    DAMAGE_FOR_FALL_SPEED		= 100.0 / ( PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED ) // damage per unit per second.
    
    
    

    if ( SERVER ) then game.ConsoleCommand( "mp_falldamage 1\n" ) end
    
    //=========================================================
    //=========================================================
    local function FlPlayerFallDamage( pPlayer, m_flFallVelocity )
    	local iFallDamage = server_settings.Bool( "mp_falldamage", 1 );
    
    	if ( iFallDamage ) then
    		m_flFallVelocity = m_flFallVelocity - PLAYER_MAX_SAFE_FALL_SPEED;
    		return m_flFallVelocity * DAMAGE_FOR_FALL_SPEED;
    	else
    		return 10;
    	end
    end
    
    hook.Add( "GetFallDamage", "FlPlayerFallDamage", FlPlayerFallDamage )
    
    
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 1Disagree Disagree x 1Lua Helper Lua Helper x 1 (list)

  10. Post #10
    Wolf Seril's Avatar
    August 2008
    24 Posts
    mp_falldamage also does not work for me. How do I use ^that code to fix it?

  11. Post #11
    Reposting BUG threads since 2011!
    TehBigA's Avatar
    March 2007
    426 Posts
    mp_falldamage also does not work for me. How do I use ^that code to fix it?
    It's not really a "fix," it is just how it works now. Garry should have put the Source default calculation in the base gamemode but obviously he didn't.

    Put this code into a Lua file under lua/autorun/*.lua:
    // Uses the default values from Source
    function MPFallDamage( ply, vel )
    	if GetConVarNumber("mp_falldamage") == 1 then
    		vel = vel - 580
    		return vel*(100/(1024-580))
    	end
    	return 10
    end
    hook.Add( "GetFallDamage", "MPFallDamage", MPFallDamage )
    
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 2 (list)

  12. Post #12
    Wolf Seril's Avatar
    August 2008
    24 Posts
    That worked, thanks.

  13. Post #13
    Gold Member
    Pizhik's Avatar
    October 2012
    127 Posts