Repository with files and utilities for the kOS mod for Kerbal Space Program.
Library to provide extended staging information
Multi-stage maneuver execution script
Script to very precisely set the Orbital Period of a craft
sinfo.ksMain library file providing thesinfo()function.sitest.ksA test script to demonstrate thesinfo()usage.sinfo_no_fd.ksA legacy version that does not support fuel ducts.
The user interface of KSP provides information about Delta V, ISP, Thrust, TWR, Start/End Mass and
Burn Time, but kOS only makes the
Delta V information per stage available.
The sinfo.ks library recalculates those and other values and provides access to the values via a
list/lexicon structure. The values match those provided through Kerbal Engineer Redux, or MechJeb.
The library supports the use of fuel ducts in the vessel when calculating the staging information.
The sinfo() documentation can be found here.
xm2.ksScript to perform multi-stage maneuver.
The xm2.ks script uses the sinfo.ks library to calculate the cummulative burn time across multiple
stages to time the beginning of the burn for the maneuver. This is something that the user interface from
KSP provides, but that otherwise is not available through kOS.
The script times the ignition so that one half of the Delta V is applied before the maneuver time (node:ETA) and
the other half after.
The xm2.ks script uses the sinfo.ks library to calculate the cummulative burn time across multiple
Launch.ksScript to launch now.
Syntax:run Launch(targetAltkm=80,targetIncl=0).LauIn.ksScript to launch in requested number of minutes.
Syntax:run LauIn(targetAltkm=80,targetIncl=0,InMinutes=5).LauLAN.ksScript to launch into requested LAN. Default is Minmus.
Syntax:run LauLAN(targetAltkm=80,targetIncl=0,lauLAN=78).LauTarget.ksScript to launch into orbit with inclination and LAN from selected target.
Syntax:run LauLAN(targetAltkm=80).LauEject.ksScript to launch into target orbit with ejection angle at the given time. Ejection info is provided by Transfer Window Planner. See Mike Aben's Eve/Moho Flyby Build https://youtu.be/pvl8zILT5Wc?t=1498 for an example.
Syntax:run LauEject(targetAltkm=100,targetIncl=5,ejectAng=90,inDays=0,inHours=0,inMins=0,proDV=100,normDV=0).
Dock.ksScript to dock automatically.
The Dock.ks script needs the vessels to be within docking range (200m). The docking port needs to be active with Control from here and the target docking port needs to be selected with Set as Target on the other vessel.
SetPeriod.ksScript to adjust orbital period.
The SetPeriod.ks script takes one parameter that sets the target orbital period of a vessel in seconds. The burn is executed immediately and will result in an orbital period that is less than one microsecond (1 us) deviating from the target period.
These script are called by some of the scripts listed above or can be used independently.
Align.ksScript to align vessel. Orientations: 'n' - normal, 'd' - dorsal, 'w' - wing (dorsal+90deg)
Syntax:run Align(orientation=n).Ascent.ksHelper script for launch scripts to launch into target orbit.CircAtAP.ksScript that creates a maneuver node to circularize at next apoapsis.
Syntax:run CircAtAP.CircAtPE.ksScript that creates a maneuver node to circularize at next periapsis.
Syntax:run CircAtPE.SetEjMN.ksScript that creates a maneuver node at the ejection angle at the given time with given prograde and normal DV.
Syntax:run SetEjMN(ejectAng=90,inDays=0,inHours=0,inMins=0,proDV=100,normDV=0).libcommon.ksA library providing the following function:
Syntax:nuform(nmber,lead,precision)A function to format a string from a number with leading characters and trailing digits.
All code is considered "as is" and might fail anytime. Protect your Kerbals!
Permission is granted to change, share, and use the content of this repository under the terms of the MIT license.