Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

I think one of the main reasons they would not due this is that all the scripts that people have to will have to be rewritten changing all the periods to semi-colons. But there could also be a deeper reason.

On another note, I have been playing with the vecdraw() and I was wondering if it would be possible to include the ability to draw/print the angle between two vectors on the screen for easier debugging, and also if there was any interest in that idea from others.

PRINT VANG(vector1,vector2).

Link to comment
Share on other sites

Before

SET BLARG to 1.2345.

After

SET BLARG to 1;2345;

And this:

PRINT "Hello...". ----> PRINT "Hello;;;";

Regular expression-aware find/replace could do it, but if you're talking about an audience of people who are not all experienced programmers, they won't know about it.

But basically it's backward compatibility that's the problem. There's lots of users who call it a 'bug' when they have to change code that used to work. And it can be one of the most annoying things about trying to follow other people's posted online examples of code - when the language keeps being incompatible with its own future versions. Having to be meticulously rigid about making sure you've installed exactly the right version of the interpreter to go with the code you're running is one of the more annoying things about Python, for example. (oh, this was written in 2.4 and you're running it in 2.5... thats why it stopped at this line...)

Sometimes backward compatibility is broken because a major problem cannot be fixed without changing the way things are called, but breaking it for purely cosmetic reasons, like preferring ';' over '.', seems like it's not an important enough reason to do it. The annoyance of the choice of punctuation mark is minor compared to the annoyance of knowing some users have lost interest because of "yet another breaking change".

Link to comment
Share on other sites

So next question...I would like to know my surface speed while flying over kerbin.

Changelog now states ship:velocity:surface will now return a "double".

What is a "double" (in general) and how can I ensure a IF ship:velocity:surface > 200 { line works properly?

Link to comment
Share on other sites

So next question...I would like to know my surface speed while flying over kerbin.

Changelog now states ship:velocity:surface will now return a "double".

Really? It says that? Because it's not true, and if it is true it's really the wrong thing to do. Ship:velocity:surface *should* be a vector, not a scalar.

What is a "double" (in general) and how can I ensure a IF ship:velocity:surface > 200 { line works properly?

It's a type of single scalar number. (i.e. not a vector). I could go into boring programming details you don't care about, but here's the TL;DR version: There's lots of different ways computers store numbers depending on how they're being used. Two of them in particular are called "float" and "double". The reason one is called "double" is because it takes up twice as much memory as the other one does, in exchange for being more accurate. The names were invented a long time ago when computers were less powerful, and today the kind called "double" is actually the more common default, making the naming convention a bit odd.

Because ship:velocity:surface is a vector, you can add a ":mag" suffix on the end of it to get its scalar magnitude value, for your check:

If ship:velocity:surface:mag > 200 {... etc...

Edited by Steven Mading
Link to comment
Share on other sites

I have just installed version 0.13 into KSP 0.24, but I don't seem to have a right-click option to open the terminal. Anybody else getting this or have I done something wrong?

Link to comment
Share on other sites

BREAKING: Body:Velocity now returns a <a href="http://ksp-kos.github.io/KOS_DOC/structure/orbitablevelocity/">pair of orbit/surface velocities</a> just like Vessel:Velocity does. (previously it returned just the orbit velocity as a single vector.)

Steven, I may have misunderstood. For clarification, I think I meant Vessel:Velocity, instead of what I wrote previously. Is Vessel:Velocity the same thing as what I was trying to do? (i.e., find out how fast I'm flying?)

Link to comment
Share on other sites

I'm okay with waiting (I just installed for the first time)

but I have a question first: I looked through some of the documentation and tutorials, but I couldn't find my answer.

Does KOS have access to the action groups?

What about activating options on certain parts? (like on/off for a light)

How about determining output from solar panels?...

How much electric charge is left?

I really hope it does. I have a lot of neat ideas, but they all sort of hinge on those 3 things. (think blinking different-color status lights)

I am hoping that once I dive into the KOS world, I will discover many things that were't posted in the simple tutorials.

Link to comment
Share on other sites

I'm okay with waiting (I just installed for the first time)

but I have a question first: I looked through some of the documentation and tutorials, but I couldn't find my answer.

Does KOS have access to the action groups?

What about activating options on certain parts? (like on/off for a light)

How about determining output from solar panels?...

I really hope it does. I have a lot of neat ideas, but they all sort of hinge on those 3 things. (think blinking different-color status lights)

Yes it does have access to action groups

there are some built in actions that are supported from the UI like toggling all lights and gears and panels

No solar panel output as of yet but reading from all part fields is one of our next tasks and should be out fairly soon.

Link to comment
Share on other sites

added GEOPOSITION suffixes BODY and TERRAINHEIGHT

Thanks for adding this, I was going to ask for someway to tell terrain height at a specific point, and you're already ahead of me :D

Link to comment
Share on other sites

Is there a way to use the LOCK STEERING function without having the ship going everywhere like crazy (I saw in the FAQ this was a "normal" behavior)? Or do I have to make my own heading function using raw controls? The only thing I can do safely for now with kOS is triggering groups or throttle... As soon as I try to change the heading, crazy things happen.

Link to comment
Share on other sites

I'm having some issues with the latest release.

First of all, because the default throttle setting on the launchpad is 50%, if you don't lower it down to 0% before running a program, when a program ends, say a launch program, the throttle goes back up to 50%, which is incredibly annoying.

Second I have a launch and staging program that worked fine in the last pre-release for 23.5, however now something weird is happening.

The link to the programs are here: https://www.dropbox.com/sh/9lrxgo2i2t2g2u5/AAAxYEiFAU0qHQ7UDj7Fx7p8a

What is happening is in the first "UNTIL" loop in the launch program, when you reach an altitude of 15000, the program stops working, the error message differs from one to another, but they tend to suggest an error in the staging program that works perfectly up to that point.

The other noteworthy point is you can change the point you get the error. The until loop contains 3 if statements, dictating the steering of the craft between different altitudes. The changeover at 7500 works fine, but the error seems to be coming about when the second if no longer is activated and the third if loop is. (the condition on the second if loop is "a > 7500 and a< 15000", the third if loop has the condition "a> 15000" where a is a variable locked to altitude).

Link to comment
Share on other sites

Steven, I may have misunderstood. For clarification, I think I meant Vessel:Velocity, instead of what I wrote previously. Is Vessel:Velocity the same thing as what I was trying to do? (i.e., find out how fast I'm flying?)

Vessel:Velocity is not a double. It's a pair of velocity vectors, one called :ORBIT and one called :SURFACE. You have to specify which one of the two you wanted. Notice how, when flying manually without kOS and just playing stock, you still get a different velocity reading on the navball depending on the mode it's in, "orbit" or "surface" (different speed and the yellow prograde marker is in a slightly different direction). That's the exact meaning of the two types of velocities, and that's why you need to specify which you meant.

Link to comment
Share on other sites

What is happening is in the first "UNTIL" loop in the launch program, when you reach an altitude of 15000, the program stops working, the error message differs from one to another, but they tend to suggest an error in the staging program that works perfectly up to that point.

Can you mention what the error messages actually are? Having to diagnose by guessing is hard.

Link to comment
Share on other sites

Okay, I'm losing my mind here. How do you get it to only show whole numbers when printing something that has many digits beyond the decimal? Maybe you never could and I'm not insane, but I cannot remember or find out how to anywhere.

I have a formula calculating time for a burn and want to print it on my display. currently the result shows something like "Burn in " 43.22342419847198741, and I'm trying to drop everything after the ., so "Burn in " 43. It doesn't need to be accurate, it's just a countdown, the program will be executing it at whatever fraction of the second it shows anyway. :-)

Thanks.

Link to comment
Share on other sites

ROUND() with a value of 0 for decimal places might work, I've actually never tried it. I just use FLOOR(). more math stuff

Oh Good Lord. lol Round! I should have guessed that. :-(

Okay, maybe I can ask a better question next.

Now KSP launches with greater than 0 throttle. If I forget to zero it out on launch, later, when I issue the command to unlock the throttle, it goes to that setting and the engine fires.

Is there a way to set the throttle to 0? I tried the set command, but it didn't work.

Thanks.

Link to comment
Share on other sites

Am I the only one, who don't get any buttons an both kOS parts? I searched the internet many hours for my problem, but couldn't find anything!:confused:

The problem in specific:

Tested on minimal config (KSP 0.24, both 32 and 64 bit) with only kOS 0.13.1 mod in sandbox mode.

The spacecraft has these parts:

- CX-4181 SCS

- FL-T100 Tank

- 4x LT-5 Micro Landing Struts

- 4x LV-1R Liquid Fuel Engines

- 4x OX-STAT Photovoltaic Panels

- RC-001S Remote Guidance Unit

- Z-1k Battery

I click Launch in VAB, and on Launchpad I rightclick the SCS, but there are no buttons. None for toggle on or off and none for opening the editor.

So what's my problem?? I'm really confused!

OS is Win8 64bit

Link to comment
Share on other sites

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