kOS/lib/reentry.ks

31 lines
685 B
Plaintext
Raw Normal View History

// Automated reentry.
// Assumes stage 0 contains only parachutes.
// Primarily written for small science payload probes.
function PerformReentry {
parameter retractAntennae is true.
SAS off.
// stage until only stage 0 remains.
until STAGE:NUMBER <= 1 {
stage.
}
lock STEERING to SHIP:SRFRETROGRADE.
if retractAntennae {
for p in SHIP:PARTS {
if p:MODULES:Find("ModuleRTAntenna") > -1 and p:GetModule("ModuleRTAntenna"):ALLEVENTNAMES:Find("Deactivate") > -1 {
p:GetModule("ModuleRTAntenna"):DoEvent("Deactivate").
}
}
}
when SHIP:ALTITUDE - SHIP:GEOPOSITION:TERRAINHEIGHT < 2500 then {
CHUTES on.
}
wait until false.
}