Advertisement
sumguytwitches

approach to landed target

Feb 8th, 2023 (edited)
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. set target to "don't land here".
  2. lock relvel to ship:velocity:surface - target:velocity:surface.
  3. lock tarSpeed tomin(200, target:distance / 40).
  4. set taralt to 1000.
  5. lock tarVel to (target:position+up:vector*taralt):normalized * tarSpeed.
  6. lock steering to choose up:vector if alt:Radar < taralt else tarVel - relvel.
  7. lock throttle to choose (steering:mag / (ship:availablethrust/ship:mass))/2 if steering:mag > 0.01 and vang(steering,ship:facing:vector) < 2.5 and ship:availablethrust > 0 else choose taralt-alt:radar if alt:radar < taralt else 0.
  8. on ship:maxthrustat(0) {stage. return stage:number > 0.}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement