KSP-KOS/KOS — pull request #124 by WazWaz (2014-05-27 22:39:30+00:00)
Title: Boot system + CommRange display in VAB.

This change uses the new Tweakables feature in the VAB/SPH to allow:

* Choose a file from Archive as the "boot" sequence.
* Show the CommRange of the current vessel (uses existing antenna-based function).

The CommRange is purely informative for the player, while the choice of boot is then stored and used at launch time: the chosen file is copied to a file named "boot" on volume 1, and whenever the CPU boots it looks for and runs any such file.

The chosen file is stored as the filename but since currently KSP's Tweakables only have quite limited UI element choices, a slider is used to choose between only files starting with "boot" (case insensitive), since listing all would be unusable.

There is a minor change-of-existing-behaviour: the default is "Boot", so even if the player chooses nothing but merely edits their craft *and* they happen to have a file named "Boot.txt" in their Archive, it will be loaded and run on first launch. Odds are anyone doing this might even be pleasantly surprised.

No documentation is included (where does it go?), but I'd be keen to add that. Also no default "Boot.txt" is provided because kOS does not typically ship any Archive content (and it's still in a weird place in the game directories). I'd like to ship two files, "Boot.txt" that is:

```
clearscreen.
print "kOS Operating System".
print "KerboScript v"+VERSION.
print " ".
print "Proceed.".
```

And a simple "Boot-Autolaunch.txt" that does something trivial like:

```
if STATUS = "PRELAUNCH" {
// Put your auto-launch code here.
// Note that you cannot simply turn on thrust and stage as
// thrust will return to 0 upon exit.
} else {
print "Rebooted".
}.
```

If absolutely necessary, I can split the CommRange change out (it's the second submit in the branch).