Generic vs AI version of Events in Behaviour Tree Task

Best explaination of this is found in the API.

  • [ReceiveExecute][1]
  • [ReceiveExecuteAI][2]

If both generic and AI event versions are implemented, then only the more suitable one will be called. Meaning the AI version if the pawn is AI controlled, generic one otherwise.

Remember though, if only one is implemented, then that will get called.

In the C++ engine source, you can find the exact trigger for the differences.

You need to have a Controller to use the Behavior tree. The functions pass controllers around. That is the basis of how the tree works. You can make a custom controller with a reference to the Actor you are using, then in your Behavior tree functions, cast to that controller and get the controlled actor.

I suggest though that you re-parent your controlled class to be a Pawn. Unreal is build on the assumption that anything that can be controlled is a Pawn.

Happy to help. :slight_smile:

For example the “Event Receive Execute” and “Event Receive Execute AI”.
Is this refering to Controller vs Controllerless Behaviour Trees?
I have not found any information about using BTs in non Pawn/Character AI.
I would like to try implementing AI for example a building, say a farm managing
it’s resources, products, farmers etc.
I am refering to blueprints but I could do some of this in C++.

Thanks

Thank you very much.
My thinking is stuck in this: If AIOwner is the Controller and I don’t want to provide one, since my Actor is not a Pawn, how do I use a Behaviour Tree in blueprints without specifying a Controller?
I tried to provide a null Controller to the blueprint node “RunBehaviourTree” but this gives a runtime error.
I also checked out the blueprint node “SpawnAIFromClass” but this also expects a Pawn.

Thanks

Thank you for clarifying this.