External Behavior Trees Documentation / RTS sample project

pako

New member
Hi,

I'm trying to understand how to use external Behavior Trees by reading the relevant documentation, where I see that a "Behavior Tree Reference task" must be used and where an example is demonstrated in the RTS sample project.

However, I cannot find any "Behavior Tree Reference task" in any of the Behavior Trees attached to Game Objects in the RTS sample project. I did find an "Attack" external Behavior inside the "Resources" folder of the RTS project, but it doesn't get referenced from any Behavior Tree on a GameObject in Hierarchy, or from any script (as far as I could see, but maybe I missed something).


Any help would be really appreciated!
 
Last edited:

pako

New member
Actually, I found the "Behavior Tree Reference task" on the Behavior Tree of the "Unit" prefab, inside the "Resources" folder, after watching the RTS video.

It would have been really helpful to either point directly to the "Unit" prefab in the documentation or reference the relative video as well.
 

Justin

Administrator
Staff member
Glad you are making progress :) When the behavior tree starts the reference task is consumed so that's why you don't see it in the executed tree.

Doesn't setting a reference to the latter accomplish the same thing as the former, save that with the Task you can add references to multiple External Behaviors? In other words, would the "Behavior Tree Reference task" be really useful only if we need to reference more than one External Tree?
The External Tree field is a shortcut for not using the Behavior Tree Reference task. The Behavior Tree Reference task is useful even if you only have one of them - for example, instead of starting the external tree immediately you could place it at a different location within the tree.
 

pako

New member
Glad you are making progress :) When the behavior tree starts the reference task is consumed so that's why you don't see it in the executed tree.


The External Tree field is a shortcut for not using the Behavior Tree Reference task. The Behavior Tree Reference task is useful even if you only have one of them - for example, instead of starting the external tree immediately you could place it at a different location within the tree.
It's clear now, thanks Justin!
 
Top