Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PARAMETER launchCompassHeading.
- PARAMETER launchTargetApoapsis.
- PARAMETER launchTargetPeriapsis.
- SET ascentProfile TO LIST(
- //tiltAltitude, tiltPitch
- 0, 90,
- 1000, 87.5,
- 2000, 85,
- 2500, 82.5,
- 3000, 80,
- 3500, 77.5,
- 4000, 75,
- 4500, 72.5,
- 5000, 70,
- 5500, 67.5,
- 6000, 65,
- 6500, 62.5,
- 7000, 60,
- 7500, 57.5,
- 8000, 55,
- 8500, 52.5,
- 9000, 50,
- 9500, 47.5,
- 10000, 45
- ).
- FUNCTION NOTIFY {
- PARAMETER notifyMessage.
- PARAMETER notifyColour.
- HUDTEXT (notifyMessage, 5, 2, 50, notifyColour, false).
- }
- FUNCTION TILT {
- PARAMETER tiltAltitude.
- PARAMETER tiltPitch.
- UNTIL FALSE {
- IF altitude > tiltAltitude {
- LOCK steering TO heading(launchCompassHeading, tiltPitch).
- BREAK.
- }
- }
- }
- FUNCTION GTURN {
- SET step TO 0.
- UNTIL step >= ascentProfile:length - 1 {
- TILT(ascentProfile[step], ascentProfile[step + 1]).
- SET step TO step + 2.
- }
- }
- FUNCTION CLEANSTAGE {
- SET previousMaxThrust TO maxThrust.
- SET staged TO false.
- UNTIL staged = true {
- IF maxThrust < (previousMaxThrust - 10) {
- NOTIFY("Stage Jettison.", red).
- STAGE.
- SET staged TO true.
- }
- }
- }
- FUNCTION ECCENTRICITYCONTROL {
- UNTIL periapsis > launchTargetPeriapsis {
- IF eta:apoapsis > 10 {
- LOCK steering TO HEADING(launchCompassHeading, 355).
- BREAK.
- }
- ELSE IF eta:apoapsis < 5 {
- LOCK steering TO HEADING(launchCompassHeading, 5).
- BREAK.
- }
- ELSE {
- LOCK steering TO HEADING(launchCompassHeading, 0).
- BREAK.
- }
- }
- }
- NOTIFY("Launch sequence intiated.", green).
- WAIT 1.
- NOTIFY("Counting down.", green).
- WAIT 1.
- NOTIFY("5...", yellow).
- WAIT 1.
- NOTIFY("...4...", yellow).
- WAIT 1.
- NOTIFY("...3...", yellow).
- WAIT 1.
- NOTIFY("...2...", yellow).
- WAIT 1.
- NOTIFY("...1...", yellow).
- LOCK THROTTLE to 1.
- STAGE.
- WAIT 1.
- NOTIFY("...lift off!", red).
- STAGE.
- GTURN().
- CLEANSTAGE().
- WAIT UNTIL apoapsis > launchTargetApoapsis.
- NOTIFY("Target apoapsis obtained.", yellow).
- NOTIFY("Engine shutoff.", red).
- LOCK throttle TO 0.
- LOCK steering TO prograde.
- WAIT UNTIL altitude > 70000.
- NOTIFY("Atmospheric pressure negligible.", yellow).
- NOTIFY("Fairing separation.", red).
- STAGE.
- WAIT 5.
- NOTIFY("Maneuvering for orbital insertion.", red).
- LOCK steering TO heading(launchCompassHeading, 5).
- WAIT UNTIL eta:apoapsis < 10.
- NOTIFY("Approaching apoapsis.", yellow).
- NOTIFY("Burning for orbital insertion.", red).
- LOCK throttle TO 1.
- ECCENTRICITYCONTROL().
- NOTIFY("Target periapsis obtained.", red).
- NOTIFY("Engine shutoff.", red).
- LOCK throttle TO 0.
- WAIT 1.
- NOTIFY("Extending solar arrays.", red).
- NOTIFY("Optimising Kerbol angle.", red).
- NOTIFY("Extending antenna.", red).
- LOCK steering TO sun.
- TOGGLE gear.
- WAIT 1.
- NOTIFY("Stable orbit obtained.", green).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement