low.nas 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. ##### low level animation loop
  2. setlistener("/sim/signals/fdm-initialized", func {
  3. settimer(low_loop, 1);
  4. });
  5. var low_loop = func {
  6. var calt = getprop("position/altitude-agl-ft");
  7. var cspd = getprop("velocities/groundspeed-kt");
  8. var croll = getprop("orientation/roll-deg");
  9. var burn0 = getprop("controls/engines/engine[0]/afterburner");
  10. var burn1 = getprop("controls/engines/engine[1]/afterburner");
  11. if((calt <= 100) and (cspd >= 400) and ((croll >= -60) and (croll <= 60)) )
  12. { setprop("controls/state/low_level", 1);
  13. }
  14. elsif( ((calt > 100) and (calt <= 300)) and (cspd >= 400) and ((croll >= -40) and (croll <= 40)) )
  15. { setprop("controls/state/low_level", 1);
  16. }
  17. elsif ((calt <= 100) and ((burn0 == 1) or (burn1 == 1)) and ((croll >= -60) and (croll <= 60)) )
  18. { setprop("controls/state/low_level", 1);
  19. }
  20. elsif (((calt > 100) and (calt <= 300)) and ((burn0 == 1) or (burn1 == 1)) and ((croll >= -40) and (croll <= 40)) )
  21. { setprop("controls/state/low_level", 1);
  22. }
  23. else
  24. { setprop("controls/state/low_level", 0);
  25. }
  26. settimer(low_loop, 1);
  27. }