The cabcount was used for a hit-counter - for selecting a specific thing to open. If yore looking at my script - see the integrator opening stuff at the :
//invoked each frame to handle the inputs and animate the model
function update_frame(dt, engine, brake, steering) {
// Object rotations
// Door windows
var ax = {z:-1};
if(this.d1.changed(dt) && cabcount == 4){
this.geom.move_joint_orig(this.dlw, {x:0,y:0,z:-this.d1.value});
}
...
// Front pannel cases and hood
var ax = {x:-1};
if(this.d5.changed(dt) && cabcount == 1){
this.geom.rotate_joint_orig(this.cc, -this.d5.value, ax);
May be a rough way to do, but works for me ...
The pause would be used when the engine is off - when its on the counting would go on. On this variable, would specify a fuel-consumption script dependent at EngineRPM and actual gear setting. Also another one, for when the vehicle moves (vehicle speed bigger than 0) to make a traveled distance meter (depending on actual speed and time driven) for the front-panel rotameter.