sumguytwitches

BottleNose flight

Feb 13th, 2021 (edited)
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. set steeringmanager:pitchtorquefactor to 0.2.
  2. set steeringmanager:yawtorquefactor to 0.5.
  3. set steeringmanager:rollcontrolanglerange to 180.
  4. steeringmanager:resetpids().
  5. lock x to 90.
  6. lock p to 5.
  7. set roll to 0.
  8. lock steering to heading(x,p,-roll).
  9.  
  10.  
  11. fuelcells on.
  12. set tweak to 0.
  13. lock deploy to max(3,airspeed^0.7) + tweak.
  14. lock torque to throttle * 100.
  15. set blades to ship:partsdubbedpattern("fanblade").
  16. set rotors to ship:modulesnamed("ModuleRoboticServoRotor").
  17. set bladeMods to list().
  18. For b in blades {
  19. set bmod to b:getmodule("ModuleControlSurface").
  20. bmod:setfield("deploy", true).
  21. bladeMods:add(bmod).
  22. }
  23.  
  24. set adjust to true.
  25. when true then {
  26. set deploycopy to deploy.
  27. set torquecopy to torque.
  28.  
  29. For b in bladeMods b:setfield("deploy angle", deploycopy).
  30. for rt in rotors rt:setfield("torque limit(%)", torquecopy).
  31.  
  32. return adjust.
  33. }
  34.  
  35.  
  36.  
  37. // /me when true then { set tcopy to min(ship:electriccharge-100, throttle)*100. for rt in rotors rt:setfield("torque limit(%)", tcopy ). return adjust. }
  38.  
  39. set sgp to 0.
  40. set sggo to true.
  41. set sgf to 8.
  42. set sgpr to 4.
  43. function sgd {
  44. parameter l. parameter d.
  45. If l:length > sgpr set sgpr to l:length.
  46. print (l:padleft(sgpr) + ": " +round(d,2)):padright(terminal:width) at (0, sgp).
  47. set sgp to sgp + 1.
  48. }.
  49. lock twr to ship:availablethrust/ship:mass/body:mu*body:position:sqrmagnitude.
  50.  
  51. set sggo to false. wait 0. set sggo to true.
  52. On round(kuniverse:realtime * sgf) {
  53. set sgp to 0.
  54.  
  55. sgd("Vertical Speed", ship:verticalspeed).
  56. sgd("alt radar",alt:radar).
  57. sgd("groundspeed",groundspeed).
  58. sgd("twr",twr).
  59. sgd("oxidizer", ship:oxidizer).
  60. sgd("liquidfuel", ship:liquidfuel).
  61. sgd("eta minutes", alt:radar / -ship:verticalspeed / 60).
  62. sgd("electric charge", ship:electriccharge).
  63.  
  64. Print "":padright(terminal:width) at (0,sgp).
  65. Set sgp to sgp + 1.
  66.  
  67. sgd("tweak",tweak).
  68. sgd("deploy",deploy).
  69. sgd("torque limit(%)", torque).
  70.  
  71. Print "":padright(terminal:width) at (0,sgp).
  72. Set sgp to sgp + 1.
  73. Print "":padright(terminal:width) at (0,sgp).
  74. return sggo.
  75. }
  76.  
Add Comment
Please, Sign In to add comment