Da-Teach/Questor

Trying to Warp in deadspace

Closed this issue · 13 comments

If for some reason you end up far enough away from the next acceleration gate that approach isn't an option Questor tries to warp to it (which you can't do) instead of align to, and it keeps trying over and over which I suspect looks bad.

Can you give more information please? A mission that you can repeat this error on?

Any multi-pocket deadspace, but its rare because it require circumstances to cause to you to work your way out that far. For example "The Score" let Questor kill everything in pocket 1, pause questor, motor 200 from the acceleration gate, unpause questor, questor tries to warp to acceleration gate but "Notify You cannot warp there because natural phenomena are disrupting the warp" repeatedly. What questor need to do is align to and turn on the propulsion mod.

http://forum.thehackerwithin.com/yaf_search.aspx#0|5 That should work, you can see this has been an issue for a while, but as you pointed it out it's rare. Hopefully someone will see this and take an interest in it or post their code snippet for a fix so I can merge it.

        var closest = targets.OrderBy(t => t.Distance).First();
        if (closest.Distance < 2500)
        {
            // Tell the drones module to retract drones
            Cache.Instance.IsMissionPocketDone = true;

            // We cant activate if we have drones out
            if (Cache.Instance.ActiveDrones.Count() > 0)
                return;

            // Add bookmark (before we activate)
            BookmarkPocketForSalvaging();

            // Activate it and move to the next Pocket
            closest.Activate();

            // Do not change actions, if NextPocket gets a timeout (>2 mins) then it reverts to the last action
            Logging.Log("MissionController.Activate: Activate [" + closest.Name + "] and change state to 'NextPocket'");

            State = MissionControllerState.NextPocket;
            _lastActivateAction = DateTime.Now;
        }
        else if (closest.Distance < 150000)
        {
            // Move to the target
            if (Cache.Instance.Approaching == null || Cache.Instance.Approaching.Id != closest.Id)
            {
                Logging.Log("MissionController.Activate: Approaching target [" + closest.Name + "][" + closest.Id + "]");
                closest.Approach();
            }
        }
        else
        {
            // We cant warp if we have drones out
            if (Cache.Instance.ActiveDrones.Count() > 0)
                return;

            // Probably never happens
            closest.WarpTo();
        }
    }

I think the problem is that last closest.WarpTo(); but idk if directeve has a call for align to. Maybe a align to and a timed recheck of distance so when it is close enough it does the < 150000 thing

Edit: From https://github.com/Da-Teach/Questor/blob/master/Questor.Modules/MissionController.cs

please test the fix in my fork and report back.

I'm traveling so it will be a few day before I can test it, but looking at the code I must admit I'm a little afraid of Questor calling the Approach command when the same isn't available normally from the UI at that range

The alternative is less anxiety provoking?

Well i can confirm da teach's fix does not work (your's is similar). Continues to fly away while every one second "Approaching Ship Wreckage"

        if (closest.Distance < 2500)
        {
            // Tell the drones module to retract drones
            Cache.Instance.IsMissionPocketDone = true;

            // We cant activate if we have drones out
            if (Cache.Instance.ActiveDrones.Count() > 0)
                return;

            // Add bookmark (before we activate)
            BookmarkPocketForSalvaging();
            ReloadAll();

            // Activate it and move to the next Pocket
            closest.Activate();

            // Do not change actions, if NextPocket gets a timeout (>2 mins) then it reverts to the last action
            Logging.Log("MissionController.Activate: Activate [" + closest.Name + "] and change state to 'NextPocket'");

            State = MissionControllerState.NextPocket;
            _lastActivateAction = DateTime.Now;
        }
        else if (closest.Distance < 150000)
        {
            if (DateTime.Now.Subtract(_lastApproach ).TotalMinutes > 2)
            {
                // Move to the target
                if (Cache.Instance.Approaching == null || Cache.Instance.Approaching.Id != closest.Id)
                {
                    Logging.Log("MissionController.Activate: Approaching target [" + closest.Name + "][" + closest.Id + "]");
                    closest.Approach();
                    _lastApproach = DateTime.Now;
                }
            }
        }
        else
        {
            // We cant warp if we have drones out
            if (Cache.Instance.ActiveDrones.Count() > 0)
                return;

            // Probably never happens
            closest.WarpTo();
        }

bluebirdEVE I completely agree those check should be in place, if you would like to provide a working patch for them, I will merge it.

For now I'm changing the greater than 150k action to put questor into error state. I know it won't work for most people, but I'm ok with it pausing until I check on it again.

State = MissionControllerState.Error; (might change this to panic later then it can still continue on the mission after.)

Hopefully at some point Align will be added to directeve. Thanks for your help Rixim.

we have found a way to add AlignTo

That's Great. Thanks SC