diff --git a/boot/faris4Boot.ks b/boot/faris4Boot.ks new file mode 100644 index 0000000..b645ece --- /dev/null +++ b/boot/faris4Boot.ks @@ -0,0 +1,6 @@ +wait until ship:unpacked. +clearscreen. +copyPath("0:/defaults", ""). +run "defaults". + +import("faris4"). \ No newline at end of file diff --git a/faris4.ks b/faris4.ks new file mode 100644 index 0000000..e182063 --- /dev/null +++ b/faris4.ks @@ -0,0 +1,58 @@ +import("library/lib_ascent"). + +WaitForEngineStart(). + +CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Open Terminal"). + +set profile to 1.2. +set turn_start to 1000. +set target_orbit to 100000. + +when altitude > 80000 then { + ag1 on. +} + +Ascent(target_orbit, turn_start, profile, 3). +wait 0.5. +clearScreen. +print "Warping 1 orbit...". +local warpTgt is eta:apoapsis. + +warpTo(time:seconds + warpTgt). +wait warpTgt + 1. + +print "Preparing for De-orbit...". +lock steering to retrograde. +wait 20. +print "De-orbit Burn...". +lock throttle to 1. +wait until periapsis <= -200000. +print "Preparing for re-entry...". +lock throttle to 0. +wait until throttle = 0. +wait 1. +stage. +wait 1. + +set kuniverse:timewarp:rate to 10. +wait until altitude <= 80000. + +print "Re-entry...". +lock steering to srfRetrograde. + +wait until altitude <= 20000. + +print "Falling to ground...". + +unlock steering. +set kuniverse:timewarp:rate to 5. + +wait until ship:status = "LANDED" or ship:status = "SPLASHED". +set kuniverse:timewarp:rate to 0. + +print "Mssion Complete!". +SET V0 TO GETVOICE(0). +V0:PLAY( NOTE(400, 2.5) ). + +CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal"). +SHUTDOWN. \ No newline at end of file diff --git a/koyuki.ks b/koyuki.ks index b7d1368..81fb9c5 100644 --- a/koyuki.ks +++ b/koyuki.ks @@ -6,7 +6,7 @@ WaitForEngineStart(). CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Open Terminal"). -set profile to 1.2. +set profile to 1. set turn_start to 1000. set target_orbit to 130000. diff --git a/library/lib_ascent.ks b/library/lib_ascent.ks index 4c597be..a74f10d 100644 --- a/library/lib_ascent.ks +++ b/library/lib_ascent.ks @@ -118,7 +118,7 @@ local function CreateCircularizationNode{ wait until altitude > 80000. local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis). - set circNode to Node(time:seconds + eta:apoapsis, 0, 0, burnDv). + local circNode is Node(time:seconds + eta:apoapsis, 0, 0, burnDv). add circNode. wait 0.01. lock steering to circNode:burnvector. @@ -126,9 +126,11 @@ local function CreateCircularizationNode{ wait until circNode:eta <= burnDuration /2. lock throttle to 1. wait until nextNode:deltav:mag <= 10. - lock throttle to 0.5. + lock throttle to 0.25. wait until NEXTNODE:deltav:mag <= 1. + unlock steering. remove nextNode. + wait 0.01. lock throttle to 0. wait until throttle = 0. } diff --git a/library/lib_vessel_utils.ks b/library/lib_vessel_utils.ks index 2aa9405..f73c490 100644 --- a/library/lib_vessel_utils.ks +++ b/library/lib_vessel_utils.ks @@ -155,7 +155,6 @@ declare function CalculateTimeToImpact{ parameter tgtAltitude is 0.0. if gravity <= 0 or curAltitude <= 0{ - print "[warn]: invalid altitude or gravity.". return 0.0. }