Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

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.

Do you have the latest version of kOS from gitHub, which is newer than from spaceport?

I'm asking because the text editor ability of the terminal has deliberately gone away. (But might be revived in a later version). The way the terminal was altered and re-implemented meant that to make the text editor work would have required re-writing it.

Now the only supported means of editing program files is from outside KSP, with an external text editor working on the files in the Archive folder.

I'm not entirely happy with the fact that there's no longer an in-game text editor. Granted the text editor was terrible for doing any serious work, and anyone trying to work in kOS very quickly decided to use an external editor instead. But it was still useful to give new users something quick and dirty to play with to get a feel of how things work. Also, it worked on local volumes, while editing externally only works on the Archive.

I'd like to see something done addressing this, but I'm not sure what. Reviving the old text editor probably isn't such a good idea, but maybe a crude generic text area GUI widget window can be popped up - one that just directly uses an existing widget instead of trying to build a text editor from scratch.

Edited by Steven Mading
Link to comment
Share on other sites

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

If it says file not found when trying to "run roll." then there's something more wrong than just the fact that the editor no longer works.

Question 1: Is the file named "roll.txt"? The ".txt" ending is needed. Files in-game do not have the .txt ending, but kOS looks on disk for files with the .txt ending corresponding to them.

Question 2: What OS do you run KSP on? I've wondered myself about case insensitivity in the file naming convention and whether or not the mod works right on case-sensitive filesystems, but haven't had the chance to check it.

