From 25212af0550d3d9093a9770065f9be363907af74 Mon Sep 17 00:00:00 2001 From: Amatsugu Date: Mon, 20 Apr 2026 02:44:11 -0400 Subject: [PATCH] misc changes + new circ mode --- faris3.ks | 4 +--- itsuki.ks | 2 +- koyuki.ks | 2 +- library/lib_ascent.ks | 27 ++++++++++++++++++--------- library/lib_orbits.ks | 10 ---------- library/lib_vessel_utils.ks | 1 - 6 files changed, 21 insertions(+), 25 deletions(-) diff --git a/faris3.ks b/faris3.ks index 9bc7250..5f9131e 100644 --- a/faris3.ks +++ b/faris3.ks @@ -1,5 +1,3 @@ - - import("library/lib_ascent"). WaitForEngineStart(). @@ -25,7 +23,7 @@ wait until kuniverse:timewarp:rate = 0. lock steering to srfRetrograde. -wait until surfaceSpeed < 1000. +wait until altitude <= 20000. unlock steering. set kuniverse:timewarp:rate to 5. diff --git a/itsuki.ks b/itsuki.ks index 9ff02b0..92abd02 100644 --- a/itsuki.ks +++ b/itsuki.ks @@ -12,7 +12,7 @@ set profile to 1.2. set turn_start to 1000. set target_orbit to 120000. -Ascent(target_orbit, turn_start, profile, 0, 73). +Ascent(target_orbit, turn_start, profile, 3, 90 + 12). print "Orbit Achieved, Releasing Controls". CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal"). diff --git a/koyuki.ks b/koyuki.ks index a9c5a18..b7d1368 100644 --- a/koyuki.ks +++ b/koyuki.ks @@ -10,7 +10,7 @@ set profile to 1.2. set turn_start to 1000. set target_orbit to 130000. -Ascent(target_orbit, turn_start, profile, 0). +Ascent(target_orbit, turn_start, profile, 3). print "Orbit Achieved, Releasing Controls". CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal"). diff --git a/library/lib_ascent.ks b/library/lib_ascent.ks index 666d44b..db95719 100644 --- a/library/lib_ascent.ks +++ b/library/lib_ascent.ks @@ -3,7 +3,6 @@ import("library/lib_math"). import("library/lib_vessel_utils"). import("library/lib_orbits"). - declare function Ascent{ parameter targetOrbit is 100000. parameter vericalAscent is 1000. @@ -11,7 +10,6 @@ declare function Ascent{ parameter circ is 1. parameter inc is 0. - print "Params (" + targetOrbit + ", " + vericalAscent + ", " + ascentProfile + ", " + circ + ", " + inc + ")". print "Vertical Climb to " + vericalAscent. @@ -59,6 +57,9 @@ declare function Ascent{ CircularizeBrute(targetOrbit, head). }else if circ = 2{ Circularize(targetOrbit, head). + }else if circ = 3 { + lock steering to heading(head, 0, 270). + CreateCircularizationNode(apoapsis). } set isDone to true. @@ -68,9 +69,8 @@ declare function Ascent{ wait until throttle = 0. } - local function Circularize{ - parameter targetOrbit. + parameter tgt. parameter head. lock throttle to 0. @@ -78,7 +78,7 @@ local function Circularize{ local warpTime is eta:apoapsis. - local burnDv is CalculateCircularizationDV(targetOrbit, orbit:semimajoraxis). + local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis). local burnDuration is CalculateMultiStageBurnDuration(burnDv). local remDv is ship:deltav:current - burnDv. print "Warping to Circularization. " + round(burnDv) + "m/s. T: " + round(burnDuration, 2) + "s" at(0, 5). @@ -94,18 +94,27 @@ local function Circularize{ lock throttle to 1. // wait burnDuration. - wait until periapsis >= targetOrbit. + wait until periapsis >= tgt. lock throttle to 0. wait 0.01. } - local function CircularizeBrute{ - parameter targetOrbit. + parameter tgt. parameter head. lock throttle to 1. lock steering to heading(head, 0, 270). - wait until periapsis >= targetOrbit. + wait until periapsis >= tgt. lock throttle to 0. } + +local function CreateCircularizationNode{ + parameter tgt. + lock throttle to 0. + + wait until altitude > 80000. + local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis). + set circNode to Node(eta:apoapsis, 0, 0, burnDv). + add circNode. +} diff --git a/library/lib_orbits.ks b/library/lib_orbits.ks index 49c4c7b..aeb2cc1 100644 --- a/library/lib_orbits.ks +++ b/library/lib_orbits.ks @@ -1,13 +1,3 @@ - -declare function CreateDeorbit{ - parameter target. - parameter dv is 300. - parameter offsetX is 0.0. - parameter offsetZ is 0.0. - - -} - declare function CalculateCircularizationDV{ parameter ap is 0. parameter sma is 0. diff --git a/library/lib_vessel_utils.ks b/library/lib_vessel_utils.ks index e18a0a2..2aa9405 100644 --- a/library/lib_vessel_utils.ks +++ b/library/lib_vessel_utils.ks @@ -1,4 +1,3 @@ -import("library/lib_math"). declare function WaitForEngineStart{ wait until AnyEngineActive().