light.nas 1014 B

123456789101112131415161718192021222324252627282930313233343536
  1. var sbc1 = aircraft.light.new( "/sim/model/lights/sbc1", [0.5, 0.3] );
  2. sbc1.interval = 0.1;
  3. sbc1.switch( 1 );
  4. var sbc2 = aircraft.light.new( "/sim/model/lights/sbc2", [0.2, 0.3], "/sim/model/lights/sbc1/state" );
  5. sbc2.interval = 0;
  6. sbc2.switch( 1 );
  7. setlistener( "/sim/model/lights/sbc2/state", func(n) {
  8. var bsbc1 = sbc1.stateN.getValue();
  9. var bsbc2 = n.getBoolValue();
  10. var b = 0;
  11. if( bsbc1 and bsbc2 and getprop( "/controls/lighting/beacon") ) {
  12. b = 1;
  13. } else {
  14. b = 0;
  15. }
  16. setprop( "/sim/model/lights/beacon/enabled", b );
  17. if( bsbc1 and !bsbc2 and getprop( "/controls/lighting/strobe" ) ) {
  18. b = 1;
  19. } else {
  20. b = 0;
  21. }
  22. setprop( "/sim/model/lights/strobe/enabled", b );
  23. });
  24. var beacon = aircraft.light.new( "/sim/model/lights/beacon", [0.05, 0.05] );
  25. beacon.interval = 0;
  26. var strobe = aircraft.light.new( "/sim/model/lights/strobe", [0.05, 0.05, 0.05, 1] );
  27. strobe.interval = 0;
  28. setprop( "/instrumentation/nav[0]/ident", 0 );
  29. setprop( "/instrumentation/nav[1]/ident", 0 );