Page 1 of 1
How does BotBehaviorSet.SearchItemRange work?
Posted: Fri Feb 21, 2020 6:14 pm
by NearHuscarl
I want to limit the radius bots can search for weapons. Currently I have tried multiple values but I am unable to get a result that make sense. I want to do 2 things:
- Draw a search radius to better understand and debug. Something like
Code: Select all
Game.DrawCircle(player.GetWorldPosition(), player.GetBotBehaviorSet().SearchItemRange ??)
- Limit the search range to really close range. Particularly in my case, I want any weapons outside of the blue lines should not be picked up at all. All of the values I tried didn't work so far
EDIT:
Here is the map
Re: How does BotBehaviorSet.SearchItemRange work?
Posted: Fri Feb 21, 2020 9:18 pm
by JakSparro98
For debugging the search item range all you need to do is simply enable one of the already available debug features (F7)
Keep in mind that every modification you do on a BotBehaviorSet needs to be reflected on the bot itself(since you are working on a cloned instance and not a reference), you need to set the behavior back like so:
Code: Select all
BotBehaviorSet BehaviorSet=plr.GetBotBehaviorSet();
BehaviorSet.SearchItemRange=45;
plr.SetBotBehaviorSet(BehaviorSet);
Re: How does BotBehaviorSet.SearchItemRange work?
Posted: Fri Feb 21, 2020 9:53 pm
by NearHuscarl
Thanks for the quick response. Now I can properly see the search range. But now the bots still search for weapons that are way outside of the green circle so I am still not sure how does that work.

Re: How does BotBehaviorSet.SearchItemRange work?
Posted: Fri Feb 21, 2020 10:27 pm
by JakSparro98
Mhn, yeah... I'm conducting some tests and It seems that it's ignoring the new range, that happens not only for item search but for all the others ranged properties, I'm pretty sure it was working as intended in the past, let's wait to @Gurt before saying the last word (that is bug).
Re: How does BotBehaviorSet.SearchItemRange work?
Posted: Sat Feb 22, 2020 2:56 pm
by Gurt
If a bot has already spotted a weapon before you change the search range the bot will still go for the search item if it's within an extra 300 distance.
Default search range is 250 I think. You may have better luck changing this value as the bot is created instead of changing it afterwards.
Perhaps we should add something to reset the bot's search item if the search range has changed, but don't know if that's the case here.
Re: How does BotBehaviorSet.SearchItemRange work?
Posted: Sat Feb 22, 2020 5:07 pm
by NearHuscarl
Pretty sure I spawned the weapon after the range was reset, the bot still went for it
https://i.imgur.com/97DTViz.mp4
UPDATE: it looks like it's been fixed in the latest update 1.3.5