Skip to content
fian46 edited this page Sep 14, 2020 · 11 revisions

Welcome to the addons-btree wiki!

1. Instalation

clone or download the addons folder and put it on your project, then activate the plugins in project settings

files

setting

2. Concept

  • it is just a behavior tree there is no magic here you need to learn the concept, search it on the internet.
  • the addons work only with single script but you can combine multiple tree in one parent. for example you can separate animation tree from logic tree

mtree

3. How to use

  • in any node add BTREE node as it children. that node must have a script ! or the plugins will error.

create

  • select BTREE node and switch to tree editor window

5

  • you also need a node to connect to the root or it will not running
  • to create a task / leaf node, you need to make a function with name start with "task_*()". for example to scan input the function name can be something like "task_capture_input(task)" the function also need to accept one argument. this argument is flow control
  • the "task" argument for every task you can call succeed() to complete success or failed() to complete failed. if you not called anything then the task status is running. that means in the next tick it will called again until you call succeed() or failed()

6

7

  • You can also passing argument to the task from the tree editor. this is useful when creating some kind of dialogue system for NPC or to play some animation.

8

9

  • You can look up the rest of the node behavior by hover your mouse. there is tool tip you can use. also there is help button to explain some basic control like copy node, delete node and saving stuff.

4. Debugger

  • You can visualize current running btree instance in your game by click debug button, but your game must running first or debugger will not show anything.
  • Currently you only can see the status but if you need any fancy thing, please create an issue.
  • Debbuger
  • d1
  • d2
  • debugger will not work with mobile currently, only local machine is supported
  • you can pause a btree during debugging by pressing pause
  • you can step a btree during pause by pressing and hold step button
Clone this wiki locally