Community Forum

How to change something in the motor section

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created04.01.2011 10:46

Peter Edliner (Unknown) 04.01.2011 10:55
Something went wrong pls delete the other toppics.

My question is how do i acces a value in the motor section, for example the forwardeGearRatio.

vehicle = g_currentMission.controlleVehicle;
local gearRatio = vechicle.motor.forwardGearRatio;

Is this the right way?

Stefan Geiger - GIANTS Software 04.01.2011 11:10
The attribute is called forwardGearRatios, which is an array specifying the ratios for all speed levels.

So the code should look like this:

local vehicle = g_currentMission.controlledVehicle;
local gearRatio;
if vehicle.motor.speedLevel ~= 0 then
gearRatio vehicle.motor.forwardGearRatios[vehicle.motor.speedLevel];
gearRatio vehicle.motor.forwardGearRatios[3];

Note: Log in to post. Create a new account here.