Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearscreen.
- lock steering to retrograde.
- toggle AG2.
- wait 2.
- toggle AG3.
- wait 1.
- RCS on.
- set ship:control:fore to 1.
- wait 1.5.
- set ship:control:fore to -1.
- wait 1.5.
- set ship:control:fore to 0.
- RCS off.
- set target to "Saturn K Lander".
- lock steering to target:position.
- wait 10.
- RCS on.
- list dockingports in my_dp.
- set tar_dp to target:partstagged("MMdock").
- until false {
- for dockingports in my_dp {
- set x_0 to dockingports:nodeposition:x.
- set y_0 to dockingports:nodeposition:y.
- set z_0 to dockingports:nodeposition:z.
- }
- for dockingports in tar_dp {
- set x_1 to dockingports:nodeposition:x.
- set y_1 to dockingports:nodeposition:y.
- set z_1 to dockingports:nodeposition:z.
- }
- set x_dist to min(max((x_0 - x_1), -3), 10).
- set y_dist to min(max((y_0 - y_1), -3), 10).
- set z_dist to min(max((z_0 - z_1), -3), 10).
- set rel_vec to target:velocity:orbit - ship:velocity:orbit.
- set x_vec to rel_vec:x.
- set y_vec to rel_vec:y.
- set z_vec to rel_vec:z.
- set x_lim to 2/(1 + constant:e^(-2*x_dist)) - 1.
- set y_lim to 6/(1 + constant:e^(-2*y_dist)) - 3.
- set z_lim to 6/(1 + constant:e^(-2*z_dist)) - 3.
- set str to 2/(1 + constant:e^(max((-5*y_vec + y_lim), -13))) - 1.
- set tp to 2/(1 + constant:e^(max((-5*z_vec + z_lim), -13))) - 1.
- set fr to 2/(1 + constant:e^(max((-5*x_vec + x_lim), -13))) - 1.
- set ship:control:translation to v(str, tp, fr).
- if x_dist > -0.1 {
- break.
- }
- wait 0.
- }
- unlock steering. RCS off. set ship:control:neutralize to true.
- wait 5.
- set target to "".
- toggle AG4.
- stage.
Advertisement
Add Comment
Please, Sign In to add comment