Da-Teach/Questor

Orbit Distance

Closed this issue · 5 comments

I have noticed on missions with no defined .xml (Vengeance, The Assault) my speed tank orbits at 0km or as close as possible to 0. After examining the log, it seems that somehow a custom orbit distance has been specified. Not sure where to change this as my setting .xml has orbit distance set at 30km. Would appreciate any help with this.

MissionController: We've moved to the next Pocket [19823879.2777792]
MissionController: No mission actions specified, loading default actions
MissionController: Pocket loaded, executing the following actions
MissionController: Action.WaitUntilTargeted [timeout: 15]
MissionController: Action.ClearPocket
MissionController: Action.Done
MissionController: Using custom orbit distance: 0
MissionController.WaitUntilTargeted: We have been targeted!
MissionController: Finished Action.WaitUntilTargeted [timeout: 15]
MissionController: Starting Action.ClearPocket

Oh, I'm using experimental build.

Rx2 commented

The problem might be from the recent commit 9e5a1b1

It's a combination, basically the recent commit changed the default orbit to 0, which in my opinion restores questor to it's pre-orbiting code behavior. simply change the default in your settings.xml (actually it's named after your pilot) and let me know if that works.

I have my (char name) setting xml file specifying 35km orbit. Questor abides by this distance on missions that have an xml file. However, when it has to load the default actions it does not look at my setting xml file but rather defaults to 0 km.
I took the mission that it was happening in as mentioned above Vengeance and The Assault and made an mission xml for them. The issue goes away. So its got something to do with default actions when no mission xml is defined.

due to the Foreach if there is no XML file the code OrbitDistance = Settings.Instance.OrbitDistance; is never executed

            var pockets = xdoc.Root.Element("pockets").Elements("pocket");
            foreach (var pocket in pockets)
            {
                if ((int) pocket.Attribute("id") != pocketId)
                    continue;

                if (pocket.Element("damagetype") != null)
                    DamageType = (DamageType) Enum.Parse(typeof (DamageType), (string) pocket.Element("damagetype"), true);

                if (pocket.Element("orbitdistance") != null)//Load OrbitDistance from mission.xml, if present
                {

                    OrbitDistance = (int)pocket.Element("orbitdistance");
                    Logging.Log(string.Format("Cache: Using Mission Orbit distance {0}",OrbitDistance));
                }
                else                                            //Otherwise, use value defined in charname.xml file
                {
                    OrbitDistance = Settings.Instance.OrbitDistance;
                    Logging.Log(string.Format("Cache: Using Settings Orbit distance {0}",OrbitDistance));
                }

This is fixed in the latest update I did on my fork. 0b88cd7e4df43a8572ed69b96b571cce81dc83fe