Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

Updating. But then I deleted the .dll file from the plugins directory and redownloaded and resintalled it just to be absolutely sure the DLL came from the new download.

Same effect. It still says 0.4 in the terminal window.

I told it to do a search for kos.dll across the whole system and it found another one under GameData/Squad/Plugins where it definitely doesn't belong. I have no idea how it got there. I certainly didn't put it there deliberately and it must have come from one of the earlier unzippings of the mod. But in any case that was the problem. That kos.dll was getting seen first and used by the system, thus masking any newer one installed. I removed it and now it says 0.5 in the terminal window.

Link to comment
Share on other sites

That has the exact same problem.

If the unary negative operator has syntax problems saying " - verticalspeed" then it also has problems trying to say " -1 ".

Try surrounding a negative number with parenthesis ( ). For example, instead of saying -19, which the script might interpret as "subract 19", use the brackets to force the distinction. Its a common practice in real-world code circles, so that any vagueness is removed about what the programmer means. I dont know if the script is smart enough for that, but its worth a try.

Link to comment
Share on other sites

Try surrounding a negative number with parenthesis ( ). For example, instead of saying -19, which the script might interpret as "subract 19", use the brackets to force the distinction. Its a common practice in real-world code circles, so that any vagueness is removed about what the programmer means. I dont know if the script is smart enough for that, but its worth a try.

I've also had problems getting it to parse single terms inside parentheses (where the parentheses are optional because it's just one term inside) In places where (-x) doesn't parse, (0-x) does.

Link to comment
Share on other sites

What format is latitude and longitude stored in.

Printing those only shows two decimal points. Is that all the accuracy we have?

That's good enough for a minimum accuracy of about 100 meters on Kerbin, near the equator (120 m for Eve, 35 m for the Mun).

Four decimal places would probably be optimal.

Link to comment
Share on other sites

That's good enough for a minimum accuracy of about 100 meters on Kerbin, near the equator (120 m for Eve, 35 m for the Mun).

Four decimal places would probably be optimal.

Look at the following example I typed while sitting at the launchpad on Kerbin:


print longitude.
-74.58
print 10000*longitude.
-745753.80

It's just rounding them to hundredths when printing. Internally they're more precise.

This claim that they're only accurate up to hundredths seems suspicious to me this because I was using them to detect surface velocity and I know I was able to get values more fine grained than 100 meters.

Link to comment
Share on other sites

That's good enough for a minimum accuracy of about 100 meters on Kerbin, near the equator (120 m for Eve, 35 m for the Mun).

Four decimal places would probably be optimal.

They're stored internally with more places but values get rounded to two places when converted to a string (when you print).

Maybe I'll revert that change, I may have been preparing for a problem that didn't exist.

Link to comment
Share on other sites

I wonder if there's a better place to put support and future feature request posts given that this subforum is meant for mod showcasing. There's another subforum about mod support and maybe things should be moved there?

This is probably a good idea.

Link to comment
Share on other sites

They're stored internally with more places but values get rounded to two places when converted to a string (when you print).

Maybe I'll revert that change, I may have been preparing for a problem that didn't exist.

With respect I think you should allow people to round values themselves.

Link to comment
Share on other sites

The point is that I don't want to have the mod second guess which one I wanted, which is what the term "the" implies - that there's only one velocity vector. There isn't. There's 3 different ones the navball could give. I don't want the mod to give me "the" vector. I want it to provide all 3 of them and let me pick which one I'm trying to use.

I'm with you on this one. A future kOS version should support something like SURFACE:RETROGRADE, ORBIT:RETROGRADE, TARGET:RETROGRADE.

This is probably a good idea.

How about in your github? https://github.com/Nivekk/KOS/issues

On another note, I tried to check for inequality with <> and != but both don't work. I guess it's because it's missing here but it looks like it's supported here and here.

Also maybe you can add something to switch a variable from locked to unlocked and back? Like:

LOCK steering TO prograde.
UNLOCK steering. // This will fix steering to the current prograde vector but doesn't change
LOCK steering. // This will lock steering again to prograde

And I don't know if it is already possible, but is it possible to determine the targeted steering value from the actual steering value? So I can start my engines as soon as the craft is aligned correctly, because it takes a bit of time to orient to the targeted vector.

Fabian

Edited by xZise
Link to comment
Share on other sites

They're stored internally with more places but values get rounded to two places when converted to a string (when you print).

Maybe I'll revert that change, I may have been preparing for a problem that didn't exist.

Ah, makes sense. I hadn't actually played around with kOS until a couple of hours ago.. it is unbelievable. The potential with this is insane. Awesome work.

Link to comment
Share on other sites

I'm a new user of kOS (and loving it so far), but I'm having a very difficult time getting it to fly rockets straight. Whenever I launch a rocket, even by just locking steering to R(0, 0, 180) and locking the throttle to 1, it tumbles over and does some flips. I use FAR, and I think that the interaction between the two mods is what is causing the issue (as, judging by the success of others, it is safe to assume this mod works). I use a great deal of other mods too, but I think FAR is the culprit.

Does anyone else have experience running this mod with FAR?

Link to comment
Share on other sites

