kOS scripts for Kerbal Operating System mod
See the kOS documentation for more details
KSP-KOS provides kOS syntax highlighting for Sublime Text 3
Copy the contents of the Script
folder to the Ships/Script
folder inside the KSP game directory, or create a link
Start on archive so boot files run there instead of ship volume
Perform as much calculation as possible on archive and compile a very simple script to ship volume that just runs a list of delegates.
Getting readable logs is apparently nontrivial. Files written on ship volumes are not easy to read, and the archive (where we don't have to worry about space anyway) isn't always available. For now we just have a function defined in io-lib
to wrap around the log function. For now logging is always active.
Ideally we'd like all lib files to have no dependencies, but since the logging wrapper is defined in io-lib
we make an exception and have that as a dependency for everything.
- Remote Tech is assumed for checking comms
- Kerbal Alarm Clock is required for setting alarms
Scrips directly beneath the Script/
directory are intended to be run directly from the terminal, typically on the archive.
This directory holds files meant to be compiled onto ship volumes and run from there. Ideally they should have no dependencies and should be as lightweight as possible.
Accepts a list of delegates and runs then one at a time.
See the kOS docs on special handling of files in the "boot" directory for details on how the boot directory works.
Automates launch for a tetrahedral constellation of comm satellites around Kerbin.
Handles all the calculations for the launch and defines delegates to be run on the ship volume by the execute-delegates
script.
- Define static values
- Calculate derived values
- Verify all values are acceptable (check against Kerbin-defined minimums)
- Define delegates and add them to a list
- Define a delegate to control the actual launch
- Define a delegate to control orbital insertion
- Define a delegate to correct inclination
- Define a delegate to raise apoapsis at correct argument
- Define a delegate to verify orbit
- Set a trigger to set the next alarm after launch
- Compile simple action script to ship volume
- Change to ship volume and run compiled script with list of delegates
- Unset boot script
This directory contains scripts that define various helper functions.
Ideally none of these should have dependencies on any other files.
The one exception (for now) is io-lib
.
Helpful functions for comms. Inclusion of RemoteTech mod is assumed.
Helpful I/O functions. At this point just provides a handy function for terminating execution.
Helpful functions for alarms. Inclusion of Kerbal Alarm Clock mod is assumed.
Launch trigger functions and basic launch profile
Library to help with maneuver nodes
Functions for common orbital values
Functions for SAT-4 constellations
Functions for storing and retrieving data. All functions here depend on the archive being accessible. Reads and writes serialized lexicon on the archive to store information.