Jump to content

Setting autopilot RadialOut results in it being set to RadialIn (Values swapped?)


Recommended Posts

Edit:  On a hunch, I tried setting it to RadialIn, and RadialOut got set.

Are these values swapped internally?

===== Orig post below ======

Subject says it all.  Printing to the log shows it is correct, but on screen and the behaviour shows it is not.  This is all being done in the FixedUpdate call

Here is the code:

SelectAutopilotMode(this.vessel, VesselAutopilot.AutopilotMode.RadialOut);
        public void SelectAutopilotMode(Vessel currentVessel, VesselAutopilot.AutopilotMode autopilotMode)
        {
            if (!currentVessel.Autopilot.Enabled|| currentVessel.Autopilot.Mode != autopilotMode)
            {
                if (!currentVessel.Autopilot.CanSetMode(autopilotMode))
                {
                    suicideBurnError = "Cannot set autopilot value, pilot/probe does not support " + autopilotMode.ToString() + ", or there is no node/target";
                    Log.Info("Cannot set autopilot value, pilot/probe does not support " + autopilotMode.ToString() + ", or there is no node/target");
                    return;
                }
                bool rc;
                if (!currentVessel.Autopilot.Enabled)
                {
                    rc = currentVessel.Autopilot.Enable(autopilotMode);
                }
                else
                {
                    rc = currentVessel.Autopilot.SetMode(autopilotMode);
                }
                Log.Info("Setting Autopilot: " + currentVessel.Autopilot.Mode.ToString());
                
                if (!rc)
                {
                    Log.Info("Unable to set autopilot mode");
                    suicideBurnError = "Unable to set autopilot mode";
                }
            }
        }

 

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 3 years later...
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...