Run EQS Query from Blueprint

Hello all! Is there a way to run an EQS query using a blueprint? I need to be able to define the actor it is being ran on. I’m trying to run an EQS query on one actor and pass the result to a blackboard key for use in another actor’s behavior tree. For example, I made a query to find the closest object. I want to run that query on the player actor, take the result, and pass it to my AI’s blackboard. Any help? If I need to do this in C++, I have no problem with it. Thanks!

bump :~D

From what you are saying, and I’m not 100% sure what you are trying to do, it sounds like a custom context (EnvQueryContext_BlueprintBase) could work for you. You can create those in Blueprints and have the AI Behavior Tree run an EQS from the context of the Player’s Pawn, like if you want to find the closest cover point to the player, without having a crazy large search range.

Now, if that’s not what you want: EQS Queries are run from Behavior Trees, not from Blueprints; from the aspect of a non C++ project, in C++ all things are possible :). There are a number of round about ways to get to where you need to be, roughly: set a blackboard object key to null, find what you are looking for by running a Behavior Tree with your EQS query, but since you can’t know when that data will come back, simply have a gated tick running asking “is this blackboard key no longer null?” if it is no longer null, set another variable with that value, then clear the blackboard object value, and close the gate.

It would be cool to have an EQS Blueprint Node, but I think due to their nature, they could seriously end up breaking any Blueprint (they can run over many frames compared to a blueprint function having to finish in a frame).

Actually, I was just informed by Daniel Broder that a Blueprint node to run EQS queries is coming soon, possibly as soon as 4.8, they’re just working out some bugs. Thanks Daniel!

Cool! Thanks! :slight_smile: