limboai/doc_classes/BTCooldown.xml

33 lines
2.5 KiB
XML
Raw Permalink Normal View History

2022-11-01 20:31:22 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTCooldown" inherits="BTDecorator" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
2022-11-01 20:31:22 +00:00
<brief_description>
BT decorator that executes its child task only if [member duration] time has passed since the previous execution.
2022-11-01 20:31:22 +00:00
</brief_description>
<description>
BTCooldown runs its child task only if [member duration] time has passed since the last successful child task execution. It will only consider successful executions unless [member trigger_on_failure] is set to [code]true[/code].
Returns [code]RUNNING[/code], if the child task results in [code]RUNNING[/code].
Returns [code]SUCCESS[/code], if the child task results in [code]SUCCESS[/code], and triggers the cooldown timer.
Returns [code]FAILURE[/code], if the child task results in [code]FAILURE[/code] or if [member duration] time didn't pass since the previous execution.
2022-11-01 20:31:22 +00:00
</description>
<tutorials>
</tutorials>
<members>
<member name="cooldown_state_var" type="String" setter="set_cooldown_state_var" getter="get_cooldown_state_var" default="&quot;&quot;">
A boolean variable used to store the cooldown state in the [Blackboard]. If left empty, the variable will be automatically generated and assigned.
If the variable's value is set to [code]true[/code], it indicates that the cooldown is activated. This feature is useful for checking the cooldown state from other parts of the tree or sharing it among different sections of the [BehaviorTree].
2022-11-01 20:31:22 +00:00
</member>
<member name="duration" type="float" setter="set_duration" getter="get_duration" default="10.0">
Time to wait before permitting another child's execution.
2022-11-01 20:31:22 +00:00
</member>
<member name="process_pause" type="bool" setter="set_process_pause" getter="get_process_pause" default="false">
If [code]true[/code], process cooldown when the [SceneTree] is paused.
2022-11-01 20:31:22 +00:00
</member>
<member name="start_cooled" type="bool" setter="set_start_cooled" getter="get_start_cooled" default="false">
If [code]true[/code], initiate a cooldown as if the child had been executed before the first BT tick.
2022-11-01 20:31:22 +00:00
</member>
<member name="trigger_on_failure" type="bool" setter="set_trigger_on_failure" getter="get_trigger_on_failure" default="false">
If [code]true[/code], the cooldown will be activated if the child task also returns [code]FAILURE[/code]. Otherwise, the cooldown will only be triggered when the child task returns [code]SUCCESS[/code].
2022-11-01 20:31:22 +00:00
</member>
</members>
</class>