The Editor - Lyinginbedmon/TricksyFoxes GitHub Wiki
The editor is the means by which behaviour trees are manipulated in order to achieve the desired result. It is broken down into a sort of Matryoshka Doll of nested sub-screens in order to hyper-focus on the specific aspect that the user wishes to alter.
The first step to using the editor is to open the behaviour tree screen of a mob from their inventory screen.
The Behaviour Tree screen
This screen displays the entire behaviour tree the fox is currently using. From here, you can drag the tree around to follow what it does, and you can click on specific nodes to enter the Node screen. This screen chiefly deals in the addition and deletion of nodes, by hovering over a given node two opposing buttons will be displayed: Delete and Add.
The Delete button, as one might expect, will remove the targeted node and all of its children from the behaviour tree. The Add button, also as expected, will add a new Go To leaf node to the bottom or top of the node's descendants (chosen by holding the Sneak key). Clicking on the node itself will open it in the Node screen.
The appearance of a behaviour tree in this screen can be altered by changing the fancy-trees setting in the client config. By default, it is set to true to present a more aesthetic display of the tree, but this is by far the more CPU-heavy option. The non-fancy version of the trees is the "classic" rendering method, and is much recommended for lower-end machines. The client config can also change how nodes display their input values in this screen, ranging from always to only-when-hovered to never (by entering ALWAYS, HOVERED, or NEVER respectively), depending on the user's preference.
The Node screen
This screen deals with the properties of a singular node and all of its input values. Above the node is a text field to enter a custom name for the node, which makes it easier to identify exactly what a given node or branch is intended to accomplish. Besides that is an eye button, which will cause the node to display or hide its descendants when viewed in the behaviour tree screen.
The main focus of the node screen is, predictably, to manipulate what type of node it is (control flow, leaf, condition, etc.), its subtype, and the assigned values for its inputs. When any of these parts are clicked, the screen will open a corresponding dialog.
The Dialogs
In the case of changing the type, the node screen will present a set of buttons. Clicking these buttons will alter the type of the node, erasing all descendants and losing most custom values.
In the case of changing the subtype, a list will open on the right-hand of the screen, along with a set of group tabs depending on the type of node. Here you can hover over each displayed subtype to see a brief description of its function, and clicking on them will set the subtype of the node. This does not erase the descendants (if any) of the node.
Lastly, there is the references dialog, which is associated with the input variables of the node based on its subtype. The right-hand of the screen will display a list of whiteboard references and whiteboard tabs to peruse, which are filtered according to the needs of the input variable being edited. Lastly, there may be a button at the bottom of the screen labelled "Static", which allows you to create a static value for the input (note: this is not necessarily possible for any given input).
The Static Creation dialog
This screen allows for the creation of static input values. These values are not stored in the whiteboard and hence cannot be modified contextually, nor can they be accessed by other nodes beyond the one they are stored within. In many ways, they function like values from the Constants whiteboard. Clicking a button on the left-hand side of the screen will allow you to change the type of value being provided, if possible. Once the desired variables are assigned, the Save button will create the static value within the node.
The Whiteboard screen
This screen, accessed from an icon visible on the titlecard of the behaviour tree screen, is primarily a means to peruse and review the values available across all whiteboards the mob is capable of accessing. References can, where permitted, be deleted using this screen. References marked in this fashion appear striked out, but are only actually deleted when the Save button is pressed in the behaviour tree screen (this makes it recoverable if you accidentally flag the wrong reference).
Additionally, in the Personal whiteboard exclusively, there exists a '+' button. Pressing this will open a dialog to create a new whiteboard reference with a specific name and of a specific value type. References created this way do not have any values stored inside them, but they can be overwritten later using a Prescient Scroll of the same name and type or the Copy Value leaf node. As accessing the whiteboard screen does not erase any changes to the behaviour tree, this is useful when setting up a new behaviour without repeatedly leaving the mob's UI.