limboai/doc_classes/BTCooldown.xml

33 lines
2.5 KiB
XML

<?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">
<brief_description>
BT decorator that executes its child task only if [member duration] time has passed since the previous execution.
</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.
</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].
</member>
<member name="duration" type="float" setter="set_duration" getter="get_duration" default="10.0">
Time to wait before permitting another child's execution.
</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.
</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.
</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].
</member>
</members>
</class>