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:
Code:
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
}
else
{
$lohi = 1
}
}
}
else
{
$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
{
input()
lohi()
interrupt
}
Also place this script in the paint folder:
Code:
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?
Cheers
Dave