Modding:BehaviorTrees:Decorator
From Starbounder - Starbound Wiki
Work In Progress!
This article or section is currently in the process of an expansion or major restructuring.
You are welcome to assist in its construction by editing it as well.
Last edited by Lunar Eye Gaming on 2020-11-16 17:28:54.
Decorator nodes are one type of node used to build the behavior trees governing Starbound's NPC AI. These nodes take exactly one child node, and they perform an operation on that node's output.
All decorator nodes are defined in /behaviors/nodes/decorator.nodes
.
Node Name | Properties | Description |
---|---|---|
inverter | n/a | Succeeds when the child node fails and fails when the child node succeeds. |
failer | n/a | Fails regardless of the child node's outcome. |
succeeder | n/a | Succeeds regardless of the child node's outcome. |
limiter | limit | |
repeater | maxLoops, untilSuccess | Repeats the child node maxLoops times or until the child node succeeds if untilSuccess is true. |
cooldown | cooldown, onFail, onSuccess | Runs the child node only if cooldown seconds have passed since the last time it ran. onFail determines if the cooldown should start when the child node fails, and onSuccess determines if the cooldown should start when the child node succeeds. |
optional | shouldRun | Runs the child node only if shouldRun is true. |
logResult | text | Sends text formatted with the result of the child node to the Starbound log. |
filter | list, type | Iterates through list and determines whether to keep each item by the outcome of the child node. |
each | list, type | Iterates through list and evaluates the child node with eachItem set as a key. |