Jump to content

kOS Autopilot


erendrake

Recommended Posts

Lock to prograde and lock throttle to 1 commands do not work while out of remote tech 2 range. The whole reason I downloaded this mod was to be able to do things while out of communications range.

That sounds like a bug where RT2 is overriding kOS to me. It sounds like RT2's "lock user out of controls if out of range" isn't differentiating between controls caused by manual input devices like keyboards and joysticks from controls caused by automation.

I've wanted to get into RT2 for a while now but I've held off because I keep seeing some pretty severe issues with it not playing well with kOS in the github issues list. Until those issues go away I'm staying clear of RT2.

Link to comment
Share on other sites

That sounds like a bug where RT2 is overriding kOS to me. It sounds like RT2's "lock user out of controls if out of range" isn't differentiating between controls caused by manual input devices like keyboards and joysticks from controls caused by automation.

I've wanted to get into RT2 for a while now but I've held off because I keep seeing some pretty severe issues with it not playing well with kOS in the github issues list. Until those issues go away I'm staying clear of RT2.

I assumed that's what had been happening, but for some reason sas is able to be toggled by the script. This gives me hope that this is a bug that could be worked out.

Link to comment
Share on other sites

My primitive launch program does not stage or lock throttle to 100. The program is:

SAS on.

lock throttle to 100.

stage.

Can anyone help me?

-Duxwing

I think throttle is only supposed to lock to 1 and not 100, but the result should be the same. In case of the throttle it is likely that problems are caused by the fact that the script ends almost immediately after locking. This causes the lock to be released at the same time, making it appear lock does not work. Adding a wait or another condition at the end should solve the problem.

Why the vessel does not stage I do not know. Are you sure you got your staging correctly set up?

Link to comment
Share on other sites

I think throttle is only supposed to lock to 1 and not 100, but the result should be the same. In case of the throttle it is likely that problems are caused by the fact that the script ends almost immediately after locking. This causes the lock to be released at the same time, making it appear lock does not work. Adding a wait or another condition at the end should solve the problem.

Why the vessel does not stage I do not know. Are you sure you got your staging correctly set up?

You can definitely lock the throttle to a value greater than 1. If you lock it to a value > 1, it just behaves as if you'd locked it to 1. I exploit this feature all the time by writing math expressions designed to make the throttle slow down when getting close to the cutoff condition. Rather than putting the extra code in place to to cap the value of the expression at 1.0, I just go ahead and let it be larger than 1.

As for the 'stage', 'stage' is an unreliable command. Depending on timing it sometimes works and sometimes doesn't. Whenever I stage, I do it like this:


set prevmass to 9999999.
while prevmass - minStageMass < ship:mass { set prevmass to ship:mass. stage. wait 0.2. }.

(minStageMass is the minimum hypothetical mass for a stage in my designs. It's the threshold of the check to ensure that the small mass change that comes from burning fuel for a fraction of a second won't trigger the condition. When the change in mass is larger than that, I assume the 'stage' worked and I've dropped off something significant from the craft.)

I don't think this is kOS's fault. When playing the game manually, have you noticed that its impossible to hit spacebar quickly to drop two stages back-to-back? If you mash the spacebar quickly some of those key presses result in the game just going "click" and nothing happening. I think it takes a bit of time for a stage command to perform its function. So the stage command probably started doing its work but the script ended before it finished and it was aborted before it did its job.

Edited by Steven Mading
Link to comment
Share on other sites

You can definitely lock the throttle to a value greater than 1. If you lock it to a value > 1, it just behaves as if you'd locked it to 1.

I believe that is what I said, but it is certainly what I meant :)

As for the 'stage', 'stage' is an unreliable command. Depending on timing it sometimes works and sometimes doesn't.

Good call. I assumed the script did only what was mentioned, but there could well be some other code or type of action before the posted code. In that case, you are absolutely right. I think there was a relevant discussion some while ago.

Link to comment
Share on other sites

Planets disappear, all vessel parts disappear except the core/pod.

