sumguytwitches

Hyperoodon Flight Surface to Orbit

Apr 28th, 2021 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. print "waiting for Gateway.".
  2. wait until body = gateway.
  3. print "Gateway detected".
  4. for a in ship:modulesnamed("ModuleDeployableAntenna") a:DoAction("retract antenna", true).
  5. set x to 90.
  6. lock p to 5.
  7. lock steering to heading(x,p).
  8. when airspeed > 70 then lock p to min(90,max(10,(airspeed-100))).
  9. bays off.
  10. toggle ag9.
  11. fuelcells on.
  12. print "locking steering".
  13.  
  14.  
  15. set blades to ship:partsdubbedpattern("fanblade").
  16. set rotors to ship:modulesnamed("ModuleRoboticServoRotor").
  17. for rt in rotors rt:setfield("torque limit(%)", 100). brakes off.
  18. set bladeMods to list().
  19. For b in blades {
  20. set bmod to b:getmodule("ModuleControlSurface").
  21. bmod:setfield("deploy", true).
  22. bladeMods:add(bmod).
  23. }
  24.  
  25. lock torque to throttle * 100.
  26. lock deploy to max(3,airspeed^0.7). //todo: calculate for 4.5 aoa
  27.  
  28. set adjust to true.
  29. when true then {
  30. set deploycopy to deploy.
  31. set torquecopy to torque.
  32.  
  33. For b in bladeMods b:setfield("deploy angle", deploycopy).
  34. for rt in rotors rt:setfield("torque limit(%)", torquecopy).
  35.  
  36. return adjust.
  37. }
  38.  
  39. lock throttle to (ship:electriccharge - 4000)/100.
  40.  
  41.  
  42.  
  43. wait until verticalspeed > 5.
  44. gear off.
  45. when altitude > 50000 or (altitude > 40e3 and verticalspeed < 4) then { toggle ag3. lock throttle to 1. set p to 10. }
  46. when airspeed > 450 then set p to 30.
  47. when airspeed > 300 then { bays off. lock torque to 0. toggle ag8. toggle ag6. }
  48. when altitude > 90000 or (altitude > 40e3 and verticalspeed < 1) then { for nuc in ship:partsdubbedpattern("nuc") nuc:activate(). toggle ag5. }
  49.  
  50. when altitude > 98000 then { set p to 35. }
  51. when altitude > 110e3 then { toggle ag7. }
  52. when apoapsis > 290000 then lock p to min(50,max(0,-7*verticalspeed)).
  53. when periapsis > body:atm:height + 10e3 then lock throttle to 0.
  54.  
  55.  
  56.  
  57. when periapsis > body:atm:height then { print "Welcome to Gateway Orbit.". lock throttle to 0. }
  58.  
Add Comment
Please, Sign In to add comment