Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

Win 64-bit is unsupported by a lot of modders for a reason. Why not use 32 bit and OpenGL mode?

I tried using openGL mode once just to see - sadly it prevents rendering shadows (yes, I know OpenGL itself doesn't prevent it, but something about how Unity is using it on an ATI card for some reason doesn't do shadows regardless of your video settings), and shadows are vital cues in KSP when manually flying a landing. I don't consider using opengl to be an acceptable way to deal with the memory limit, for that reason.

Anyway, you asked which OS, not which version of KSP. The response never said anything about whether or not KSP was 32-bit, only that the Windows version was. You can be running 32-bit KSP on 64-bit Windows OS.

Edited by Steven Mading
Link to comment
Share on other sites

Just one question. I am aware that the KOS units don't "exist" in the VAB so uploading programs isn't possible until launch but I am still wondering. I found the lines of what's on the KOS hard drive in the perisistent file and now the question: Is it possible, or advisable, to alter the parts cfg in such a way that the hard drives will have files uploaded to them the moment you hit the launch pad and the units come into existence?

you can "upload" files in the VAB by setting a "boot program".

Link to comment
Share on other sites

After countless hours of work I am thrilled to finally show my SpaceX style kOS program that can launch, boost back, and land the first stage of a rocket back on the launchpad at the Kerbal Space Center. The video is taken from different runs for film-making purposes, but the program runs from start to finish all on its own. The only thing left to do is get it so the 1st stage engine uses a separate kOS script to fire the engine once the first stage is clear (right now I'm using a few seperatrons)

The code is cleaner than some of my past work, but could still use a lot more error checking. Right now it only does a low fuel check or if it thinks there is no possible way for it to get back to the pad (more than a 50' glideslope from 10km out).

If anyone knows a good way to run two kOS units at the same time, based off one another, please lit me know! I've thought about using a simple mass detection (if the ship losses more than half its mass in a single frame, then throttle up) but am wondering if there is a better way.

Thanks, and I hope you enjoy this half as much as I did!

Take a look at the code HERE

Link to comment
Share on other sites

you can "upload" files in the VAB by setting a "boot program".

Thanks for the reply. From what I have gathered so far, the in-VAB options are limited to rename tag and lights on, the boot.ks will need to be in Archive and the same boot file will be uploaded for all KOS equipped ships. I am looking for a way to have each rocket/spaceplane design have their own, unique boot file. Any pointers to where I can find info on boot files? Google gave me 16 hits on 'ksp kos boot file' where half were unrelated to KOS or KSP.

Link to comment
Share on other sites

I have another quick question, does VESSEL:TERMVELOCITY return the correct value when used with FAR? The documentation mentions that using the ATMOSPHERE:SCALE structure with FAR returns an incorrect value, I was wondering if VESSEL:TERMVELOCITY is more accurate or if it is also off.

Link to comment
Share on other sites

Thanks for the reply. From what I have gathered so far, the in-VAB options are limited to rename tag and lights on, the boot.ks will need to be in Archive and the same boot file will be uploaded for all KOS equipped ships. I am looking for a way to have each rocket/spaceplane design have their own, unique boot file. Any pointers to where I can find info on boot files? Google gave me 16 hits on 'ksp kos boot file' where half were unrelated to KOS or KSP.

you can have different boot files. to be selectable in the VAB they need to start with "boot".(ie. boot_LV.ks, boot_sat.ks, boot.ks)

the last comment here explains pretty well enough.

Link to comment
Share on other sites

I have another quick question, does VESSEL:TERMVELOCITY return the correct value when used with FAR? The documentation mentions that using the ATMOSPHERE:SCALE structure with FAR returns an incorrect value, I was wondering if VESSEL:TERMVELOCITY is more accurate or if it is also off.

As far as I know there are no special cases in the kOS code to deal with the places that FAR breaks the base game's API.

This close to KSP 1.0 it may be a good idea to wait and see what changes FAR makes in reaction to KSP's new aerodynamics model. Chances are FAR will still exist, and will still end up invalidating parts of KSP's stock API, but it may do so in a way that differs from how it does it now.

Link to comment
Share on other sites

I don't now If this is a bug but if I don't set my throttle to 0% before I start my script when it ends the throttle will be at 50%, even if I end my script with "lock throttle to 0.".

SET SHIP:CONTROL:pilotmainthrottle to 0.

Link to comment
Share on other sites

@KK4TEE

A drop in mass will work. Another way of doing it would be to detect that the number of kOS parts on the ship had dropped.


set previousNo to 0.
set currentNo to 1.
until currentNo < previousNo {
set previousNo to currentNo.
set currentNo to ship:modulesNamed("kOSprocessor"):length.
}.

If you were using raw controls you could try:


wait until status <> "PRELAUNCH".
wait until ship:control:neutral.

another way of doing it is to use action group triggers (as action group state is the same for all cores on a ship).

Edited by TDW
Link to comment
Share on other sites

@KK4TEE

A drop in mass will work. Another way of doing it would be to detect that the number of kOS parts on the ship had dropped.

If you were using raw controls you could try:

Ah thank you! I'm working on an updated version for real solar system version and this will be helpful.

I assume that I will manually have to start the code for each kOS unit, and by that I mean "RUN lowerstage.ks" on one and "RUN upperstage.ks" on the other. Is that correct?

Link to comment
Share on other sites

I assume that I will manually have to start the code for each kOS unit, and by that I mean "RUN lowerstage.ks" on one and "RUN upperstage.ks" on the other. Is that correct?

You can set them both as boot files in the VAB. Name 1 boot_lower.ks and the other boot_upper.ks and set each core to the relevant boot script by right clicking on them.

Link to comment
Share on other sites

After countless hours of work I am thrilled to finally show my SpaceX style kOS program that can launch, boost back, and land the first stage of a rocket back on the launchpad at the Kerbal Space Center. The video is taken from different runs for film-making purposes, but the program runs from start to finish all on its own. The only thing left to do is get it so the 1st stage engine uses a separate kOS script to fire the engine once the first stage is clear (right now I'm using a few seperatrons)

The code is cleaner than some of my past work, but could still use a lot more error checking. Right now it only does a low fuel check or if it thinks there is no possible way for it to get back to the pad (more than a 50' glideslope from 10km out).

If anyone knows a good way to run two kOS units at the same time, based off one another, please lit me know! I've thought about using a simple mass detection (if the ship losses more than half its mass in a single frame, then throttle up) but am wondering if there is a better way.

Thanks, and I hope you enjoy this half as much as I did!

Take a look at the code HERE

Very nice.

Can you please share .craft file ?

Link to comment
Share on other sites

Hello!

I have started a new career safe. In the main screen, whenever I switch from the astronaut complex or mission control, the kOS config window opens. However, since there doesn't appear to be a icon in the main screen, I cannot close the window. It's slightly frustrating because the Kerbal Contruction Time window, which happens to be crucial in the main screen, sits beneath the window. I can fix it by clicking the KCT window to the front, but I have to do this every time I leave the astronaut complex or mission control, which gets slightly frustrating.

Is anyone else experiencing this?

I am not using the toolbar mod.

Link to comment
Share on other sites

I get this as well, but I am using the toolbar mod as well. Not sure what might be up, haven't had the time to really tear into the problem :(

Hello!

I have started a new career safe. In the main screen, whenever I switch from the astronaut complex or mission control, the kOS config window opens. However, since there doesn't appear to be a icon in the main screen, I cannot close the window. It's slightly frustrating because the Kerbal Contruction Time window, which happens to be crucial in the main screen, sits beneath the window. I can fix it by clicking the KCT window to the front, but I have to do this every time I leave the astronaut complex or mission control, which gets slightly frustrating.

Is anyone else experiencing this?

I am not using the toolbar mod.

Link to comment
Share on other sites

Hello!

I have started a new career safe. In the main screen, whenever I switch from the astronaut complex or mission control, the kOS config window opens. However, since there doesn't appear to be a icon in the main screen, I cannot close the window. It's slightly frustrating because the Kerbal Contruction Time window, which happens to be crucial in the main screen, sits beneath the window. I can fix it by clicking the KCT window to the front, but I have to do this every time I leave the astronaut complex or mission control, which gets slightly frustrating.

Is anyone else experiencing this?

I am not using the toolbar mod.

Can you please post your output_log.txt for me look at?

Link to comment
Share on other sites

Can you please post your output_log.txt for me look at?

I uploaded the KPS one here.

I just tried it with a stock install and kOS.

1. start new sandbox game

2. enter astronaut complex

3. leave astronaut complex

4. spam 2&3

kOS window opens, no way to close it.

Link to comment
Share on other sites

I uploaded the KPS one here.

I just tried it with a stock install and kOS.

1. start new sandbox game

2. enter astronaut complex

3. leave astronaut complex

4. spam 2&3

kOS window opens, no way to close it.

There has been recent work in 0.17.0 to fix the way the toolbar window gets spawned. There is a good chance this might get fixed when 0.17.0 is out.

Link to comment
Share on other sites

is there a way to test if a value is infinity.

What value is it that you want to check? All variable-types in programing have an some type of limit. So dividing a number by a infinitesimally small number will never return anything useful.

Link to comment
Share on other sites

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