Advertisement
sumguytwitches

Hermes Horizontal Flight Setup

Nov 25th, 2020 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. // !runscript qmzptN1n
  2. unlock steering.
  3. SAS off.
  4. RCS off.
  5. set vecs to ship:partsdubbedpattern("vector").
  6. ship:partsdubbedpattern("horizontal")[0]:controlfrom().
  7. set servos to ship:modulesnamed("ModuleRoboticRotationServo").
  8. set hinges to ship:modulesnamed("ModuleRoboticServoHinge").
  9. for s in servos {
  10. s:setfield("damping", 80).
  11. s:setfield("traverse rate", 40).
  12. s:setfield("locked",false).
  13. s:setfield("motor",true).
  14. s:setfield("target angle", 90).
  15. }
  16.  
  17. for h in hinges h:setfield("locked", false).
  18. for h in hinges h:setfield("target angle", 72).
  19. list engines in es.
  20. for e in es e:activate().
  21. set totalTorque to v(0,0,0).
  22. for e in es set totalTorque to totalTorque + vcrs(e:position, e:facing:vector) * e:availablethrust.
  23. set lasttorque to 1000.
  24. until abs(lasttorque - totaltorque:mag)< 0.5 {
  25. set lasttorque to totalTorque:mag.
  26. wait 1.
  27. set totalTorque to v(0,0,0).
  28. for e in es set totalTorque to totalTorque + vcrs(e:position, e:facing:vector) * e:availablethrust.
  29. print lasttorque.
  30. }
  31.  
  32. for h in hinges h:setfield("locked", true).
  33. for e in vecs set e:gimbal:limit to 6.
  34. for e in vecs if e:position:x < 0 set e:gimbal:limit to 100.
  35. print "Hermes is Ready".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement