• Blurring the line between real and virtual motorsports
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Control clutch from script.

Discussion in 'Racer' started by clrokr, Nov 20, 2012.

  1. Hey guys,

    is there any way to change the clutch application value? There is a way to change brake and accelerator values, why not for the clutch?

  2. Hi Clemens,

    What exactly do you want to change?

    Currently in Racer the clutch is engaged/disengaged linearly over the time set in the gear change parameters.

    The clutch engagement force is set in the clutch value itself. Ie, you can set a super strong clutch at 1000Nm, and if your car only transmits 500Nm then it will lock up half way through the clutch engage/disengage time.

    If you set the clutch at 500Nm then it will take the full clutch time to fully lock.

    You can also adjust the linearity of the clutch pedal input via the controller.ini file if you have a clutch pedal, so you can make it sharp responding or slow responding vs input amount.

    Unless it's something else you want to do?

    Could you be more specific by explaining what you want to do and why you can't do it currently?


  3. Hi Dave,

    i'm sorry for my bad english. In QScript, i can do this:

    set $car throttle 0.3

    I want to do the same to the clutch.

  4. The topic title is "control clutch from script". There are two functions for setting throttle and brake. He's asking if there is a "set (rcar) clutch (float)" function. I know there is one for getting the clutch value, but not for setting it.
  5. In both case, it won't be effective for car's scripts :(
    only on track's ones (i guess...)
    It would be nice to tweak them with car scripts too :p
  6. Exactly. I switch to neutral as a workaround, but I would love to use the clutch properly.

    Maybe if i switch between neutral and the actual gear fast enough, i can achieve some kind of pulse width modulation? Or would this just mess with the physics?
  7. So, since Racer is under Creative Commons, i tried changing a script function in memory i never use to achieve desired functionality. So change this:
    0052AE18 mov edx, [esi+0x1A4]
    0052AE1E fld dword ptr [edx+0x784]
    0052AE24 fstp dword ptr [esp+0x8]
    0052AE18 fld dword ptr [esp+0x8]
    0052AE1C fstp dword ptr [esi+0x298]
    0052AE22 nop
    0052AE27 nop

    and use "set $car traffic velocityfactor $clutch" to change the clutch value.
    NOTE: Racer seems to apply the square of the actual value.

    If I am wrong about the licensing, i will of course remove this.
  8. PWM on clutch would be a bonkers approach... however, I think the launch control on the M3 CSL used a PWM type method on the clutch (rapidly opening/closing it so the engine didn't bog down), which is pretty cool.

    Onyx is great but so far Ruud has only put in a few variables (system.html output lists them), but not sure why there is a limit. Ie, no tyre rates, rolling rad, rolling coeff, pacejka, clutch torque, car cameras, sounds, etc etc...

    The WHOLE car.ini variable list should be in Onyx, and every user input should also be in there too.
    Same for the track special.ini stuff too.

    If it's exposed then it lets us be creative and do things better.

    Ie, recently I added a nice ABS script which is imo tons better than Ruud's implement. Not putting down Ruud's work of course, but we can spend more time getting these things perfect than Ruud can... just exposing the right variables to us is all he needs to do!

    I too would like to see the clutch exposed. Current operation in the very latest version *should* be linear, not the square of the value set (it was a square curve before apparently)

    Having the clutch times exposed via Onyx system script variables, we could then make the clutch times slower when at low engine loads, and then make them faster when at high engine loads (perhaps via a crv lookup)
    That way automatic gearbox would be nice and slow when tootling around, and then sharpen up when you floor it.

    Again, not something Ruud should waste his time on, we can do all these things...

    Hopefully it is Ruud's plan to expose all these needed variables to Onyx asap :D

    All variables exposed and some crv loading logic would make Racer suddenly very very powerful. Why hard-code when it can all be editable?