2021-08-17 02:52:16 +00:00
|
|
|
// Automated reentry.
|
|
|
|
// Assumes stage 0 contains only parachutes.
|
|
|
|
// Primarily written for small science payload probes.
|
|
|
|
|
|
|
|
function PerformReentry {
|
2021-08-17 08:13:38 +00:00
|
|
|
parameter retractAntennae is true.
|
|
|
|
|
2021-08-17 02:52:16 +00:00
|
|
|
SAS off.
|
|
|
|
|
|
|
|
// stage until only stage 0 remains.
|
|
|
|
until STAGE:NUMBER <= 1 {
|
|
|
|
stage.
|
|
|
|
}
|
|
|
|
|
|
|
|
lock STEERING to SHIP:SRFRETROGRADE.
|
|
|
|
|
2021-08-17 08:13:38 +00:00
|
|
|
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").
|
|
|
|
}
|
2021-08-17 02:52:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
when SHIP:ALTITUDE - SHIP:GEOPOSITION:TERRAINHEIGHT < 2500 then {
|
|
|
|
CHUTES on.
|
|
|
|
}
|
|
|
|
|
|
|
|
wait until false.
|
|
|
|
}
|