Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

when i try to save it it won't !

What have you tried?

What happened?

What didn't happen that should have happened?

no it still dont work i made a tekst With evrything but no...

What have you tried?

What happened?

What didn't happen that should have happened?

noone gonna help!?

We don't read minds.

"There was an error." is a useless bug report.

Provide as much detail as you can. From what you've posted, there's nothing that we can tell you.

Link to comment
Share on other sites

Hi,

I thought I'd try out this mod for the first time tonight.

Everything seems to be installed correctly but when I type any command into the terminal nothing happens - e.g. print "hello world" (or PRINT "hello world"), or edit "file". The only output I get is by typing "." which gives me a syntax error.

What am I doing wrong?

edit: I get the same thing on 2 different craft: One that uses the RemoteTech2 & procedural fairings plugins, and another that is just kOS plus a stock booster & cockpit in case the other plugins were interfering with kOS.

Edited by John F. Kerman
Link to comment
Share on other sites

...when I type any command into the terminal nothing happens - e.g. print "hello world" (or PRINT "hello world"), or edit "file". The only output I get is by typing "." which gives me a syntax error.

Are you typing

print "hello world"

or

print "hello world"[b].[/b]

?

Link to comment
Share on other sites

I have a question. i am new to kos and i have no exp. in programming but i was wondering if you could call a program outside of a program as if it were an extension. if that makes any sense?

yes, if you have some programs with the names launch, orbit, deorbit, land you could do this.


run launch.
run orbit.
run deorbit.
run land.

and save that as mission then you could just `run mission.`

Edited by John FX
Link to comment
Share on other sites

I have a question. i am new to kos and i have no exp. in programming but i was wondering if you could call a program outside of a program as if it were an extension. if that makes any sense?

Sample code for first script:


// script
print "Main script running.".
lock steering to up + R(0,0,180).
lock throttle to 1.
stage.
wait 5.
// blah blah blah

// here's where you run your other script.
run otherscript.

print "Back to main script.".

Sample code of second script


print "Other script running.".
// whatever other stuff

Sample output:


> run script.
Main script running.
Other script running.
Back to main script.

Link to comment
Share on other sites

Yeah, that was it, thanks.

I've been playing with this mod since it was released, and I still forget the closing period quite often.

I would have posted here earlier but I've been distracted writing kOS programs :)

This has happened more than a few times:

"I'll just fix this one bug. It'll take me five minutes."

Five hours later: "Is that the sunrise?!?"

Link to comment
Share on other sites

i maked a tekst With the commands file dragded in the plugins/plugindata/arcive

when i start the game and try to run the tekst it wont work!

You should provide more info to let us understand your problem: "...wont work" really means nothing.

kOS only works if it recognizes the commands given. E.g. pay special attention to the period (also known as fullstop) at the end of each command, kOS will not tell anything but will not execute a command without the period.

When using the kOS archive, I always do these actions (and always works), check what you may not doing the same:

- (open kOS terminal, if not yet active, or reboot kOS);

- switch to 0. (this command tells kOS to use the archive as the active volume);

- run <whatever_name_your_program_has>. (as always, the final period!)

If kOS doesn't execute but provides an error (e.g. syntax error, error at line 0, ...) fine!, that means it has read your program but found an error in there. In that case, if you can't find what the error is, upload your program and link it to your next post, or include it with your next post, someone will find what the error is.

Link to comment
Share on other sites

i maked a tekst With the commands file dragded in the plugins/plugindata/archive

when i start the game and try to run the tekst it wont work!

Also, make sure your folder is called `archive` and not `arcive` as that would also cause a problem.

Link to comment
Share on other sites

Every time I try to call another program from within a program, KSP stops responding on me. Quite annoying really as I was trying to use the same subroutine multiple times to save on program complexity.

Anyone else experience this?

Link to comment
Share on other sites

Every time I try to call another program from within a program, KSP stops responding on me. Quite annoying really as I was trying to use the same subroutine multiple times to save on program complexity.

Anyone else experience this?

The only time I have experienced hard lockups with this version of kOS is when the number of quotation marks is uneven. So something like:

print "Hello + var.

instead of

print "Hello" + var.

I would advise to check both the mother script and the child script for this error :) Running scripts from another script should work as advertised, I use it all the time.

Edited by Camacha
Link to comment
Share on other sites

Please post the commands you are using, and the response that kOS gives you. Screenshots might be good, both of kOS and the directory structure. Explain in detail what you are doing, and the response you get from the system.

What is the filename of the file you are trying to use in the archive?

Link to comment
Share on other sites

I appear to have missed this post which completely answered my question. Thank you for this, I was looking for a simple way to do exactly this without complex maths. The maths isn`t the problem but I wanted to write a total brute force KGC (AGC).

Although you already got one solution it can't hurt to have more tools in your toolbox of solutions, so here's another technique that works to find your radial-in direction without much math: Use a maneuver node to find it, like so:

1 - Make a dummy maneuver node at the point where your periapsis would be if you didn't burn, with a delta-V of -1,0,0.

2 - Add it to the flight plan.

3 - Read the delta-V vector of it.

4 - Remove the node from the flight plan. It served its purpose which was just to tell you which way to burn.

5 - Use the delta-V vector from step 3 as your steering direction.

Code would look like this:


set dummyNode to NODE( time:seconds+ETA:periapsis, (-1), 0, 0 ).
add dummyNode.
set radUnitVec to dummyNode:DELTAV.
remove dummyNode.
// "radUnitVec" is now a unit vector pointing in your radial-in direction. You can steer by it:
lock steering to radDir.

What this does is that instead of a slowly rotating burn that turns as your velocity vector rotates, it will point you at what the radial in direction *will be* at periapsis rather than which way it is right now, and it has you burn in a straight line that way, as shown below in direction 2:


KEY:
@@ = where your ship is now.
1 = Direction of radial-in now.
2 = Direction of radial-in later at periapsis.


.....
..@@_____\ 2.
... \ /
.. \ |
:: __\|
:: 1.
: ****
: **********
Pe______\ ************
: / ************
: **********
: ****
::
::
..
...
....
.....

Edited by Steven Mading
Link to comment
Share on other sites

So, supposedly KSP 0.23 is going to appear real soon now. With Kevin still gone are there any ideas about what to do about the 0.23 update? I'm going to save off a snapshot of my 0.22 game now just in case there's compatibility problems with 0.23 that could take a very long time to fix without the project admin around.

Link to comment
Share on other sites

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