Improvements to launchpad and rocket code.

This commit is contained in:
Anna Rose 2021-09-29 03:00:57 -04:00
parent 6830f23613
commit c50e43ba80
3 changed files with 23 additions and 5 deletions

View File

@ -102,6 +102,9 @@ function BurnTime {
local lastStage is false. local lastStage is false.
// We allow a small tolerance to deal with potential floating point errors. // We allow a small tolerance to deal with potential floating point errors.
until totaldV <= 0.001 { until totaldV <= 0.001 {
if s < 0 {
print "Ran out of fuel with " + totaldV + " dV remaining".
}
local F is stageThrust(s). local F is stageThrust(s).
local Isp is stageISP(s). local Isp is stageISP(s).
local m is stageMass(s). local m is stageMass(s).

View File

@ -3,6 +3,12 @@
// stages, spools up the engines, and then "releases control" // stages, spools up the engines, and then "releases control"
// to the main ship computer. // to the main ship computer.
// //
// *** CONSTRUCTION NOTES ***
// If using this script, put the annabuncheskOS-launchpad.cfg file from the patches/ directory into your GameData/
// directory. This will ensure the launchpad has a high enough fuel flow rate for the spool-up sequence.
// If your lower stage uses engine plates, be sure to attach the launch pad to one of the *engine* bottom nodes,
// not the Engine Plate's bottom node. Otherwise fuel delivery won't work.
//
// *** TAGGING REQUIREMENTS *** // *** TAGGING REQUIREMENTS ***
// The launchpad object should have the "launchpad" tag. // The launchpad object should have the "launchpad" tag.
// The ship's main CPU (the one with launch functionality" should be tagged "shipcpu". // The ship's main CPU (the one with launch functionality" should be tagged "shipcpu".

View File

@ -122,7 +122,9 @@ MakeMenu(
MakeButton(rows[2], "Node"), MakeButton(rows[2], "Node"),
List( List(
List("Node dV", "RO", "0"), List("Node dV", "RO", "0"),
List("Node Burn Time", "RO", "0") List("Node Burn Time", "RO", "0"),
List("Node Lead Time", "RO", "0"),
List("Burn Start ETA", "RO", "0")
), ),
"Execute", "Execute",
{ {
@ -132,11 +134,18 @@ MakeMenu(
{ {
parameter options. parameter options.
if HASNODE { if HASNODE {
local burnTime is BurnTime(NEXTNODE:DELTAV:MAG).
local leadTime is BurnTime(NEXTNODE:DELTAV:MAG / 2).
set options["Node dV"]:TEXT to NEXTNODE:DELTAV:MAG:ToString. set options["Node dV"]:TEXT to NEXTNODE:DELTAV:MAG:ToString.
set options["Node Burn Time"]:TEXT to BurnTime(NEXTNODE:DELTAV:MAG):ToString. set options["Node Burn Time"]:TEXT to burnTime:ToString.
set options["Node Lead Time"]:TEXT to leadTime:ToString.
set options["Burn Start ETA"]:TEXT to (NEXTNODE:ETA - leadTime):ToString.
} else { } else {
set options["Node dV"]:TEXT to "No Node". set options["Node dV"]:TEXT to "No Node".
set options["Node Burn Time"]:TEXT to "No Node". set options["Node Burn Time"]:TEXT to "No Node".
set options["Node Lead Time"]:TEXT to "No Node".
set options["Burn Start ETA"]:TEXT to "No Node".
} }
} }
). ).