@DemonEmperor
The behaviortrees are very simplistic and don't really offer a lot of options. They're indeed essentially linear. The most you can really get out of them is structures like:
state = 1;
if state == 1{
dostuff();
state = 2;
}
if state == 2{
dootherstuff();
}
Honestly I wouldn't bother trying on them too much. Besides not having much of control over flow, the conditionals are extremely limited and the actions basically consist of a few pre determined options only a few ever make sense in their context. They're also combined together using variables held invisibly somewhere in the c++ code that you cant really access. As a cherry on the cake, mistakes here often crash the client, and even if they don't, usually don't really give you any useful info.
Structure wise, you basically have 3 types of xml tags.
1. Definitions /datatypes. You cant do anything with these. It just helps you to see what can be done
2. BehaviorTreeNodes. The meat of the behaviortrees. These form the 'tree' structures and indicate what type of node were dealing with.
3. TreeData. Variables belonging to the nodes. The combination of NodeId and TreeName points to a unique node among the BehaviorTreeNodes. The DefnId shows you what type of variable it describes. Look up what nodetype its refering to in BehaviorTreeNodes, then combine that with the DefnId here. That points to a unique value in the NodeDataDefinitions that will tell you what kind of variable it is. If NodeDataDefinitions mentions a DefnId that isnt used in the TreeData, then you can add it yourself if you want to.
The Jumptos in BehaviorTreeNodes organize the flow somewhat. A node with a jumpto is basically like a set of brackets, starting with the node youre in, ending right before the mentioned node, or if you want, they form a branch. Use a jumpto with the first nodeid no longer in the tree to exit the tree, the operation that this tree was running on will end when you do that. Since the jumptos basically indicate branches/brackets rather than gotos you cant actually jump back to earlier nodes nor can you switch to other branches. Using Concurrent, Priority and Sequence nodes you can create a sort of structure of if statements. "Sort of" because as far as I remember (it's been a while) it's impossible to do proper "else" and "elseif" blocks. I gave up trying anyway
Some node types basically halt execution of the tree until some condition is met. For example, a move to node will not complete until the units have reached their goal. Others basically pass instantly, sometimes unexpectedly. The make formation node for example always passes instantly. If units cant make formations the turn that node is acitvated, the tree will keep going on
If you want more detailed info on any of the nodes in particular I could try and give you some pointers. All my knowledge is experimental/inferred though, so in some cases I don't know what exactly is going on either