-------------------------------------------------------------------------------------- -- KUJU / Rail Simulator -------------------------------------------------------------------------------------- -- INITIALISE function Initialise () Call( "Whistle Smoke:SetEmitterActive", 0 ); Call( "Cab Emitter R:SetEmitterActive", 0 ); Call( "Cab Emitter L:SetEmitterActive", 0 ); Call( "Pressure Booster 1:SetEmitterActive", 0 ); Call( "Pressure Booster 2:SetEmitterActive", 0 ); Call( "Cylinder Cocks R 1:SetEmitterActive", 0 ); Call( "Cylinder Cocks L 2:SetEmitterActive", 0 ); Call( "Cylinder Cocks R 2:SetEmitterActive", 0 ); Call( "Cylinder Cocks L 2:SetEmitterActive", 0 ); end ------------------------------------------------------------ -- OnControlValueChange ------------------------------------------------------------ -- Called when a cab control is modified ------------------------------------------------------------ -- Parameters: -- name = Name of the control -- index = Index of the control -- value = Modified control value ------------------------------------------------------------ function OnControlValueChange ( name, index, value ) if Call( "*:ControlExists", name, index ) then Call( "*:SetControlValue", name, index, value ); end if name == "Horn" then if value > 0 then Call( "Whistle Smoke:SetEmitterActive", 1 ); else Call( "Whistle Smoke:SetEmitterActive", 0 ); end end if name == "LiveInjectorSteamOnOff" then if value > 0 then Call( "Cab Emitter R:SetEmitterActive", 1 ); Call( "Cab Emitter L:SetEmitterActive", 1 ); else Call( "Cab Emitter R:SetEmitterActive", 0 ); Call( "Cab Emitter L:SetEmitterActive", 0 ); end end if name == "ExhaustInjectorSteamOnOff" then if value > 0 then Call( "Pressure Booster 1:SetEmitterActive", 1 ); Call( "Pressure Booster 2:SetEmitterActive", 1 ); else Call( "Pressure Booster 1:SetEmitterActive", 0 ); Call( "Pressure Booster 2:SetEmitterActive", 0 ); end end if name == "CylinderCock" then if value > 0 then Call( "Cylinder Cocks R 1:SetEmitterActive", 1 ); Call( "Cylinder Cocks L 1:SetEmitterActive", 1 ); Call( "Cylinder Cocks R 2:SetEmitterActive", 1 ); Call( "Cylinder Cocks L 2:SetEmitterActive", 1 ); else Call( "Cylinder Cocks R 1:SetEmitterActive", 0 ); Call( "Cylinder Cocks L 1:SetEmitterActive", 0 ); Call( "Cylinder Cocks R 2:SetEmitterActive", 0 ); Call( "Cylinder Cocks L 2:SetEmitterActive", 0 ); end end if name == "EmergencyBrake" then if value > 0 then Call("*:Reset", "JF_1-4-1") end end end