Conditional logic

Hi,

I'm getting started with Behavior Designer, and having a little trouble getting my head wrapped around some of the concepts of the behavior tree. I'm also using Dialogue System for Unity and Quest Machine and have that integrated just fine.

What I'm trying to accomplish is this: I have an NPC that I want to be able to have a different behavior based on Quest State. The NPC should be in a neutral state while the quest is unassigned, and then as soon as the player gets the quest, then this NPC uses a different behavior tree and is more hostile. I am basically trying to just use the Solo tree from the deathmatch kit as the hostile tree. Is it possible to use more than one tree?

I wrote a Conditional that returns success or failure depending on the current quest state and that is working, though it only executes once. Which is fine for now as I'm just trying to get this to work. How can I do a basic IF statement in a behavior tree? So after I check the quest state and the conditional returns a task status of success or failure and if it's unassigned then do this, if it's active then do that. This seems really simple but I'm having trouble getting it implemented in the behavior tree. Any help would be greatly appreciated.
 
I played with it some more and I think I have it working the way I want, but I don't think the implementation is the correct way of doing things. Can someone tell me if this is the most efficient and performant way of doing what I'm trying to do? I have posted a screen of my tree so far.

Screen Shot 2022-05-05 at 10.48.43 AM.png
 
You can use conditional aborts for this sort of thing. I would combine Get Quest State and Is Quest Started into a single conditional task so you can then use the aborts:

 
Top