Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

I have a problem which hopefully somebody can help me with.

I used Module Manager to add kOS control unit functionality to all my command modules. And it works great on my rocket. Just as intended.

BUT, for some reason I can't control a satellite decoupled from that same rocket. My rocket goes up, detaches the satellite. I switch to the satellite (built around a Probodobodyne OKTO2, in case it matters), and the EXACT same script I used to control the rocket doesn't seem to work on my satellite. Specifically it's not executing the steering command.

Since it steers just fine on the rocket but not the satellite, is it safe to assume the problem here is some incompatiblity with building around a Probodobodyne OKTO2? (rather than my script)

Link to comment
Share on other sites

I have a problem which hopefully somebody can help me with.

I used Module Manager to add kOS control unit functionality to all my command modules. And it works great on my rocket. Just as intended.

BUT, for some reason I can't control a satellite decoupled from that same rocket. My rocket goes up, detaches the satellite. I switch to the satellite (built around a Probodobodyne OKTO2, in case it matters), and the EXACT same script I used to control the rocket doesn't seem to work on my satellite. Specifically it's not executing the steering command.

Since it steers just fine on the rocket but not the satellite, is it safe to assume the problem here is some incompatiblity with building around a Probodobodyne OKTO2? (rather than my script)

It is never safe to assume that :) what version of kOS are you running?

Link to comment
Share on other sites

No. I'd like there to be. Maybe it can be an upcoming feature. At the moment all you can do is react to action groups 0-9 (basically the user hitting ALT-0 through ALT-9 can be used as triggers to things in your kos script code because your code can react to the triggered action group, but that's got the big problem that people might be using those action groups for important parts of their rocket design.

how do I react ot action group toggle?

Link to comment
Share on other sites

I've not really been following development since the original author disappeared, so I wanted to check. Is the wiki still valid/up to date? Is there a better source for command reference for the current kOS version?

Link to comment
Share on other sites

how do I react ot action group toggle?


IF AG1 { PRINT "ACTION GROUP 1 IS ACTIVE". }.
// or
ON AG1 SET VAR TO TRUE.

Action groups act like toggles. if viewed as a boolean var they flip between true/false on each keypress. The ON command triggers on the next flipping regardless of if its a flip on or a flip off.

Link to comment
Share on other sites

I've not really been following development since the original author disappeared, so I wanted to check. Is the wiki still valid/up to date? Is there a better source for command reference for the current kOS version?

http://ksp-kos.github.io/KOS_DOC/

The wiki is slowly becoming out of date but much of what it says is still true. For now.

The last thing that was updated on the Wiki was to just change some of the hyperlinks to point at the newer Spacehub, github, and forum pages. Other than that nothing has really changed or kept up to date.

To a certain extent, the motivation for that Wiki was the fact that Kevin Laity hadn't really documented things much and so people in the user community tried to document it instead, using trial and error to learn how things work and then posting the information for others to read.

@erendrake seems to be much more interested than Kevin was in making sure documentation gets updated and accurately released with new changes, putting the docs on github too so they can be version tracked and updated just like code. I much prefer this to the Wikia approach.

While I like wikis and am comfortable with them, what they don't do a good job of is letting you release the docs as a set of pages all tagged together as being "version xx", so you can have both a historical and a recent and an in-development set of docs. Instead wikis only let you have *the* current set of docs, each of which has an individual history you can go back and look at, but not a collected together history of the set of all of them.

Besides, Wikia's version of mediawiki is terrible, IMO. The Wikia website is full of advertising banner boxes with badly made nonstandard javascript crud in them. I often had to quit the page and reload it to get a different set of ads in order to get the rest of the page to render right.

Edited by Steven Mading
Link to comment
Share on other sites


IF AG1 { PRINT "ACTION GROUP 1 IS ACTIVE". }.
// or
ON AG1 SET VAR TO TRUE.

Action groups act like toggles. if viewed as a boolean var they flip between true/false on each keypress. The ON command triggers on the next flipping regardless of if its a flip on or a flip off.

thanks

Interupting a running program with Ctr+c isn't working for me. I'm playing with the latest version under Ubuntu.

Edited by Voidi
Link to comment
Share on other sites

thanks

Interupting a running program with Ctr+c isn't working for me. I'm playing with the latest version under Ubuntu.

Hmm. There was one version where CTRL-C didn't work, but I've lost track of whether it was the version under final release as 0.11, or one of the pre-release 0.12-ish builds. There's been a lot of development on the pre-release side of things since the last official release (and supposedly it's going to be released as 0.12 Real Soon Now but there's one sticky problem still remaining with the two types of steering.)

But one simple question is: is the terminal window focussed or unfocussed when you press CTRL-C? If it's unfocussed then CTRL-C won't work because it will be sent to KSP itself rather than being sent to kOS.

It's a bit confusing about the focus, but weirdly all keypresses OTHER than action groups require the window to be focussed for kOS to notice them, while the action group keypresses like ALT-1 need to be done while the window is NOT focussed in order for kOS to notice them. This seems contradictory at first but there's a logical reason for it: kOS isn't really reacting to the keypress "alt-1". It's actually reacting to the event "KSP has activated action group 1", so KSP has to see the keypress so IT will activate action group 1, for that event to happen.

Link to comment
Share on other sites

Is anyone else experiencing the following problems?:

- stage:*Resource* doesn't work for any unconventional resources. It always returns 0. ship:*resource* does work for some reason.

- engine:flameout doesn't work for engines with moduleEngineFX. Works fine for conventional engines though.

