Jump to content

finding autopilot mode in the background


Recommended Posts

Question: How to get a vessel active autopilot mode while a vessel is unloaded?

I was able to find throtle, SAS shouldn't be that far off

I cannot find it anywhere in the save file. It almost as if it in simply not stored

Edited by FreeThinker
Link to comment
Share on other sites

Unless you have to have the vessel actively steer to the correct orientation based on autopilot mode when unloaded, here is an idea I though of (unless you've already tried this):

You could create a custom field in the save file under the right vessel's name, that stores the autopilot mode. You could do this using a KSPField while the vessel is loaded. When the vessel becomes unloaded, you could retrieve the value by loading the save file as a config node, and finding the right vessel using for loops and then retrieve the value.

Edited by Aniruddh
Link to comment
Share on other sites

25 minutes ago, Aniruddh said:

Not really the vessel itself, but you would have to load the save file, which I guess could affect performance?

No what I mean is you have to switch to the vessel (or some vessel in physics range) before you get access to active autopilot mode. A partmodule or vesselmodule or scenariomodule can then readout the active autopilot state.

Edited by FreeThinker
Link to comment
Share on other sites

  • 2 weeks later...

If you mean the SAS mode, it's in Vessel.Autopilot.Mode.

PS: Oh, I didn't realize you want to find it in the save. Are you sure it's even saved? I think it only applies to the active vessel. Perhaps, you can save it manually to a custom VesselModule (and then restore when the vessel is loaded).

Edited by garwel
Link to comment
Share on other sites

On 8/22/2020 at 7:36 PM, garwel said:

Oh, I didn't realize you want to find it in the save. Are you sure it's even saved?

The SAS _mode_ (prograde/radial/etc.) is not saved unless helped by a mod.. The on/off state is saved in the ActionGroups section and can be accessed in-game via Vessel.ActionGroups[KSPActionGroup.SAS];

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...