kOS/prog/reentry.ks

27 lines
570 B
Plaintext
Raw Normal View History

2021-08-12 03:58:48 +00:00
// Automated reentry.
// Assumes stage 0 contains only parachutes.
// Primarily written for small science payload probes.
@lazyglobal off.
SAS off.
2021-08-12 03:58:48 +00:00
// stage until only stage 0 remains.
until STAGE:NUMBER <= 1 {
stage.
}
lock STEERING to SHIP:SRFRETROGRADE.
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.