EQS random location

Hi,
I’ve been working on an archer type enemy who gets to the top of the structures with the best angle to hit the Player, for that I created an EQS query which;

first, check the Z distance to the player and then prefer the greater score.

second, shoot a filter-only line trace towards the player with the bool match unchecked to find the best spot that he can see the player.

third, check the distance to the closest location.

the Issue is when I put multiple enemies in the game they all go to the same spot and then bunch up together, What can I do to make It choose the random spot among the ideal ones so that they each go to different spots?

You can add a filter that looks for your friends and filters the points around them.

Thanks for your help,
This resolves that condense aggregation problem, but is there a way that they randomly go to the different spots?

you can get the whole list of locations

Is there a way to get access to that “Get Query Results as Locations” in the behavior tree?
so that I can store the locations and then get a random one, therefore, feed it to my " move to " task.

You can put this code in a “bt task” just before the “move to”

I assume in this way I don’t need to put a “Run EQS Query” node in my BT because I’ve already used a " Run EQS Query" function in the previous task, is that correct?

Yes, you are creating your custom EQS node.
I suppose you could also touch the c++ source and add an option to return a random location

Thank you so much for helping.

Hi, apologize for bothering
I’ve encountered another issue
In order to prevent AIs to get bunched together, I acquired all valid query results as locations with EQS run mode on “Single random Item from best 25%” as you suggested, but the issue is as the AIs reach the points they move to another one, I want them to stay where they are once they reach the points and don’t move until the player location changes and EQS gets updated to find better spots according to the player location.

That depends a lot on how you have the behavior tree, you could have a service that checks if the player has moved from the last position and then make the eqs and move to branch activate