Im struggling for a while now to find a way to overwrite a variable that is defined in a jbeam file with lua. Its easy with hydros just by saying electrics.values['myhydroinput'] = x. Now I want to redefine the vehicle engine values like torque, rpm etc. via lua. However something like v.data.mainEngine['idleRPM'] = x does not work. I can only read the current value, not set it. Is there a method for this that I should know of? Like obj:changeVar(v.data.mainEngine['idleRPM'], x) or similar..
I just ran into this with the intention of writing a simple app that would let me change the idle RPM. Just trying around with the Vehicle Lua console, doing powertrain.getDevice("mainEngine").idleRPM=2000 does nothing. Yet powertrain.getDevice("mainEngine").maxIdleThrottle seems to have an effect as setting it to 0.01 makes the engine slowly die. Is there some other way these engine settings can be updated or is it just not possible (yet)?