Question 3: Is the archive folder in the right place? It should be {KSP_HOME}/Plugins/PluginData/Archive, which is *NOT* where things normally go in the KSP mod system (it's not using the GameData folder).

Link to comment
Share on other sites

Do you have the latest version of kOS from gitHub, which is newer than from spaceport?

I'm asking because the text editor ability of the terminal has deliberately gone away. (But might be revived in a later version). The way the terminal was altered and re-implemented meant that to make the text editor work would have required re-writing it.

Now the only supported means of editing program files is from outside KSP, with an external text editor working on the files in the Archive folder.

I'm not entirely happy with the fact that there's no longer an in-game text editor. Granted the text editor was terrible for doing any serious work, and anyone trying to work in kOS very quickly decided to use an external editor instead. But it was still useful to give new users something quick and dirty to play with to get a feel of how things work. Also, it worked on local volumes, while editing externally only works on the Archive.

I'd like to see something done addressing this, but I'm not sure what. Reviving the old text editor probably isn't such a good idea, but maybe a crude generic text area GUI widget window can be popped up - one that just directly uses an existing widget instead of trying to build a text editor from scratch.

Downloaded and installed the Github version. It still says it can't find my "Roll" script.

My Roll Script is in:

KOS>Plugins>PluginData>Archive>Roll

switch to archive.

run Roll.

File 'roll' not found

Edit:

If it says file not found when trying to "run roll." then there's something more wrong than just the fact that the editor no longer works.

Question 1: Is the file named "roll.txt"? The ".txt" ending is needed. Files in-game do not have the .txt ending, but kOS looks on disk for files with the .txt ending corresponding to them.

Question 2: What OS do you run KSP on? I've wondered myself about case insensitivity in the file naming convention and whether or not the mod works right on case-sensitive filesystems, but haven't had the chance to check it.

Question 3: Is the archive folder in the right place? It should be {KSP_HOME}/Plugins/PluginData/Archive, which is *NOT* where things normally go in the KSP mod system (it's not using the GameData folder).

its just Roll If I do Roll.txt I get an error. I'm running Win7.

Really? I thought it would be in the KOS folder :huh:

Edit 2x:

Switched the archive to {KSP_HOME}/Plugins/PluginData/Archive

still doesn't find "Roll". I also tried "run Roll.txt." but I get a syntax error.

Edited by Codey737
Link to comment
Share on other sites

I am encountering a strange problem with 0.12. When I run a script the first time everything goes well, however when I revert to launch or the assembly building and re-run the script the rocket can no longer maintain a lock to steering. I have removed all mods except stock and kOS of course and the same thing occurs. The only way to clear the problem is to exit out to the space center, re-enter the assembly building, load the rocket, and clear the launchpad of the old rocket. It's only a minor inconvenience when testing new launch scripts but I was wondering if anyone else is having a similar problem.

Also I just want to say that I love this mod, I use mechjeb too but this is much more involving in that you have to plan out your actions, but still don't have to get your hands really dirty manually flying (I am not very coordinated and flying on my own is not very enjoyable for me).

Also also, as a side note (probably nothing to do with this mod), when the steering is locked the rocket wobbles as if the steering system is trying to stay on course but is over correcting a little and begins to oscillate back and force. It also does the same thing when in orbit with the RCS system and reaction wheels. I don't believe it's the mod, mechjeb does the exact same thing. I am hoping its not my installation, but if I need to re-install I will.

Link to comment
Share on other sites

Switched the archive to {KSP_HOME}/Plugins/PluginData/Archive

still doesn't find "Roll". I also tried "run Roll.txt." but I get a syntax error.

Test that it really is the correct directory you're putting it in. Test that by doing this:

Inside kOS, type these two commands:

SWITCH TO 0.

LOG "LINE OF TEXT" TO PROOF.

Now it should have created a file called PROOF.txt in your folder, containing the one line "LINE OF TEXT". If you don't see that file in the same folder where you put the Roll.txt file, then you're not putting it in the same place that kOS is looking at for programs. (Do you have more than one installation of KSP and you're putting it into the wrong one?)

Link to comment
Share on other sites

I am encountering a strange problem with 0.12. When I run a script the first time everything goes well, however when I revert to launch or the assembly building and re-run the script the rocket can no longer maintain a lock to steering. I have removed all mods except stock and kOS of course and the same thing occurs. The only way to clear the problem is to exit out to the space center, re-enter the assembly building, load the rocket, and clear the launchpad of the old rocket. It's only a minor inconvenience when testing new launch scripts but I was wondering if anyone else is having a similar problem.

Yes. I find that "revert to launchpad" doesn't quite clear everything out and reset it correctly, while "revert to VAB" does.

Also I just want to say that I love this mod, I use mechjeb too but this is much more involving in that you have to plan out your actions, but still don't have to get your hands really dirty manually flying (I am not very coordinated and flying on my own is not very enjoyable for me).

Also also, as a side note (probably nothing to do with this mod), when the steering is locked the rocket wobbles as if the steering system is trying to stay on course but is over correcting a little and begins to oscillate back and force. It also does the same thing when in orbit with the RCS system and reaction wheels. I don't believe it's the mod, mechjeb does the exact same thing. I am hoping its not my installation, but if I need to re-install I will.

I get the same effect when all the ship parts are "in-line". If every part is on the same axis through the middle of the ship, then the steering's attempts to keep it aligned around that axis go haywire and roll the ship back and forth in a see-saw motion around that particular axis. I found that I can make it stop by designing it with some mass being off the central axis. (i.e. slap a couple of fuel tanks on the side with 2x radial symmetry, and use yellow hose to feed them to the actual engine). Once there exists some mass that is NOT on the central axis, the wobbly steering goes away. I don't understand the steering code myself but given the effects I'd guess that somehow the LOCK STEERING algorithm doesn't deal very well with cases where the ship has a very low angular inertia around the axis in question. It tends to oversteer in that case, and gets stuck in a loop constantly trying to overcorrect itself, making the wobble get bigger and bigger over time.

Link to comment
Share on other sites

Test that it really is the correct directory you're putting it in. Test that by doing this:

Inside kOS, type these two commands:

SWITCH TO 0.

LOG "LINE OF TEXT" TO PROOF.

Now it should have created a file called PROOF.txt in your folder, containing the one line "LINE OF TEXT". If you don't see that file in the same folder where you put the Roll.txt file, then you're not putting it in the same place that kOS is looking at for programs. (Do you have more than one installation of KSP and you're putting it into the wrong one?)

That works! To my own stupidity, I uhh umm put Archive in PluginData not Plugins>PluginData( :blush: )

Is the KOS system suppose to disable all human controls? I turned off the system and it won't give control back to me(I didn't start anything just booted the system).

Link to comment
Share on other sites

That works! To my own stupidity, I uhh umm put Archive in PluginData not Plugins>PluginData( :blush: )

Is the KOS system suppose to disable all human controls? I turned off the system and it won't give control back to me(I didn't start anything just booted the system).

Is your program still running? Just closing the terminal doesn't stop the program from running, and while the program is doing stuff you can't manually adjust whatever the program works with. (no throttle control if you program locks throttle f.ex).

I always just build in an instant exit option to AG9 into my programs. So I can exit them whenever I feel like.

Link to comment
Share on other sites

Is your program still running? Just closing the terminal doesn't stop the program from running, and while the program is doing stuff you can't manually adjust whatever the program works with. (no throttle control if you program locks throttle f.ex).

I always just build in an instant exit option to AG9 into my programs. So I can exit them whenever I feel like.

Nope its not running. Even if I don't start it, I can't control the throttle(just Yaw,pitch,roll). If I run a program that messes with the thottle and I ctl+C it I can get my throttle control back. If I start it via AGx and turn it off via AGx it still locks my throttle.

Link to comment
Share on other sites

Nope its not running. Even if I don't start it, I can't control the throttle(just Yaw,pitch,roll). If I run a program that messes with the thottle and I ctl+C it I can get my throttle control back. If I start it via AGx and turn it off via AGx it still locks my throttle.

This is a known bug that we are working on for v0.12.1 if you are using LOCK STEERING you can try UNLOCK STEERING before the end of your script. you can track the progress on this issue https://github.com/KSP-KOS/KOS/issues/69 Sorry for the inconvience

Link to comment
Share on other sites

Some have mentioned it already but we have a new release of kOS v0.12.0

This release has been a lot of work by a few dedicated members of the community. Big thanks out to those involved


Thanks to all of the hard work by @marianoapp and @Dunbaratu, We have a new parser!

Known Issues
======
* There's no built-in editor, the "edit" command is parsed but it doesn't do anything
* Some subprogram termination can hang kOS unexpectedly
* Steering control does not always release on execution end

Changes
======

* the aforementioned new parser by @marianoapp with all of its speed improvements and other goodies.
* There's a config SpecialValue that can be used to control how some of the mod features work, like setting the execution speed, the integration with RT2 and starting from the archive volume.
* The terminal screen can be scrolled using PageUp and PageDown
* Negative numbers/expressions can be written starting with a minus sign, so no more "0-..."
* Added ELSE syntax!
* Added ELSE syntax!
* Added NOT syntax!!
* Added List square brackets [] as list subelement accessor
* you can use variables as arguments for PRINT AT statements

This version adds a new 0.625m part. Thanks to SMA on this neat new addition.
* it works as a kOS computer core
* has 5000 units of code space
* as a smaller part it is unlocked with "precision engineering" in career mode.
* also has a light that will be controllable before the actual release


Bug fixes
* Cannot "set" a variable that later will become a "lock" #13
* Sanitize values sent to KSP #14
* Strange order of operations: "and" seems to evaluate before ">" #20
* moved some names back to "kOS"
* Work on some structure's ToString return.
* Parameters now get passed in the correct order
* Ship resources no longer generate an error if they arent present
* Ctrl+C now interrupts correctly once again.
* ETA:TRANSITION returns the correct time.
* Better handling of types.

If you notice an issue we have a list of bugs for an upcoming patch on the github tracker, you can check the status

https://github.com/KSP-KOS/KOS/issues?milestone=2&state=open

https://github.com/KSP-KOS/KOS/issues

Link to comment
Share on other sites


Thanks to all of the hard work by @marianoapp and @Dunbaratu, We have a new parser!

For the record, the credit and bragging rights for the new parser, and the awesome speed increase from the k-RISC system, belongs entirely to @marianoapp, not me ("Dunbaratu" is my other username in certain contexts, for those who don't know). I'm a total newbie to the project (I've been a user of kOS a while, but not a programmer for it). I only just barely started getting involved in contributing code changes, with a bit of a bumpy start being new to both C# and to github, well after marianoapp's kRISC system was already done being merged into the project. It would have been there whether I was involved or not. I just modified a few bits of syntax here and there after the system was already in place.

(I feel a bit embarassed by the implication that we have a new parser "thanks to" both of us when it's really 99.99% him. Feels like I'm steeling credit.)

Oh, and to go along with the release announcement, the documentation is updated a little bit as well:

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

Link to comment
Share on other sites

Okay.. so I wrote a short test script to see how .12 is working. I didnt see kOS create the archive folder in the original default place. Has it moved? If so, where? without the in-game editor, I dont know where to place my script? thanks.

Link to comment
Share on other sites

Okay.. so I wrote a short test script to see how .12 is working. I didnt see kOS create the archive folder in the original default place. Has it moved? If so, where? without the in-game editor, I dont know where to place my script? thanks.

There has been no change to the folder location. Where are you trying to run it from?

Link to comment
Share on other sites

0.12 fixed a lot of things in regards to engineFX modules, but it seems that the unlock command is completely broken.

This is a simple gravity turn program I wrote to test a new stager.


// INIT
Clearscreen.
print "Launch!".
stage.


set TargetH to 240000.
lock throttle to 1.
set v to up + r(0,0,-180).
set pitch to 0.
lock steering to v.
set DeFlag to 0.
on AG8 set DeFlag to 1.

//Main loop
until Alt:Apoapsis > TargetH OR DeFlag = 1 {
set pitch to -90*sqrt(Alt:Apoapsis/TargetH).
set v to up + r(0,pitch,-180).
run stager.
}.

//Cleanup
unlock ALL.
lock throttle to 0.
unlock steering.
print "Thanks for flying!".

The stager works beatifully, but I can't get the program to release the throttle and steering. I attempted to unlock all variables, lock throttle to 0 and specifically unlock the steering. But none of that helps. It seems to just skip over the "Lock throttle to 0." since the engines keep firing even after the program ends.

I assume this relates to the "* Steering control does not always release on execution end" bug?

Link to comment
Share on other sites

I noticed some people complain about how scripts in the latest version won't unlock throttle control.

But in mine, I never get throttle control to begin with. I just start off on the launchpad/runway with no ability to throttle up manually. I haven't even run a script yet. Needless to say, that's game breaking so I'm rolling back to the previous kOS version for the time being. Hopefully the next one fixes that.

I'm running KSP 0.23.5 on Mac OS 10.9, in case it matters.

Link to comment
Share on other sites

I noticed some people complain about how scripts in the latest version won't unlock throttle control.

But in mine, I never get throttle control to begin with. I just start off on the launchpad/runway with no ability to throttle up manually. I haven't even run a script yet. Needless to say, that's game breaking so I'm rolling back to the previous kOS version for the time being. Hopefully the next one fixes that.

I'm running KSP 0.23.5 on Mac OS 10.9, in case it matters.

Can you show us the script you were running, for debugging purposes?

Link to comment
Share on other sites

Is there any tutorial for absolute noobs anywhere?

I can't seem to make anything work. Getting really frustrated, I don't know if I'm, doing everything wrong or there's a problem with my KOS install.

For example, typing edit demo. does nothing.

Where are the scripts supposed to be saved?

I'm using latest KSP and latest KOS.

Link to comment
Share on other sites

Can you show us the script you were running, for debugging purposes?

I didn't run any script, that was the point I was trying to highlight. The throttle just started off completely broken. Reverting to the previous kOS version fixed it.

Link to comment
Share on other sites

at the moment, im not trying to run it from anywhere as i dont know where to/how to load the script apparently. Im used to the old Nivekk style from .\archive

What I'm saying is that there has been no change to that old style. It's in exactly the same place:

{KSP_HOME}/Plugins/PluginData/Archive/

(Granted I don't like it being there as it breaks KSP's GameData/ model, but the point is that that is where it is and it never has been changed)

Link to comment
Share on other sites

Is there any tutorial for absolute noobs anywhere?

I can't seem to make anything work. Getting really frustrated, I don't know if I'm, doing everything wrong or there's a problem with my KOS install.

For example, typing edit demo. does nothing.

Where are the scripts supposed to be saved?

I'm using latest KSP and latest KOS.

Short explanation:

The text editor feature went away because of the amount of effort to maintain it and the fact that everybody preferred external editors to it. I'd like to see it come back in some form - perhaps by just popping open a KSP window on the side with a standard text area widget in it.

But for the moment it doesn't work. Do this:

1. Edit a text file externally to KSP - in something like notepad or whatever. Save it to:

{KSP_HOME}/PluginsPluginData/Archive/

Make sure it's named with a ".txt" ending or KOS won't use it.

2. Inside KSP, in the KOS terminal, type:


switch to archive.
run filename.

Where filename is the name of the file, but without the ".txt" ending on it.

You have to pick a filename that works as a KOS identifier (i.e. no spaces in the name, for example).

Longer answer: Go here: http://kos.wikia.com/wiki/Archive_and_Volumes

Link to comment
Share on other sites

I didn't run any script, that was the point I was trying to highlight. The throttle just started off completely broken. Reverting to the previous kOS version fixed it.

Well what were you typing at the terminal then, is what I mean. Was it just this:

LOCK THROTTLE TO 1.

and that's all, or was there more to it?

Link to comment
Share on other sites

Same thing happening to me. No need to open a kOS terminal at all. Just go to the launch pad. When the ship has a CPU unit, then for some reason you can't control the engine. kOS console's "list engines" command shows 0 engines on the ship, too.

KSP.logs show nothing. Are there any other logs to look at?

EDIT: It looks like it might be related with some keybindings? The reason engine doesn't throttle up seems to be that all other keys also don't work... Except the space bar, but WASD is not.

Edited by Rosco P. Coltrane
Link to comment
Share on other sites

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