The difficulty with diagnosing this is that many DIFFERENT unrelated problems can cause that same effect because it's not what the mod is doing, but what KSP is doing in reaction to the mod confusing it by leaving data in a 'wrong' state. What you are seeing is KSP's behavior when the mod causes unhandled exceptions to occur. KSP is a bit fragile in that it doesn't protect itself very well from mods that raise exceptions. If the mod triggers errors, then all of KSP gets broken, and the broken behavior is similar for lots of different unrelated problems mods cause. So that makes it very hard to work your way backward from "this is the symptom" to "this is the thing the mod did that caused it" when many many different errors all cause the same symptom.

It would probably help more to find the part of the KSP log where the problem first occurred and post that.

Link to comment
Share on other sites

It would probably help more to find the part of the KSP log where the problem first occurred and post that.

How do I recognise that?

Are you using ModuleManager to add a kOS module to the probe cores? Don't know why yet but that was generating problems similar to what you describe.

Yes. Will modding the cfg manually "fix" that? or do i need to use the part.

Also I'm having the RT2 issue as well.

Link to comment
Share on other sites

Yes. Will modding the cfg manually "fix" that? or do i need to use the part.

Also I'm having the RT2 issue as well.

Maybe, you should try first modding the cfg manually and if that doesn't work then use the part. Regarding the RT2 integration we already have an issue in our tracker to fix that.

Link to comment
Share on other sites

Yes. Will modding the cfg manually "fix" that? or do i need to use the part.

Maybe, you should try first modding the cfg manually and if that doesn't work then use the part.

So if I understand you correctly, what you're saying is that I should try modding the cfg, and then use the part...

Edited by Cpt. Kipard
Link to comment
Share on other sites

So if I understand you correctly, what you're saying is that I should try modding the cfg, and then use the part...

It was phrased confusingly. I *suspect* that "the part" was meant to refer to the CX-481 part. The word "the" here was ambiguous and makes it unclear. "If that doesn't work then use the part" probably meant "if that doesn't work use the part that comes with the kOS mod instead of trying to modify a command core."

Link to comment
Share on other sites

Wow. I'm trying to figure out if you're trying to troll, or if my last post went right over your head. I've never been so confused. It's a novel experience, thank you.

There was nothing intentionally confusing in what I said. Quite the opposite, I was trying to clarify something.

Link to comment
Share on other sites

Is there documentation for setting up the source code?

For example, I ran into this in the code:

using ICSharpCode.SharpZipLib.GZip;

In Persistence/ProgramFile.cs

And had to do some googling to find out what that was and what to install. Is there documentation covering this sort of stuff? (i.e. "If you want to build this project, in addition to the code you get from forking this github project, you will also need this list of stuff......")

Edited by Steven Mading
Link to comment
Share on other sites

Sadly, there is no KOS specific "shopping" list on what you need to get the dll compiling.

However, in general for KSP plugins, you need to link against some dlls in the KSP_Data/Managed folder:

UnityEngine.dll

Assembly-CSharp.dll

This usually does the trick and enables you to build the dll. If you could give a bit more details on your current state, errors and so on, it might enable us to give more specific advice to get it running.

Edited by kaesekuchen
Link to comment
Share on other sites

Is there documentation for setting up the source code?

For example, I ran into this in the code:

using ICSharpCode.SharpZipLib.GZip;

In Persistence/ProgramFile.cs

That's a dependency from an experimental feature which is disabled by default, so you could comment all the references to it if you don't want to add the library.

In fact I think we'll have to analyze if we want to keep that dependency in the future.

Thrustlimit is not being recognised, what happened?

What do you mean? You can access it using the "THRUSTLIMIT" suffix of the engines.

Link to comment
Share on other sites

Sadly, there is no KOS specific "shopping" list on what you need to get the dll compiling.

However, in general for KSP plugins, you need to link against some dlls in the KSP_Data/Managed folder:

UnityEngine.dll

Assembly-CSharp.dll

This usually does the trick and enables you to build the dll. If you could give a bit more details on your current state, errors and so on, it might enable us to give more specific advice to get it running.

The line causing the error was already mentioned in the post you are replying to. Marionapp responded and explained the problem. It was a thing that was outside the normal typical "this is what you need for a KSP mod" instructions.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...