Add option to keep antennae extended for more control during reentry.

This commit is contained in:
Anna Rose 2021-08-17 04:13:38 -04:00
parent b8f6e90e1f
commit 5a1e297977
2 changed files with 11 additions and 5 deletions

View File

@ -3,6 +3,8 @@
// Primarily written for small science payload probes. // Primarily written for small science payload probes.
function PerformReentry { function PerformReentry {
parameter retractAntennae is true.
SAS off. SAS off.
// stage until only stage 0 remains. // stage until only stage 0 remains.
@ -12,11 +14,13 @@ function PerformReentry {
lock STEERING to SHIP:SRFRETROGRADE. lock STEERING to SHIP:SRFRETROGRADE.
if retractAntennae {
for p in SHIP:PARTS { for p in SHIP:PARTS {
if p:MODULES:Find("ModuleRTAntenna") > -1 and p:GetModule("ModuleRTAntenna"):ALLEVENTNAMES:Find("Deactivate") > -1 { if p:MODULES:Find("ModuleRTAntenna") > -1 and p:GetModule("ModuleRTAntenna"):ALLEVENTNAMES:Find("Deactivate") > -1 {
p:GetModule("ModuleRTAntenna"):DoEvent("Deactivate"). p:GetModule("ModuleRTAntenna"):DoEvent("Deactivate").
} }
} }
}
when SHIP:ALTITUDE - SHIP:GEOPOSITION:TERRAINHEIGHT < 2500 then { when SHIP:ALTITUDE - SHIP:GEOPOSITION:TERRAINHEIGHT < 2500 then {
CHUTES on. CHUTES on.

View File

@ -75,11 +75,13 @@ MakeMenu(
MakeMenu( MakeMenu(
stk, stk,
MakeButton(rows[1], "REENTRY"), MakeButton(rows[1], "REENTRY"),
List(), List(
List("Retract Antennae", "BOOL", true)
),
"Execute", "Execute",
{ {
parameter options. parameter options.
PerformReentry(). PerformReentry(options["Retract Antennae"]:PRESSED).
} }
). ).