Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

what do you mean?

Nevermind, I just figured it out. I'm used to C++, where you set a variable, tell the program to output a statement asking for the user to give an input for that variable, then have the program wait for an input. Instead, you can use an undeclared variable in a program, define it outside the program, and everything will be hunky dory.

Link to comment
Share on other sites

I've had past release successfully integrate into my current save games. Will .9 also be able to replace my .8 file and work well with my current save game, not using, of course, my old archive scripts?

it worked fine for mine

Link to comment
Share on other sites

I've been having trouble using if.. then... in side loops. For example the demo launch by Kevin Laity

set tVal to 1.

lock throttle to tVal.
lock steering to up + R(0,0,180).
stage.
print "Launch!".

until altitude > 10000
{
if verticalspeed > 210
{
set tVal to tVal – 0.02.
}.
}.

lock steering to up + R(0,0,180) + R(0,-60,0).
print "Beginning gravity turn.".

wait 5.

until throttle = 1
{
set tVal to tVal + 0.02.
if tVal > 1 { set tVal to 1. }.
}.
// Program proceeds with staging and reaching orbit from here.

Produces the error unrecognised term 'tVal 0.02'

I tried wrapping brackets around the calculation

until altitude > 10000
{
if verticalspeed > 210
{
set tVal to (tVal–0.02).
}.
}.

but that doesn't seem to help.

Link to comment
Share on other sites

I can print velocity in 0.9, but how can I actually get at it in the program - I'm after my airspeed, so velocity:mag should be what I need... but I can't work out the magic...

Also, could we have an "eval" call that is like run, but LOCKs remain after it ends?

oh.. and in the true Kerbal spirit "MOAR History!"

Link to comment
Share on other sites

Argggh I'll never get used to learning syntax and code from videos. I miss huge tomes of spiral-bound code books and syntax guides. I wish I wasn't born in the 70's. Ironic considering I learned to code with BASIC, which kOS sort of reminds me of. But I'll check it out I guess.

Link to comment
Share on other sites

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