limboai/doc_classes/BTPlayer.xml

86 lines
3.6 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTPlayer" inherits="Node" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Player of [BehaviorTree] resources.
</brief_description>
<description>
BTPlayer is used for instantiation and playback of [BehaviorTree] resources at run time.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_last_status" qualifiers="const">
<return type="int" />
<description>
Returns last execution status. See [enum BTTask.TaskStatus].
</description>
</method>
<method name="restart">
<return type="void" />
<description>
Cancel execution of the tree and start anew. This method does not reset [Blackboard].
</description>
</method>
<method name="set_blackboard">
<return type="void" />
<param index="0" name="p_blackboard" type="Blackboard" />
<description>
Assign a [Blackboard] instance.
</description>
</method>
<method name="update">
<return type="void" />
<param index="0" name="p_delta" type="float" />
<description>
Updates the tree by executing the root task. Call this method when [member update_mode] is set to [constant MANUAL]. When [member update_mode] is not set to [constant MANUAL], the tree is updated automatically. See [enum UpdateMode].
</description>
</method>
</methods>
<members>
<member name="active" type="bool" setter="set_active" getter="get_active" default="true">
If [code]true[/code], tree is active and will be processed.
</member>
<member name="behavior_tree" type="BehaviorTree" setter="set_behavior_tree" getter="get_behavior_tree">
[BehaviorTree] resource to instantiate and process at run time.
</member>
<member name="blackboard" type="Blackboard" setter="" getter="get_blackboard">
[Blackboard] instance that contains data shared by the tasks in [BehaviorTree].
</member>
<member name="monitor_performance" type="bool" setter="_set_monitor_performance" getter="_get_monitor_performance" default="false">
Add a performance monitor to "Debugger-&gt;Monitors" for each instance of this [BTPlayer].
</member>
<member name="prefetch_nodepath_vars" type="bool" setter="set_prefetch_nodepath_vars" getter="get_prefetch_nodepath_vars" default="true">
If [code]true[/code], any NodePath variables in the [Blackboard] are replaced with references during tree instantiation. References are retrieved by calling [method Node.get_node] of BTPlayer.
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="BTPlayer.UpdateMode" default="1">
Defines when BehaviorTree is executed. See [enum UpdateMode].
</member>
</members>
<signals>
<signal name="behavior_tree_finished">
<param index="0" name="p_status" type="int" />
<description>
Notifies when behavior tree finishes executing and returns [code]SUCCESS[/code] or [code]FAILURE[/code].
Argument [code]p_status[/code] holds the status returned by the behavior tree.
</description>
</signal>
<signal name="updated">
<param index="0" name="p_status" type="int" />
<description>
Emitted when BTPlayer has finished updating/ticking the tree.
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
Process tree during the idle process.
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
Process tree during the physics process.
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
Tree is processed manually by calling [method update].
</constant>
</constants>
</class>