Link to comment
Share on other sites

Is anyone else experiencing the following problems?:

- stage:*Resource* doesn't work for any unconventional resources. It always returns 0. ship:*resource* does work for some reason.

- engine:flameout doesn't work for engines with moduleEngineFX. Works fine for conventional engines though.

It's a known bug on the github. It's on the list of things to work on for 0.12 release.

Link to comment
Share on other sites

Hmm. There was one version where CTRL-C didn't work, but I've lost track of whether it was the version under final release as 0.11, or one of the pre-release 0.12-ish builds. There's been a lot of development on the pre-release side of things since the last official release (and supposedly it's going to be released as 0.12 Real Soon Now but there's one sticky problem still remaining with the two types of steering.)

But one simple question is: is the terminal window focussed or unfocussed when you press CTRL-C? If it's unfocussed then CTRL-C won't work because it will be sent to KSP itself rather than being sent to kOS.

i have kOS version 0.11, and program abort doesn't work ether if focused or unfocused.

Link to comment
Share on other sites

Font file which lets you see the underscores properly.

This is a PNG image file: http://imgur.com/tzh1NQw

tzh1NQw.png

It might not look like it because it's showing white foreground on transparent background, and the forums use a white background, but if you rightclick that empty space above this text you'll see there is an image file there.

If you copy that image file, and use it to replace this file:

GameData/kOS/GFX/font_sml.png

Then you'll get the underscores to show up properly in the window instead of having them look like left-pointing-arrows.

(Standard caveats apply: save the old file somewhere first in case you screw it up, and updates will overwrite this with the original font again.)

This is in no way officially supported by the mod - it's just a thing I did because I was tired of them looking like that and I wanted to use underscores in variable names. The syntax allows underscores but they look messed up in the terminal because of the default font image file.

The reason the underscores looked like they do is that Kevin Laity used a font taken from the 0-127 ASCII portion of the Commodore 64 character set, which used that symbol in place of the underscore character. (too bad it didn't use the other 128-255 extended part of the character set, because that's where all the nifty drawing characters were - for making boxes and lines around things).

Edited by Steven Mading
Link to comment
Share on other sites

(too bad it didn't use the other 128-255 extended part of the character set, because that's where all the nifty drawing characters were - for making boxes and lines around things).

We could add it, after all we're not using the lower part of the texture (the booting computer kicking animation part).

Link to comment
Share on other sites

We could add it, after all we're not using the lower part of the texture (the booting computer kicking animation part).

True, but you will also need a way to type the characters in before it would be useful - real 64's did it by holding down the "C=" key - a sort of extra shift key like ALT. Or a way for a program to build a string from ascii codes (which can't be done right now - you'd need to be able to do something like SET VAR TO "HELLO " + CHR(140) + CHR(162).

Link to comment
Share on other sites

We could add it, after all we're not using the lower part of the texture (the booting computer kicking animation part).

I didnt realize you had removed it. it used to show on bootup when you power cycled. I would be happy to include a new font file if someone wants to build us a new one :)

Link to comment
Share on other sites

Where do I start to write scripts? All I have right now is the 1 line at a time terminal but I can't find out how to get into the ingame editor. I keep seeing people say "make a text file out of game and put it into archive" but I can't find archive,where is it?

Link to comment
Share on other sites

Where do I start to write scripts? All I have right now is the 1 line at a time terminal but I can't find out how to get into the ingame editor. I keep seeing people say "make a text file out of game and put it into archive" but I can't find archive,where is it?

2 things you can do. Either go to the console in game and write "edit <Random name>." to make a new program with that name and write stuff in it. Once you're done you can safe the program (I think it was F5, it shows on the console) and run it with "run <Program name>."

Alternatively you can write programs outside the game. To use them you need to dump them in:

"<Your KSP folder>/ Plugins/PluginData/Archive"

If you miss any of those folders, just make them on your own. To then use the program you wrote you need to use the in game console and write:

"switch to Archive.

run <your program name>."

Link to comment
Share on other sites

2 things you can do. Either go to the console in game and write "edit <Random name>." to make a new program with that name and write stuff in it. Once you're done you can safe the program (I think it was F5, it shows on the console) and run it with "run <Program name>."

Alternatively you can write programs outside the game. To use them you need to dump them in:

"<Your KSP folder>/ Plugins/PluginData/Archive"

If you miss any of those folders, just make them on your own. To then use the program you wrote you need to use the in game console and write:

"switch to Archive.

run <your program name>."

I tried both of those. When I type "edit blank" it goes to the next line and does nothing. I also tried making the Archive folder and placing a file in but it did nothing as well.

Link to comment
Share on other sites

I tried both of those. When I type "edit blank" it goes to the next line and does nothing. I also tried making the Archive folder and placing a file in but it did nothing as well.

Are you sure you're putting a dot at the end of your statements?

"." is the terminator symbol used by kOS. So it only recognizes a command if you close it with that.

Link to comment
Share on other sites

you can check what archives you have with "list archives." then for each archive type "list." to see available scripts. If they're all empty then you've placed the scripts in the wrong folder.

Oh by the way the edit command no longer works. You're supposed to edit your script in notepad.

Link to comment
Share on other sites

So I completely reinstalled KOS(.23) and added the Archive folder. I placed a text file into it called "Roll". I opened up the game:

lnpvr6T.png

and nothing happens afterward. I also tried "run Roll." but it said file not found.

Link to comment
Share on other sites

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