Someone who knows Source fuckery explain this pls

Messages
6,966
Reaction score
18,108
Points
1,200
Location
North Rhine-Westphalia, Germany
thread because bored, rate whatever you freaks

This has been in the back of my mind since October 2017 when someone told me about this in-game and I tried it out.

Enabling and increasing Mouse Acceleration to a ridiculous value of '999999' makes your game unplayable. Back then it gave you drug like effects but today it's just a straight up blackscreen. It looked like this:
chRlSgK.jpeg



Now it looks like this:
The script errors are due to me trying to open the inventory.

Trying this in Singleplayer teleported my view to 0, 0, 0 and crashed my game after respawning.


my question is

why+how
 
Changing your sprint speed in lua to some weird value (that I cannot remember) also did this to me -
 
C++ is still just magic for me and i hate it, but my guess from the source code is that because the acceleration numbers are so big, you're setting the camera angles to something out of scope for source to handle. This is input source code from the 2013 SDK, dunno if garry's mod uses something extremely different.
Source: https://github.com/ValveSoftware/so...609d72a38efdf/sp/src/game/client/in_mouse.cpp
C++:
void CInput::MouseMove( CUserCmd *cmd )
{
    float    mouse_x, mouse_y;
    float    mx, my;
    QAngle    viewangles;

    // Get view angles from engine
    engine->GetViewAngles( viewangles );

    // Validate mouse speed/acceleration settings
    CheckMouseAcclerationVars();

    // Don't drift pitch at all while mouselooking.
    view->StopPitchDrift ();

    //jjb - this disables normal mouse control if the user is trying to
    //      move the camera, or if the mouse cursor is visible
    if ( !m_fCameraInterceptingMouse &&
         !vgui::surface()->IsCursorVisible() )
    {
        // Sample mouse one more time
        AccumulateMouse();

        // Latch accumulated mouse movements and reset accumulators
        GetAccumulatedMouseDeltasAndResetAccumulators( &mx, &my );

        // Filter, etc. the delta values and place into mouse_x and mouse_y
        GetMouseDelta( mx, my, &mouse_x, &mouse_y );

        // Apply scaling factor
        ScaleMouse( &mouse_x, &mouse_y );

        // Let the client mode at the mouse input before it's used
        g_pClientMode->OverrideMouseInput( &mouse_x, &mouse_y );

        // Add mouse X/Y movement to cmd
        ApplyMouse( viewangles, cmd, mouse_x, mouse_y );

        // Re-center the mouse.
        ResetMouse();
    }

    // Store out the new viewangles.
    engine->SetViewAngles( viewangles );
}

//-----------------------------------------------------------------------------
// Purpose:
// Input  : *mx -
//            *my -
//            *unclampedx -
//            *unclampedy -
//-----------------------------------------------------------------------------
void CInput::GetFullscreenMousePos( int *mx, int *my, int *unclampedx /*=NULL*/, int *unclampedy /*=NULL*/ )
{
    Assert( mx );
    Assert( my );

    if ( !vgui::surface()->IsCursorVisible() )
    {
        return;
    }

    int x, y;
    GetWindowCenter( x,  y );

    int        current_posx, current_posy;

    GetMousePos(current_posx, current_posy);

    current_posx -= x;
    current_posy -= y;

    // Now need to add back in mid point of viewport
    //

    int w, h;
    vgui::surface()->GetScreenSize( w, h );
    current_posx += w  / 2;
    current_posy += h / 2;

    if ( unclampedx )
    {
        *unclampedx = current_posx;
    }

    if ( unclampedy )
    {
        *unclampedy = current_posy;
    }

    // Clamp
    current_posx = MAX( 0, current_posx );
    current_posx = MIN( ScreenWidth(), current_posx );

    current_posy = MAX( 0, current_posy );
    current_posy = MIN( ScreenHeight(), current_posy );

    *mx = current_posx;
    *my = current_posy;
}

//-----------------------------------------------------------------------------
// Purpose:
// Input  : mx -
//            my -
//-----------------------------------------------------------------------------
void CInput::SetFullscreenMousePos( int mx, int my )
{
    SetMousePos( mx, my );
}
 
Changing your sprint speed in lua to some weird value (that I cannot remember) also did this to me -
I remember now if anyone knows a answer - I had the normal move speed and sprint speed set at the same values, I should probably test this again though now it’s brought up some interest
 
Back
Top