sumguytwitches

Roach demo flight

Dec 16th, 2020 (edited)
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. set point to ship:geoposition.
  2. lock steering to heading(90.5,0).
  3. set cam to addons:camera:flightcamera.
  4. set cam:hdg to 90.
  5. //set cam:mode to "locked".
  6. //wait 2.
  7.  
  8. set cam:distance to 10.
  9. //set cam:pitch to -4.5.
  10. //set cam:target to ship:partsdubbedpattern("gears")[2].
  11. set doneflipping to false.
  12. set ppid to pidloop(3,0.2,0.5,-20,20).
  13. stage.
  14. brakes off.
  15. lock throttle to 1.
  16. lock p to 20.
  17. lock steering to heading(90, p).
  18. //when alt:radar > 2.14 then {
  19. when alt:radar > 2.44 then {
  20. gear off. unlock steering. set ship:control:pitch to 1.
  21. }
  22. when vang(heading(90,-105):vector, ship:facing:vector) < 35 then {
  23. set cam:hdg to 30.
  24. set cam:distance to 6.
  25. lock x to 90.5. set ppid to pidloop(3,0.2,0.5,-20,20).
  26. lock p to ppid:update(time:seconds, verticalspeed).
  27. set sl to 799.
  28. lock throttle to 1.
  29. set ship:control:pitch to 0.
  30. lock steering to heading(x,p).
  31. }
  32.  
  33. when airspeed > 100 then set doneflipping to true.
  34. when doneflipping and alt:radar > 10 then set ppid:setpoint to -3.
  35. when doneflipping and alt:radar < 3.8 then set ppid:setpoint to 0.
  36. when doneflipping and alt:Radar < 2.5 then {
  37. set p to 90.
  38. set cam:hdg to 90.
  39. set cam:distance to 15.
  40. lock steering to heading(x,p).
  41. print "demo done".
  42. lock steering to lookdirup(point:position + up:vector*230,up:vector).
  43. set steeringmanager:pitchtorquefactor to 0.2.
  44. set steeringmanager:yawtorquefactor to 0.5.
  45. set steeringmanager:rollcontrolanglerange to 180.
  46. steeringmanager:resetpids().
  47. }
Add Comment
Please, Sign In to add comment