Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove targets out of range #38

Open
kennumen opened this issue Aug 11, 2012 · 6 comments
Open

remove targets out of range #38

kennumen opened this issue Aug 11, 2012 · 6 comments

Comments

@kennumen
Copy link
Collaborator

Okay, so using ".modify speed 6" isn't exactly normal usage, but the bots never forget about a target and keep running off. Reset nor follow help, only logoff + logon (or waiting until they've killed them all + adds).

Suggest we add a check to see if target is too far (75 yards?), if so, remove. I may be a special case but this should be a good check in any case.

@blueboy
Copy link
Owner

blueboy commented Oct 12, 2012

Can you confirm that this issue pertains to combat targets & or loot targets? I believe the problem lies the loot targets!

Scenario: Travelling across hostile country with the bots in tow.

You will quickly find that your bots are left behind as they become involved in combat and subsequent looting. As you exceed the bot/master distance of 50 yds the bots will then be summoned back to your location. Unfortunately, the bots may still have a full loot list (m_lootTargets) and will thus attempt to return to the targets. On the way back they will undoubtedly encounter further targets to combat which makes matters worse.

Solution:

Sometime back there was an issue where target corpses were being left unlooted and some code was removed to resolve this;

f80a331

If we put this code back and set the default (m_confCollectDistanceMax) to 75yds as you suggest, this may do the trick.

@kennumen
Copy link
Collaborator Author

Would we need to put a periodic scan for corpses removed from the lootlist? Say we move out of range, then circle back and come across the corpses. Obviously the ranges would need to be different enough to prevent 'toggling' on and off. If you pick 75yds as out of range, then scan within 50 yds every 5 seconds?

Just a suggestion.

@blueboy
Copy link
Owner

blueboy commented Oct 13, 2012

Your suggestion has given me an idea ;) Maybe we could include some code in the 'findNearbyCreature()' function to mop up any unlooted corpses, should the bots come within range again. I'll be pushing a few more fixes to the 'new-ai' branch shortly, that I've ported from our 'onenew-ai' branch.

@blueboy
Copy link
Owner

blueboy commented Oct 14, 2012

Issue:

If the bots exceed the distance 'm_confCollectDistanceMax' set in the playerbot.conf file, then unlooted corpse guids will be removed from the m_lootTarget list. Obviously, you can manually loot these corpses later by using the 'get' command, but this can detract from normal game play. We must find a way to automate this process.

Solution:

A new function called findNearbyCorpse() services this process. If the bot collect flag COLLECT_FLAG_LOOT is set, lootable corpses detected within a set radius of the bot(s) will be added to the 'm_lootTarget' list. The corpses will then be looted (& skinned if possible) as normal.

Test:

Toggle off the COLLECT_FLAG_LOOT flag.

/p collect loot

EDIT@ You need to toggle off other flags, depending on the nature of the loot. I found that the bots were still looting skinnable creatures. I realised that they all had 'cooking' as a secondary profession. So I also needed to turn off this flag too.

The go off and kill lots of creatures, including those that can be skinned (As unlooted corpses can't be skinned, it not necessary to turn COLLECT_FLAG_SKIN flag off). Then move well away from the corpses and toggle the COLLECT_FLAG_LOOT flag back on. Approach the corpses with your bot group. As they come within the set distance (INTERACTION_DISTANCE = 5.0) they will start to loot and skin the corpses as normal.

I have created working code and I'll pushing the patch shortly to the new-ai branch.

Hope this helps

@kennumen
Copy link
Collaborator Author

awesome.

One question - the autoloot on 'lost' corpses only works once the bot happens to walk within 5 yards? Wouldn't a value between 15-25 yards be preferable?

@blueboy
Copy link
Owner

blueboy commented Oct 14, 2012

Yes, the distance can be easily set to a value between 15-25 yards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants