What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Lastmango

Member
Joined
Nov 25, 2014
Messages
173
I have some code that attempts to select local hostile targets during a "defend this dude" mission. The POI is fixed; so it's relatively easy to test.

My code to select hostiles within a radius of 15 is:
Code:
  var localActors =
                    GameManager.Actors.Values.Where(
                        b => b.Disposition == Disposition.Hostile && b.Position.Distance(new Vector3(X, Y, Z)) <= Radius)
                        .OrderBy(a => a.Distance)
                        .ToList();

I know this is working because if I change the code to friendly I see the creatures needing defending. I can open this up and see the simple creatures around on the ground as well.

When I look in Wildbuddy's objects list I see the Creature, I see it's range (usually 2-4 pts), and I see that it is hostile.

However the selection above NEVER finds it.

If I expand the range it finds normal hostile mobs on the outskirts of the small mission area. So say if I expand the Radius out to 50 my routine will run around and kill the native mobs hanging out in the area.

So why are my targets missing from the GameManager.Actors ?? is it a synchronization issue with the mission? Like those values aren't updating as fast as the mission is spawning in new mobs?

Apoc; if you want the code and profile that shows this let me know. It's easy to get to since it's a soldier holdout mission at roughly level 5. It takes less than 10 minutes to bot up to that point.

-S
 
I've figured this out :/ I have no idea how to overcome it though. When this type of mission goes active it puts you in combat without an active target. That causes the bot to suspend processing of tags and relies on the combat routine to take over from there until combat has ended.

Because there's no active target -- the mission just puts you in combat mode -- you get stuck. The displays I'm seeing coming through the buddy log at that point are just carry-overs delayed from when the bot wasn't in combat (There seems to be a lag when you spam lots of stuff to the log lol)

I think the only way to get these missions to complete is to modify the routines :/
 
If you're pulsing it through a tag, you can override CanRunDuringCombat to true and it'll be able to process the tag logic while the combat routine is pulsing. :)
 
Maybe this does something ?
Code:
GameManager.ForceUpdate();

can you find them like this ?
Code:
var acts = GameManager.Actors.Values
                        .OrderBy(a => a.Distance)
                        .ToList();
 
DD; I tried to make the profile tag Pulsable; as you mentioned. The pulse() override is not being called though.

relevant code:

Code:
        [XmlIgnore]
        public new bool CanRunDuringCombat { get { return true; } }

        [XmlIgnore]
        public new bool CanBePulsed { get { return true; } }

        public override void Pulse()
        {
            ScriptProxy.Log("In Pulse...");
            base.Pulse();
        }
 
i dont think a tag has pulse method. i think he means this:
Code:
public override async Task ProfileTagLogic()
{

}
and uses pulse as a general term.
tho i dont know for sure

Code:
public override bool CanRunDuringCombat() { return true; }
 
Last edited:
He mentioned pulse; and the ConditionalProfileElement class has a virtual Pulse() method. Hence why I was looking at Pulse :)

I did try to just run the code with the overridden properties and the the ProfileTagLogic() does not get called during combat even with the overrides.

-LM
 
i dont think a tag has pulse method. i think he means this:
Code:
public override async Task ProfileTagLogic()
{

}
and uses pulse as a general term.
tho i dont know for sure

Code:
public override bool CanRunDuringCombat() { return true; }

Pretty much this! I said 'pulsing it through a tag' because the botbase pulses, and that's what's feeding the tag, sorry! Haha.
 
i just tried it. Is it the Yeti holdout right at the beginning ?
Code:
Fierce Yeti Icefang 2,774818
Fierce Yeti Icefang 2,828606

Code:
Frost Giant 5,366033

when they spawn, they show up in the list for me
 
no; the Yeti holdout and dominion holdout work perfectly. It's the coldburrow defense mission. You enter combat but the mobs do not attack you; they are attacking the friendly injured soldiers.

I'm going to try again; but I swear even with the overrides the ProfileTagLogic didn't fire in combat.
 
I need to stop using the word "Override" because the CanRunDuringCombat isn't overridable; you have to overwrite it.
 
can you tell me zone and faction, ive never done soldier before
im Exile lv3 CampIcefury
 
It's Exile, Northern Wilderness, second Soldier mission terminal you come across outside of the Coldburrow cave when following normal quest progression. In botting I usually hit it just a nick before level 5.
 
I'm getting some Nav issues at the moment -- but I wiped and rerolled for another go at it. should only take about 15 minutes once the nav server starts responding to me.
 
well i done 2; the other one had skeech and some npc kneeling. is that it ?
its right next to (west) coldburrow cavern
Code:
Dagun Tracker 2,711058
Fierce Skeech Scratcher 2,970638

Code:
GameManager.Actors.Values.Where(a => Vector3.Distance(GameManager.LocalPlayer.Position, a.Position) < 12 && a.Disposition == Disposition.Hostile)

try derive your distance with this
Code:
Vector3.Distance(Vector3,Vector3)
 
Last edited:
Negative

Nope; it is definitely not processing my ProfileTagLogic() when combat starts:

Code:
        [XmlIgnore]
        public new bool CanRunDuringCombat { get { return true; } }
        [XmlIgnore]
        public new bool CanBePulsed { get { return true; } }

        public override async Task ProfileTagLogic()
        {
            _home = new Vector3(X,Y,Z);

            while (true)
            {
                if (HasMissionConstraint && PathConditions.IsPathMissionComplete(MissionId))
                {
                    ScriptProxy.Log("Mission Constraint Match");
                    break;
                }
                if (HasCondition && !Condition)
                {
                    ScriptProxy.Log("Regular Condition Match");
                    break;
                }
                if (HasQuestConstraint && !IsQuestAccepted)
                {
                    ScriptProxy.Log("Quest Constraint Match");
                    break;
                }
                if (HasQuestConstraint && HasObjectiveConstraint && IsObjectiveComplete)
                {
                    ScriptProxy.Log("Quest Objective Constraint Match");
                    break;
                }

                // Find killable mob in defense zone
                ScriptProxy.Log("Scanning for hostiles in radius of: " + Radius.ToString(CultureInfo.InvariantCulture));
                var localActors =
                    GameManager.Actors.Values.Where(
                        b => Vector3.Distance(_home, b.Position) <= Radius && b.Disposition == Disposition.Hostile);
                foreach (var actor in localActors)
                {
                    ScriptProxy.Log(string.Format("[{0}][{1}] {2}", actor.CreatureId, actor.Distance, actor.Name));
                }
                await Coroutine.Sleep(500);
            }

            _isFinished = true;
        }
 
The "new" operator on things won't work in this case, because the code is referencing ProfileElement. It will never call your CanRunDuringCombat, since we're not calling the tag directly, using a specific type reference. (Look up the 'new' keyword caveats)

Set CanRunDuringCombat="true" in your profile.
 
The "new" operator on things won't work in this case, because the code is referencing ProfileElement. It will never call your CanRunDuringCombat, since we're not calling the tag directly, using a specific type reference. (Look up the 'new' keyword caveats)

Set CanRunDuringCombat="true" in your profile.

I didn't think it had a setter; thanks dude. will give this a try right now.
 
Back
Top