How did you hook the "OnQueryFinishedEvent to the bind event? I can’t seem to bind it after adding an input
Oh, sorry i got it!
How did you hook the "OnQueryFinishedEvent to the bind event? I can’t seem to bind it after adding an input
Oh, sorry i got it!
An easy way is to drag from the retun value pin of the Run EQS node and search for “assign” it will automatically create an event with the correct signature. Another way is to drag from the delegate pin in the Bind Event node and search for Add Custom Event, it will also automatically create an appropriate event
Thank you! I got it set up, and now its finally printing. It prints anything that I’m near it seems, but when I go near the AI its only printing the characters display name.
EDIT: it does on the other hand print other blueprints. Just not the AI and “closestAI” is still set to none
Again, in your EQS, make sure the Generator Context is set to
Also make sure that you have selected the parent class of the AIs
And the “distance” to the ai context?
No distance should also be querier
Both is now set to querier. It prints the character name, but now the AI doesnt behavior tree is stuck at the root
Is the “searched actor class” supposed to be set to the master AI class? Sorry if i misunderstood
oooh i tested with the “searched actor class” set to the master class, and now it prints the AIs and their display name changes when I get close to one or the other. I must have forgotten about it when reading
Yeah was about to say. Does it work then?
It prints properly now, but it still runs red and the behavior gets stuck at the root again
Heres the node again
Where does the flow stop in the character blueprint
Seemed like I had some more disconnected nodes. I must have read your image wrong again. It works perfectly now
Thank you so much! I really appreciate you!
I didnt have the nodes between “UpdateClosestAIKey” and “get valid” node connected. Which is why it didnt work. But you were right, your blueprints works
And sorry for the long thread! I’ll summarize it all incase someone needs the same answer:
That should be all of it summarized I think
Thank you again Zeaf and Kaidoom15 for helping me with this
I’m glad that it works I’m thinking about a different, a bit better solution, that is less prone to errors now
Slightly better solution:
Add an event dispatcher OnClosestAIChanged in your character:
The graph is now updated:
Create a new BTService:
The service should look like this:
Add it in a relevant node in your tree, create a new boolean blackboard key and make sure to select it in your service. The IsClosestKey variable needs to be instance editable
Then in your BT add a blackboard decorator to your Closest AI subtree root, and check if your boolean key Is Set
That should do it, it’s event driven and a bit better, and won’t have any issues if an AI is destroyed while it’s the closest target for example
I believe with this you don’t need the instance sync anymore right ?
That’s correct