1
0
Fork 0
fgdata/Aircraft/c172p/Nasal/light.nas

36 lines
977 B
Text

sbc1 = aircraft.light.new( "/sim/model/lights/sbc1", [0.5, 0.3] );
sbc1.interval = 0.1;
sbc1.switch( 1 );
sbc2 = aircraft.light.new( "/sim/model/lights/sbc2", [0.2, 0.3], "/sim/model/lights/sbc1/state" );
sbc2.interval = 0;
sbc2.switch( 1 );
setlistener( "/sim/model/lights/sbc2/state", func(n) {
bsbc1 = sbc1.stateN.getValue();
bsbc2 = n.getBoolValue();
b = 0;
if( bsbc1 and bsbc2 and getprop( "/controls/lighting/beacon") ) {
b = 1;
} else {
b = 0;
}
setprop( "/sim/model/lights/beacon/enabled", b );
if( bsbc1 and !bsbc2 and getprop( "/controls/lighting/strobe" ) ) {
b = 1;
} else {
b = 0;
}
setprop( "/sim/model/lights/strobe/enabled", b );
});
beacon = aircraft.light.new( "/sim/model/lights/beacon", [0.05, 0.05] );
beacon.interval = 0;
strobe = aircraft.light.new( "/sim/model/lights/strobe", [0.05, 0.05] );
strobe.interval = 0;
setprop( "/instrumentation/nav[0]/ident", 0 );
setprop( "/instrumentation/nav[1]/ident", 0 );