EQS outside of AI: Player as Querier?

Hi guys,

I’m trying to make a Manager class that monitors the game conditions and controls spawning of AI OUTSIDE of a behavior tree or blackboard. The idea is, that this manager will spawn different types of enemies based on several variables, but it’s first job is to populate a new area with wandering AI when the player enters it.

It’s supposed to check if the player can see the location, and spawn new enemies out of sight, but I can’t get the EQS to set the location: it always returns the level origin and spawns agents there, or underneath the map. The EQSQuery Querier input only asks for an object reference, which I gave by making a reference to the player on begin play. Checking the query with the EQS Testing pawn always returns a desirable spawn location, and everything compiles, but the EQS test does not seem to be running.

I’ve got it set up on a looping timer, and I disconnected the spawn portion for debugging. I’m just trying to get it to return any location at this point. Once it does that, I can figure out the rest.

OK, I think I figured it out… I don’t know if there are any potential side effects yet, but I got it working after banging my head against it for a couple hours.

I had to change the structure: EQS didn’t like being run from inside a blueprint function. It’s messy, but I laid everything out in the Manager’s event graph.

Added an IsValid? check at the end of the EQS query with some debug strings to figure out whether or not it was running, then made an event dispatcher to do the actual spawning.

Right now it does a query for each actor in the wanderer crowd size variable, which I don’t think is going to be performant in the long run, so getting it cleaned up, returning an array of matching points on a single query, and then spawning an appropriate number of Agents into those spots is my next project.