1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Maximum Gear posibility?

Discussion in 'Racer Physics and Technical' started by FROST John, Mar 25, 2013.

  1. Hello;

    I want to learn that how many gears can be added to Racer?

    I have a Scania gearbox(14 speeds).I want to play with it.

    Is it possible,for latest versions?
  2. Nope, not directly any way.

    BUT, with Onyx, and then into qscript, you can access the gear ratios, and in theory set the gear ratios too.
    This will be ok for local play, but it might be problematic with network/AI cars on track at the same time.

    Sooooo, set 7 gears for low range, and then 7 gears for high range, then toggle between high/low range with a button.

    I could help you script it, but I think someone like Stereo might have already had a play with this seeing his truck stuff so far :D

  3. :D I'll just play singleplayer(no AI) ;) Can you make a script for 0.9.0 RC5? I can give the gear ratios ;)
  4. Sure, just post up the ratios and I'll give it a shot!

    Also post the final drive if you have it...


  5. Sending...
  6. Ok thanks for the data John.

    The high vs low option seems to be 1.25x ratio.

    So if we use a final drive of 2.71 at the rear axle, then the easiest thing to do is fudge the final drive to make the 1.25 ratio adjustment.

    I assume in real life the truck gearbox uses an optional gear set for hi/low options on the end of the gearbox, but since we don't have that in Racer we'll add it to the final drive.

    Soooo... add all ratios as usual in Racer as per the Scania document for the high option.

    Then use this script in the scripts/physics folder:

    rcar $car = get scriptowner car
    shared int $lohi = 1
    int $keyPressed = 0
    float $low = 3.3875
    float $high = 2.71
    // A nice toggle script for the input key feature state
    func void input()
        if is key 84 pressed        //Toggle with key T
            if $keyPressed == 0
                $keyPressed = 1        //Mark as pressed
                if $lohi == 1
                    $lohi = 0
                    $lohi = 1
            $keyPressed = 0            //Mark as released
    func void lohi()
        if $lohi == 0
            set system "car0.differential0.ratio" to $low;
        else if $lohi == 1
            set system "car0.differential0.ratio" to $high;
    while 1
    Also place this script in the paint folder:

    shared int $lohi
    paint ("High box = " + $lohi) at float[2]{30,10}

    The gearbox defaults to high option. Use the T key (or choose another and alter the code) to toggle from high to low option.

    The painted High box text should read out which option is selected, 1 for high selection, 0 for low selection.

    I've tested it here and it works ok. It probably is more realistic than doing it any other way because iirc these types of systems are constant torque?


  7. Thanks for everything..Is there a file for this?Because I don't know where I should copy it properly :D Can you send me the whole file,please?
  8. Sorry but it's a real pain to upload files here... RD forums for you :(

    Basically right click, create new file, text document.

    Copy the code from the first code entry into the file. Rename the file to lohi.rsx. Place in the scripts/physics folder.

    Create a new txt file, copy the second code into it. Rename the file to paint_lohi.rsx. Place in the scripts/paint folder.

    It's not too hard to do and you'll need to be able to do it as most things posted up are scripts in the form of code snippets like this :)

  9. KS95

    RACER Moderator

    Mediafire ;)
  10. Also note that RD allows .txt files which is nice for the code that members of the Community would otherwise have to type by hand.
  11. Thanks for everything..
  12. txt file uploading is fine, but if you don't know how to rename the files, or have extensions hidden or something, then it's a pain too.

    Media fire, easier to just upload to my own web space.

    Truth is, I can upload a 200kb image here, but not a 1kb zip file... which just sucks.

    I'm sure if John Frost is serious about making this truck for Racer then making the RSX files from the code above will be far from the toughest thing he will have to do :D

  13. I was actually about to ask for a script to basically the same thing, except it was for a 2spd rear end. But I'll try this out and set the rear end ratio to 1.00, so the script basically has the rear end ratios.
  14. Stereo

    Premium Member

    Played around with the script a bit, it shifts a bit rough without a clutch pedal. Fine for a two speed transfer case that you'd only shift when stopped though. The low ratio on a Dana 20 is a 2.0 multiplier anyway so the gears in the F100 I was testing it with run something like 1st lo, 1st hi, 2nd lo, 3rd lo, 2nd hi, 4th lo, 3rd hi, 4th hi. With the final diff ratio, 1st lo is overall 50:1 and it'd probably drive up walls if it had enough grip.

    I dunno if anything can be done about making it shift more smoothly, I don't remember qscripts having workable access to the clutch pedal.
  15. Ideally what we really need is a lot of these hard-coded elements opened up. There is for example no reason why we can't just specify 10 gears, or 20, or 50...

    It'd be nice for example to be able to define two gearboxes, so they sit one after the other, both with their own shifting parameters and clutches and characteristics... gearbox0...99

    It's all the same code just open ended for creative interpretation of ideas and implementations.