Log in to reply
 

[SCRIPT][REL]Manual Transmission & Steering Wheel Support



  • This post is deleted!


  • First I just replaced the gears.asi file and was still expecting the same bug but after replacing all the other files it disappeared now, so great :).
    Since you seem to be still a little bit active on this I would like to mention another tiny thing althoug I believe it's rather like a wrong setup by myself than a bug of your mod: I used your mod menu to toggle the horn to the playstation button on the G29 wheel and it works just fine on normal vehicles. But on emergency vehicles or police car when I press the horn nothing happens besides of the horn pressing animation in fpv. No sound, no sirens, nothing. Do you have any solution for this? Thanks again for your kind help.



  • @JohnDoey72
    Hmm, just the .asi should've fixed things, but it's okay as long as it ends up working :P

    I usually use the WheelToKeyboard function to map stuff like sirens, e.g. map it to the keyboard "E".



  • I'm struggling with figuring out a few aspects of the script, hope anybody can shine some light onto it. Also hope I can explain it well enough.

    Understeer:

    When the car is understeering, the script should take appropriate action. Means the following for these two situations:

    • Force feedback: Grip drops, so the steering wheel should be lighter.
    • Stability Control: Understeer, so a wheel should be braked to correct for this.

    The "action" side works well, but the "detect" side is crude and inaccurate.

    Currently I do the following to figure out if the vehicle is understeering:

            // Gather data
            float speed = ENTITY::GET_ENTITY_SPEED(g_playerVehicle);
            Vector3 vecNextSpd = ENTITY::GET_ENTITY_SPEED_VECTOR(g_playerVehicle, true);
            Vector3 rotVel = ENTITY::GET_ENTITY_ROTATION_VELOCITY(g_playerVehicle);
    
            // Translate rotation around Z into a forward vector, rotated by how fast it is turning.
            Vector3 rotRelative{
                speed * -sin(rotVel.z), 0,
                speed * cos(rotVel.z), 0,
                0, 0
            };
    
            // Combine speed vector and rotation vector to get an average vector containing both speed and rotation.
            Vector3 vecNextRot = (vecNextSpd + rotRelative) * 0.5f;
    
            // Where I expect the car to be from steering input
            Vector3 vecPredStr{
                speed * -sin(avgAngle / g_settings.Wheel.Steering.SteerMult), 0,
                speed * cos(avgAngle / g_settings.Wheel.Steering.SteerMult), 0,
                0, 0
            };
    
            // Actual understeering angle is the difference between what we expect from input versus how the car is turning 
            float understeerAngle = GetAngleBetween(vecNextRot, vecPredStr);
    
            float dStrSpd = Distance(vecPredStr, vecNextSpd);
            float dStrRot = Distance(vecPredStr, vecNextRot);
            float dSpdRot = Distance(vecNextSpd, vecNextRot);
            
            // Only understeering if the steering vector is outside the forward and rotational vectors, 
            // to account for oversteer and rear wheel slip angles
            if (dStrSpd > dSpdRot) {
    
                // Finally apply a minimum amount of understeer to do something.
                if (abs(understeerAngle) > deg2rad(g_settings.DriveAssists.ESPUnderMin)) {
                    espUndersteer = true;
                }
            }
    

    This works well, until the vehicle is transitioning from one rotation direction to another:

    1. The steering vector "leads", and is outside the range. This can be filtered out by looking if both vectors are on the same side of the speed vector.
    2. The rotation vector catches up, and goes past the speed vector, and is between the steer vector and speed vector now. Here, understeer is detected.
    3. The rotation vector has caught up and the rotation-speed vectors now are "around" the steer vector again, no understeer.

    Images:

    • Blue = speed vector
    • Green = steer vector
    • Red = rotation+speed vector

    Normal understeer.
    Normal understeer

    Understeer during transition - which should not be registered. All the data looks the same as normal understeering, aside from the fact the weight is still shifting.
    Wrong understeer

    Anybody has an idea on how to detect and filter for this?



  • I got the wheel working fine, and the shifter layout set but it wont shift into gear. The mod keeps going back to sequential.



  • My steering wheel model is Thrustmaster Ferrari 458 Spider.
    GTA5 is epic games version.
    Wheel is not getting detected in game. (Windows 10 detected it and installed drivers correctly)

    I copied the files from below zip files to my GTA5 install directory along with ScriptHookV.dll
    ScriptHookVDotNet.zip
    ScriptHookV_1.0.1868.4.zip
    98783d-Gears-v4.7.1-Release.zip

    while in game pressing ({[) bring up the menu, but no wheel detected.



  • Hi just wondering if I can use my xbox one controller for this as I don't have a wheel? Thanks



  • @04edwakei
    Yeah it's got controller support.



  • @ikt OK mate thankyou I'll give it ago, and don't listen to people like OmegaRock the dude is clearly a fucktard it takes a lot of time and effort to create mods for any game let alone gta and people to don't do something correctly in open iv or have conflicting mods and simply don't have the brain power to work things out and just attack the mod author with posts like that, anyway lol 😂 😂 thankyou



  • Launch control:

    The explody anti-lag stuff is in TurboFix. I probably have to expand the TurboFix API to allow enabling/disabling the anti-lag to make it controllable from Manual Transmission, or I could cheap out with simple keybinds. We'll see.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.