blorgon

apollo extraction

Jul 6th, 2017
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. clearscreen.
  2. lock steering to retrograde.
  3. toggle AG2.
  4. wait 2.
  5. toggle AG3.
  6. wait 1.
  7. RCS on.
  8. set ship:control:fore to 1.
  9. wait 1.5.
  10. set ship:control:fore to -1.
  11. wait 1.5.
  12. set ship:control:fore to 0.
  13. RCS off.
  14. set target to "Saturn K Lander".
  15. lock steering to target:position.
  16. wait 10.
  17. RCS on.
  18. list dockingports in my_dp.
  19. set tar_dp to target:partstagged("MMdock").
  20. until false {
  21.     for dockingports in my_dp {
  22.         set x_0 to dockingports:nodeposition:x.
  23.         set y_0 to dockingports:nodeposition:y.
  24.         set z_0 to dockingports:nodeposition:z.
  25.     }
  26.     for dockingports in tar_dp {
  27.         set x_1 to dockingports:nodeposition:x.
  28.         set y_1 to dockingports:nodeposition:y.
  29.         set z_1 to dockingports:nodeposition:z.
  30.     }
  31.     set x_dist to min(max((x_0 - x_1), -3), 10).
  32.     set y_dist to min(max((y_0 - y_1), -3), 10).
  33.     set z_dist to min(max((z_0 - z_1), -3), 10).
  34.  
  35.     set rel_vec to target:velocity:orbit - ship:velocity:orbit.
  36.  
  37.     set x_vec to rel_vec:x.
  38.     set y_vec to rel_vec:y.
  39.     set z_vec to rel_vec:z.
  40.  
  41.     set x_lim to 2/(1 + constant:e^(-2*x_dist)) - 1.
  42.     set y_lim to 6/(1 + constant:e^(-2*y_dist)) - 3.
  43.     set z_lim to 6/(1 + constant:e^(-2*z_dist)) - 3.
  44.  
  45.     set str to 2/(1 + constant:e^(max((-5*y_vec + y_lim), -13))) - 1.
  46.     set tp to 2/(1 + constant:e^(max((-5*z_vec + z_lim), -13))) - 1.
  47.     set fr to 2/(1 + constant:e^(max((-5*x_vec + x_lim), -13))) - 1.
  48.  
  49.     set ship:control:translation to v(str, tp, fr).
  50.  
  51.     if x_dist > -0.1 {
  52.         break.
  53.     }
  54.  
  55.     wait 0.
  56. }
  57. unlock steering. RCS off. set ship:control:neutralize to true.
  58. wait 5.
  59. set target to "".
  60. toggle AG4.
  61. stage.
Advertisement
Add Comment
Please, Sign In to add comment