x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Generic vs AI version of Events in Behaviour Tree Task

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

Product Version: UE 4.16
Tags:
more ▼

asked Jul 07 '17 at 01:55 PM in Blueprint Scripting

Dimitris B. gravatar image

Dimitris B.
8 1 4

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Best explaination of this is found in the API.

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.

 if (AIOwner != nullptr && //..
 {
     ReceiveExecuteAI( //..
 }
 else if ( //..
 {
     ReceiveExecute( //..
 }
more ▼

answered Jul 17 '17 at 06:29 PM

BenVlodgi gravatar image

BenVlodgi
690 22 5 22

Dimitris B. gravatar image Dimitris B. 5 days ago

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

BenVlodgi gravatar image BenVlodgi 5 days ago

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.

Dimitris B. gravatar image Dimitris B. 5 days ago

Thank you for clarifying this.

BenVlodgi gravatar image BenVlodgi 5 days ago

Happy to help. :)

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question