Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

Warning: This thread refers to an old, now abandoned, version of this mod.

For the newer version that is still receiving updates, please visit this thread instead.

xuy3.jpg

What's new

Current Version: 0.9

- New Expression System

- Version Info

- Targeting of bodies, getting stats

- Get values from other ships, just like current ship

- Send commands to chutes, legs and solar panels individually

- Round function to x decimals, modulo

- Setting values on structures

- Vectors now use double precision

- Get apoapsis and periapsis of a node

What is it

kOS is a scriptable autopilot Mod for Kerbal Space Program. It allows you write small programs that automate specific tasks.

With kOS, you can issue commands to your ships via a command line, or write programs to automate tasks. kOS can interact with other parts on your craft via action groups, it can also be set to run programs in response to action groups being fired.

kOS requires Kerbal Space Program 0.22 or later.

Where to get it

Download the latest version from Kerbal SpacePort

Go to the GitHub Page

Installation

Simply merge the contents of the zip file into your Kerbal Space Program folder.

Usage

Add the Compotronix SCS part to your vessel; it’s under the “Control†category in the Vehicle Assembly Building or Space Plane Hanger. After hitting launch, you can right-click on the part and select the “Open Terminal†option. This will give you access to the KerboScript interface where you can begin issuing commands and writing programs.

The SCS module requires some electric charge to operate. You can shut it off to save power by right-clicking it and using the "Toggle Power" option.

Some commands can be aborted, including programs that you have run. Simply open the terminal and hit control-c to break. This is useful if you accidentally write something that runs forever.

Documentation

Readme page on GitHub - Contains full KerboScript manual

Dev blog - This will be the primary source for news about the mod.

Changelog - Details on each and every release, by popular demand

WIKI

Community WIKI - created by norcalairman, maintained by Bizz Keryear

Introductory videos

License

This software is released under the GNU GPL version 3, 29 July 2007. View complete license on GitHub.

Edited by Specialist290
Adding notice of new development thread to OP.
Link to comment
Share on other sites

I found a strange bug. When I try to open the terminal, I'm greeted with this

49Ths.png

I do have a lot of mods installed, so I'll see if I can figure out what is causing the problem.

Edit: Nope, nothing to do with mods. I'm playing on a Mac if that helps. Also, I got in contact with you via reddit while this was being approved so this edit doesn't really meant much :/

Edited by Googie
Link to comment
Share on other sites

Nice! One suggestion: one of the flight statistics it would be nice to have is ATTITUDE (not to be confused with ALTITUDE), a vector describing the ship's current attitude, allowing you to make relative adjustments, e.g. LOCK STEERING TO ATTITUDE + R(0.1, 0, 0) or something like that...

Link to comment
Share on other sites

Dear KevenLaity,

I was trying to install your add-on today and it appears to be not functioning correctly! I installed the files and build a test vehicle. When I opened the window, there were a bunch of question marks! Any solution or ideas?

Thanks

Link to comment
Share on other sites

This is great! Can it handle vector math like dot products and cross products? I see this can run on inactive ships which is great! Can it handle target vectors like relative velocity, direction, and distance? Also, how does it handle controls? When you set it to turn over for the gravity turn, it was very smooth and gradual, but you didn't put in any code to handle turn rates.

EDIT:

I recommend starting a wiki documentation page with every command, along with its inputs/outputs, and what type of data it uses (I/O vector or number or variable or object or target or table or array etc.). Like the Gmod Expression 2 wiki. Also should add an error checker that we can run to verify the code before actually using it.

Edited by Blaylock1988
Link to comment
Share on other sites

If you get the Question Marks, maybe you put the Parts and Plugins Folders into the GameData Folder! That does not work. You need to put these Folders into the Mainfolder where the ksp.exe is found. Had the same problem here, now it works ;-)

BUT!!! @KevinLaity:

In Germany the -> : does not work! It is on the Ö-Key on German Keyboards and that does not Type anything in the console ;-) Maybe you need make a workaround for that problem ;-) I've tried to set the Keyboardlayout to English, and in Windows itself it the Ö-Key gives me the : but not in your Mod!

Anyway, this mod can be awesome! But it definitely needs Loops.

In conjunction with the print command and the other stuff we could make our own GUI's in your mod.

Than it would be possible to read the altitude, velocity and the position every second for Landing Gui's or something like that ;-)

Could than look like that:


Landing Computer
---------------------------------------
Current Altitude: 1000m
Current Velocity: 300m/s
Current Hor. Velocity: 100m/s
Current Vert. Velocity: 200m/s
Position:
(THE POSITION) ;-)

Current Status: Prepare for Landing!

I've done the Machinery-Stuff in Minecraft with the ComputerCraft Mod. Maybe you could take a look at the api from ComputerCraft, but this is written in lua.

Link to comment
Share on other sites

I found a strange bug. When I try to open the terminal, I'm greeted with this

49Ths.png

I do have a lot of mods installed, so I'll see if I can figure out what is causing the problem.

Edit: Nope, nothing to do with mods. I'm playing on a Mac if that helps. Also, I got in contact with you via reddit while this was being approved so this edit doesn't really meant much :/

This mod has to be installed the old pre .20 way. i had this same issue when I made a folder in GameData and put the files there. the files need to be put in the plugins and parts folder directly stemming from the KSP folder, not the GameData folder.

Link to comment
Share on other sites

I'd like to say thanks for making this mod. It's already awesome, and will likely be one of the most essential mods for KSP. Bravo.

I'd also like to request that it be possible to use variables inside the vector triplets. If this is already possible, then please let me know how, because everytime I try something like R(0,X,0) I get what essentially amounts to a syntax error.

Thanks much for the mod!

Link to comment
Share on other sites

I'm running in to another issue. Maybe I'm just not doing it right, but I can't seem to use the resource tags. I'm trying:

print <IntakeAir>.

This yields the syntax error again - unrecognized term ''.

If anyone knows what is wrong, I'd appreciate any direction.

Link to comment
Share on other sites

Please change endings to ; as opposed to .

It'd be a lot more comfortable for anyone who's been programming before, and doesn't learn new people bad habits. To new programmers, and old programmers it is very annoying to use the period. I am used to programming C so I automatically am typing the semicolon instead. Also people who are interested in this mod will probably be interested in programming. They should start getting used to ; before it becomes a bad habit that is hard to correct in the future.

Link to comment
Share on other sites

Are you gonna fix the keyboard layout issue?

because not everyone uses QWERTY layout.

Nope, he hasn't fixed it.

I still can't use:

ALT:APOAPSIS

ALT:PERIAPSIS

ETA:APOAPSIS

ETA:PERIAPSIS

MAG:NODE

MAG:ETA

STAGE:LIQUIDFUEL

STAGE:OXIDIZER

By the way. Is it possible to read the current State of SAS or RCS for example? Would need it for my GUI "FlightMonitor" ;-)

The new Version with Loops is GREAT!!!

It's a nice Mod, but i would love it more if i could use the -> : <- ;-) But with the QWERTZ-Keyboard you can't make it in your mod;-)

Here is a Pic of my current Flight Monitor ;-)

rcyxmmxh_png.htm

Link to comment
Share on other sites

In Germany the -> : does not work! It is on the Ö-Key on German Keyboards and that does not Type anything in the console ;-) Maybe you need make a workaround for that problem ;-) I've tried to set the Keyboardlayout to English, and in Windows itself it the Ö-Key gives me the : but not in your Mod!

I have the same problem using an american keyboard with the american layout. Some keys register fine in console, but others ignore the console and instead activate other things at the launchpad.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...