From 5a1e29797734566d35b7935e627fee30eec4e238 Mon Sep 17 00:00:00 2001 From: annabunches Date: Tue, 17 Aug 2021 04:13:38 -0400 Subject: [PATCH] Add option to keep antennae extended for more control during reentry. --- lib/reentry.ks | 10 +++++++--- prog/rocket.ks | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/reentry.ks b/lib/reentry.ks index cfcfc2c..d56b25f 100644 --- a/lib/reentry.ks +++ b/lib/reentry.ks @@ -3,6 +3,8 @@ // Primarily written for small science payload probes. function PerformReentry { + parameter retractAntennae is true. + SAS off. // stage until only stage 0 remains. @@ -12,9 +14,11 @@ function PerformReentry { 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"). + 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"). + } } } diff --git a/prog/rocket.ks b/prog/rocket.ks index 59a29df..4dca276 100644 --- a/prog/rocket.ks +++ b/prog/rocket.ks @@ -75,11 +75,13 @@ MakeMenu( MakeMenu( stk, MakeButton(rows[1], "REENTRY"), - List(), + List( + List("Retract Antennae", "BOOL", true) + ), "Execute", { parameter options. - PerformReentry(). + PerformReentry(options["Retract Antennae"]:PRESSED). } ).