Max Nielsen
Member
I've just started using behaviour designer and I really like it, but I have a really hard time wrapping my head around how to create simple if-statements and "loops".
My AI tries to find a resource, if it finds one then go to it and gather, else go and idle at the workplace. When gathering the resource I would write code like below inside a coroutine or some sort of loop:
if(currentCarry >= maxCarry) GoStash()
else ChopWood();
Basically telling my AI to chop wood as long as he can carry more, else go stash.
How do I do something like this in BD? You can see my questionmark in red, where I assume the logic would go. If gather wood fails, I want to rerun the tree (finding a new resource since it fails if the current resource is depleted))
My AI tries to find a resource, if it finds one then go to it and gather, else go and idle at the workplace. When gathering the resource I would write code like below inside a coroutine or some sort of loop:
if(currentCarry >= maxCarry) GoStash()
else ChopWood();
Basically telling my AI to chop wood as long as he can carry more, else go stash.
How do I do something like this in BD? You can see my questionmark in red, where I assume the logic would go. If gather wood fails, I want to rerun the tree (finding a new resource since it fails if the current resource is depleted))