Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //run launch_to_orbit
- lock steering to prograde.
- print "Enabling solar before fairings".
- panels on.
- print "Faring deploy".
- stage.
- wait 5.
- print "Booster separation".
- stage .
- wait 1.
- stage .
- if ship:partstaggedpattern("booster"):length > 0 {
- print "Preparing for deorbit:".
- print " * point retrograde".
- print " * move remaining fuel to the other end of the rocket.".
- lock steering to lookDirUp(retrograde:forevector, sun:position).
- set steeringmanager:maxstoppingtime to 5.
- set transferFuel to transferall("LiquidFuel", ship:partstagged("toptank"), ship:partstagged("bottomtank")). set transferFuel:active to true.
- set transferOx to transferall("Oxidizer", ship:partstagged("toptank"), ship:partstagged("bottomtank")). set transferOx:active to true.
- when transferFuel:status = "Finished" then {
- print "Deorbit prep completed. Warping close to deorbit point.".
- when geoposition:lng > 140 then set warp to 1.
- when geoposition:lng > 150 then set warp to 0.
- set warp to 3.
- }
- when geoposition:lng > 161.5 then {
- print "Deorbit burn".
- lock throttle to 1.
- when periapsis < 30_000 then {
- lock throttle to 0.25.
- when periapsis < 25_000 then {
- lock throttle to 0.
- print "Deorbit burn completed. Preparing for reentry.".
- lock steering to lookDirUp(srfretrograde:forevector, sun:position).
- brakes on.
- wait 5.
- print "Warping to atmosphere.".
- set warp to 2.
- when altitude < (body:atm:height + 400) then {
- print "Warping to thicker parts of the atmosphere.".
- set warp to 0.
- set warpmode to "physics".
- set warp to 3.
- when altitude < 25000 then
- {
- print "Now in real time".
- set warp to 0.
- }
- }
- when geoposition:lng > -49.0 and geoposition:lng < -45 then {
- print "Near KSC".
- if airspeed > 380 {
- print "Still too fast, slowing down.".
- when airspeed < 385 then {
- lock throttle to 0.
- }
- lock throttle to 1.
- }
- }
- when geoposition:lng > -48.4 and geoposition:lng < -45 then {
- if geoposition:lng > -48.4 and geoposition:lng < -45 {
- print "Over KSC".
- } else {
- print "Lithobraking imminent... slowing down".
- }
- stage.
- when airspeed < 150 then {
- lock steering to lookDirUp( up:forevector, ship:facing:topvector).
- gear on.
- }
- }
- }
- }
- }
- } else {
- print "Something is not right. I am not a booster.".
- }
Add Comment
Please, Sign In to add comment