I'm a new user of kOS (and loving it so far), but I'm having a very difficult time getting it to fly rockets straight. Whenever I launch a rocket, even by just locking steering to R(0, 0, 180) and locking the throttle to 1, it tumbles over and does some flips. I use FAR, and I think that the interaction between the two mods is what is causing the issue (as, judging by the success of others, it is safe to assume this mod works). I use a great deal of other mods too, but I think FAR is the culprit.

Does anyone else have experience running this mod with FAR?

I run this mod with both FAR and deadly reentry and as so long as you keep your speed under control in low altitude it runs perfectly fine. Letting the speed get to high in low atmosphere however will cause it to buck and pitch and do all sorts of stuff you do not want it to do.

Link to comment
Share on other sites

I run this mod with both FAR and deadly reentry and as so long as you keep your speed under control in low altitude it runs perfectly fine. Letting the speed get to high in low atmosphere however will cause it to buck and pitch and do all sorts of stuff you do not want it to do.

This person speaks the truth. I've been using FAR for the last few months and it can be very punishing in low atmosphere. Basically do not even attempt to turn below 12k or so (where the first segment of atmosphere is), you can turn a bit in the next section but trying to lay it flat while doing mach 3+ will send you somersaulting. Over 33km or so it's thin enough not to matter, go nuts from here on out. Gimballed engines help as will wheels and wings but there is no cure all for trying to shove upteen tons of flat drag inducing crap through thick air at hypersonic speeds whilst trying to steer precisely.

You could take out FAR but then, where's the fun in that ;)

Link to comment
Share on other sites

I would quote for my response, but apparently the button doesn't work for me O.o.

I am attempting to launch a very long, slender, rocket with a pad twr of about 1.5 straight up. Although it is statically unstable, it is very easy to direct upwards manually. That is why I was surprised when it started pitching over before clearing the launch clamps.

Link to comment
Share on other sites

I'm a new user of kOS (and loving it so far), but I'm having a very difficult time getting it to fly rockets straight. Whenever I launch a rocket, even by just locking steering to R(0, 0, 180) and locking the throttle to 1, it tumbles over and does some flips. I use FAR, and I think that the interaction between the two mods is what is causing the issue (as, judging by the success of others, it is safe to assume this mod works). I use a great deal of other mods too, but I think FAR is the culprit.

Does anyone else have experience running this mod with FAR?

Are you writing lock steering to R(0, 0, 180) or lock steering to Up +R(0, 0, 180)? It should be the latter.

Link to comment
Share on other sites

I'm with you on this one. A future kOS version should support something like SURFACE:RETROGRADE, ORBIT:RETROGRADE, TARGET:RETROGRADE.

How about in your github? https://github.com/Nivekk/KOS/issues

On another note, I tried to check for inequality with <> and != but both don't work. I guess it's because it's missing here but it looks like it's supported here and here.

Also maybe you can add something to switch a variable from locked to unlocked and back? Like:

LOCK steering TO prograde.
UNLOCK steering. // This will fix steering to the current prograde vector but doesn't change
LOCK steering. // This will lock steering again to prograde

And I don't know if it is already possible, but is it possible to determine the targeted steering value from the actual steering value? So I can start my engines as soon as the craft is aligned correctly, because it takes a bit of time to orient to the targeted vector.

Fabian

If you want to freeze the lock so that it doesn't adjust to the changing prograde vector, do this:


SET x TO prograde.
LOCK steering TO x.

Link to comment
Share on other sites

I'm a new user of kOS (and loving it so far), but I'm having a very difficult time getting it to fly rockets straight. Whenever I launch a rocket, even by just locking steering to R(0, 0, 180) and locking the throttle to 1, it tumbles over and does some flips. I use FAR, and I think that the interaction between the two mods is what is causing the issue (as, judging by the success of others, it is safe to assume this mod works). I use a great deal of other mods too, but I think FAR is the culprit.

Does anyone else have experience running this mod with FAR?

There are a couple things that may cause flips. One is the fact that I can't make the ship ignore roll, the math is unexpectedly problematic. All ships start flipped 180 degrees (KSP default) and the UP vector has zero roll, so your ship may flip around wildly trying to meet that roll.

Another thing is if you don't have enough torque, this happened during the Squad interview until we both realized he didn't have enough torque, and this was making his ship go crazy during the gravity turn.

Link to comment
Share on other sites

Ok I've noticed some disturbing things from this latest update. The error checking is much reduced. I have had it run a program and just skip an error and keep going. No halt, no message. Of course the expression that was in error didn't function. It was a non terminator error. I would prefer the code to just halt and give an error message. Even if it isn't a descriptive message at least it alerts you to the error.

Link to comment
Share on other sites

Ok I've noticed some disturbing things from this latest update. The error checking is much reduced. I have had it run a program and just skip an error and keep going. No halt, no message. Of course the expression that was in error didn't function. It was a non terminator error. I would prefer the code to just halt and give an error message. Even if it isn't a descriptive message at least it alerts you to the error.

Okay, I'll check over the error checking in the next release. I think this is specifically a problem when running a script, because I've definitely gotten errors recently in immediate mode.

Link to comment
Share on other sites

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