Hi,
I'm currently writing a custom quest behavior that should combine some other behaviors to simplify to write profiles by minimizing the needed input from the prfile writer. In my behavior tree I dynamically want the quest bot to execute another quest behavior. How do I inject the behavior (tree) of the other quest behavior in the root behavior tree, so that this behavior will be executed immediately?
Will this code do it?
Or AddChild or is there a methode in the BotBase I missed?
I'm currently writing a custom quest behavior that should combine some other behaviors to simplify to write profiles by minimizing the needed input from the prfile writer. In my behavior tree I dynamically want the quest bot to execute another quest behavior. How do I inject the behavior (tree) of the other quest behavior in the root behavior tree, so that this behavior will be executed immediately?
Will this code do it?
Code:
var currentRoot = TreeRoot.Current.Root;
if (currentRoot is GroupComposite)
{
var root = (GroupComposite)currentRoot;
root.InsertChild(0, anotherBehavior.CreateBehavior());
}
Or AddChild or is there a methode in the BotBase I missed?