limboai/doc_classes/BTPlayer.xml

74 lines
3.3 KiB
XML
Raw Normal View History

2022-11-01 20:31:22 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTPlayer" inherits="Node" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
2022-11-04 12:27:09 +00:00
Player of [BehaviorTree] resources.
2022-11-01 20:31:22 +00:00
</brief_description>
<description>
2022-11-04 12:27:09 +00:00
BTPlayer is used for instantiation and playback of [BehaviorTree] resources at run time.
2022-11-01 20:31:22 +00:00
</description>
<tutorials>
</tutorials>
<methods>
<method name="restart">
<return type="void" />
<description>
2022-11-04 12:27:09 +00:00
Cancel execution of the tree and start anew. This method does not reset [Blackboard].
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="set_blackboard">
<return type="void" />
<argument index="0" name="p_blackboard" type="Blackboard" />
<description>
2022-11-04 12:27:09 +00:00
Assign a [Blackboard] instance.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="update">
<return type="void" />
<argument index="0" name="p_delta" type="float" />
<description>
2022-11-04 12:27:09 +00:00
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].
2022-11-01 20:31:22 +00:00
</description>
</method>
</methods>
<members>
<member name="active" type="bool" setter="set_active" getter="get_active" default="false">
2022-11-04 12:27:09 +00:00
If [code]true[/code], tree is active and will be processed.
2022-11-01 20:31:22 +00:00
</member>
<member name="auto_restart" type="bool" setter="set_auto_restart" getter="get_auto_restart" default="false">
2022-11-04 12:27:09 +00:00
If [code]true[/code] player will restart when it finishes executing the tree and receives a [code]SUCCESS[/code] or [code]FAILURE[/code].
2022-11-01 20:31:22 +00:00
</member>
<member name="behavior_tree" type="BehaviorTree" setter="set_behavior_tree" getter="get_behavior_tree">
2022-11-04 12:27:09 +00:00
[BehaviorTree] resource to instantiate and process at run time.
2022-11-01 20:31:22 +00:00
</member>
<member name="blackboard" type="Blackboard" setter="" getter="get_blackboard">
2022-11-04 12:27:09 +00:00
[Blackboard] instance that contains data shared by the tasks in [BehaviorTree].
2022-11-01 20:31:22 +00:00
</member>
<member name="prefetch_nodepath_vars" type="bool" setter="set_prefetch_nodepath_vars" getter="get_prefetch_nodepath_vars" default="true">
2022-11-04 12:27:09 +00:00
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.
2022-11-01 20:31:22 +00:00
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="BTPlayer.UpdateMode" default="0">
2022-11-04 12:27:09 +00:00
Defines when BehaviorTree is executed. See [enum UpdateMode].
2022-11-01 20:31:22 +00:00
</member>
</members>
<signals>
<signal name="behavior_tree_finished">
<argument index="0" name="p_status" type="int" />
<description>
2022-11-04 12:27:09 +00:00
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.
2022-11-01 20:31:22 +00:00
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
2022-11-04 12:27:09 +00:00
Process tree during the idle process.
2022-11-01 20:31:22 +00:00
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
2022-11-04 12:27:09 +00:00
Process tree during the physics process.
2022-11-01 20:31:22 +00:00
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
2022-11-04 12:27:09 +00:00
Tree is processed manually by calling [method update].
2022-11-01 20:31:22 +00:00
</constant>
</constants>
</class>