Files
agame/docs/limboai-stable/index.html
T
2026-10-15 16:30:44 +08:00

4392 lines
576 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="readthedocs-addons-api-version" content="1"><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LimboAI 1.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=9edc463e" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/dark_mode_css/general.css?v=c0a7eb24" />
<link rel="stylesheet" type="text/css" href="_static/dark_mode_css/dark.css?v=70edf1c7" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=e731e1b3"></script>
<script src="_static/doctools.js?v=fd6eb6e6"></script>
<script src="_static/sphinx_highlight.js?v=6ffebe34"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=f281be69"></script>
<script src="_static/dark_mode_js/default_light.js?v=c2e647ce"></script>
<script src="_static/dark_mode_js/theme_switcher.js?v=358d3910"></script>
<script src="_static/js/theme.js"></script>
<script src="_static/js/versions.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="#">
<img src="_static/logo.png" class="logo" alt="Logo"/>
</a>
<div class="switch-menus">
<div class="version-switch"></div>
<div class="language-switch"></div>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Getting started</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="#document-getting-started/getting-limboai">Getting LimboAI</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-getting-started/c-sharp">Using LimboAI with C#</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-getting-started/contributing">Contributing</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Behavior Trees</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="#document-behavior-trees/introduction">Introduction to Behavior Trees</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-behavior-trees/create-tree">Creating Behavior Trees</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-behavior-trees/custom-tasks">Creating custom tasks</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-behavior-trees/using-blackboard">Sharing data using Blackboard</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-behavior-trees/accessing-nodes">Accessing nodes in the scene tree</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Hierarchical State MachineS</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="#document-hierarchical-state-machines/create-hsm">Create State Machines</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Class reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/featured-classes">Important classes</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbaabb">BBAabb</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbarray">BBArray</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbbasis">BBBasis</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbbool">BBBool</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbbytearray">BBByteArray</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbcolor">BBColor</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbcolorarray">BBColorArray</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbdictionary">BBDictionary</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbfloat">BBFloat</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbfloat32array">BBFloat32Array</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbfloat64array">BBFloat64Array</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbint">BBInt</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbint32array">BBInt32Array</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbint64array">BBInt64Array</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbnode">BBNode</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbparam">BBParam</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbplane">BBPlane</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbprojection">BBProjection</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbquaternion">BBQuaternion</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbrect2">BBRect2</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbrect2i">BBRect2i</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbstring">BBString</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbstringarray">BBStringArray</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbstringname">BBStringName</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbtransform2d">BBTransform2D</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbtransform3d">BBTransform3D</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvariant">BBVariant</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector2">BBVector2</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector2array">BBVector2Array</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector2i">BBVector2i</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector3">BBVector3</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector3array">BBVector3Array</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector3i">BBVector3i</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector4">BBVector4</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bbvector4i">BBVector4i</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_behaviortree">BehaviorTree</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_behaviortreedata">BehaviorTreeData</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_behaviortreeview">BehaviorTreeView</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_blackboard">Blackboard</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_blackboardplan">BlackboardPlan</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bt">BT</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btaction">BTAction</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btalwaysfail">BTAlwaysFail</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btalwayssucceed">BTAlwaysSucceed</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btawaitanimation">BTAwaitAnimation</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcallmethod">BTCallMethod</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcheckagentproperty">BTCheckAgentProperty</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btchecktrigger">BTCheckTrigger</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcheckvar">BTCheckVar</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcomment">BTComment</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcomposite">BTComposite</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcondition">BTCondition</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btconsoleprint">BTConsolePrint</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btcooldown">BTCooldown</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btdecorator">BTDecorator</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btdelay">BTDelay</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btdynamicselector">BTDynamicSelector</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btdynamicsequence">BTDynamicSequence</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btevaluateexpression">BTEvaluateExpression</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btfail">BTFail</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btforeach">BTForEach</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btinstance">BTInstance</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btinvert">BTInvert</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btnewscope">BTNewScope</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btparallel">BTParallel</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btpauseanimation">BTPauseAnimation</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btplayanimation">BTPlayAnimation</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btplayer">BTPlayer</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btprobability">BTProbability</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btprobabilityselector">BTProbabilitySelector</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrandomselector">BTRandomSelector</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrandomsequence">BTRandomSequence</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrandomwait">BTRandomWait</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrepeat">BTRepeat</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrepeatuntilfailure">BTRepeatUntilFailure</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrepeatuntilsuccess">BTRepeatUntilSuccess</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btrunlimit">BTRunLimit</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btselector">BTSelector</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btsequence">BTSequence</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btsetagentproperty">BTSetAgentProperty</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btsetvar">BTSetVar</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btstate">BTState</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btstopanimation">BTStopAnimation</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btsubtree">BTSubtree</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bttask">BTTask</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_bttimelimit">BTTimeLimit</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btwait">BTWait</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_btwaitticks">BTWaitTicks</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_limbohsm">LimboHSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_limbostate">LimboState</a></li>
<li class="toctree-l1"><a class="reference internal" href="#document-classes/class_limboutility">LimboUtility</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">LimboAI</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="#" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">LimboAI 1.0 documentation</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="limboai-documentation">
<h1>LimboAI Documentation<a class="headerlink" href="#limboai-documentation" title="Link to this heading"></a></h1>
<p><strong>LimboAI</strong> is an open-source C++ module for <strong>Godot Engine 4</strong> providing a combination of
<strong>Behavior Trees</strong> and <strong>State Machines</strong> for crafting your game’s AI. It comes with a
behavior tree editor, built-in documentation, visual debugger, and more! While
it is implemented in C++, it fully supports GDScript for <a class="reference internal" href="#document-behavior-trees/custom-tasks#custom-tasks"><span class="std std-ref">creating your own tasks</span></a>
and states. The full list of features is available on the
<a class="reference external" href="https://github.com/limbonaut/limboai#features">LimboAI GitHub</a> page.</p>
<p><strong>Behavior Trees</strong> are powerful hierarchical structures used to model and control the behavior
of agents in a game (e.g., characters, enemies, entities). They are designed to
make it easier to create complex and highly modular behaviors for your games.
To learn more about behavior trees, check out <a class="reference internal" href="#document-behavior-trees/introduction#introduction"><span class="std std-ref">Introduction to Behavior Trees</span></a>.</p>
<p><strong>Hierarchical State Machines</strong> are finite state machines that allow any state to host their own
sub-state machine. This allows you to tackle your AI’s state and transition complexity by breaking down
one big state machine into multiple smaller ones.</p>
<div class="toctree-wrapper compound">
<span id="document-getting-started/getting-limboai"></span><section id="getting-limboai">
<h2>Getting LimboAI<a class="headerlink" href="#getting-limboai" title="Link to this heading"></a></h2>
<p>LimboAI can be used as either a C++ module or as a GDExtension shared library.
There are some differences between the two. In short, GDExtension version is more
convenient to use but somewhat limited in features. The module version provides better editor
experience and is slightly more performant, but it requires using custom engine builds including the export templates.
Whichever you choose to use, your project will stay compatible with both and you can switch from one to
the other any time.</p>
<p>Choose the version you’d like to use. If you’re unsure, start with the GDExtension version.
You can change your decision at any time - both versions are fully compatible.</p>
<section id="get-gdextension-version">
<h3>Get GDExtension version<a class="headerlink" href="#get-gdextension-version" title="Link to this heading"></a></h3>
<p>Precompiled builds are available on the official
<a class="reference external" href="https://github.com/limbonaut/limboai#getting-limboai">LimboAI GitHub</a> page,
and in the Asset Library.</p>
<p>GDExtension is the most convenient way of using the LimboAI plugin, but it comes
with certain limitations:</p>
<ul>
<li><p>Documentation tooltips are not available.</p></li>
<li><p>Handy <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a> property editor is not available in the extension due to dependencies on the engine classes that are not available in the Godot API.</p>
<blockquote>
<div><p><strong>🛈 See also:</strong> <a class="reference external" href="https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/what_is_gdextension.html#what-is-gdextension">What is GDExtension?</a></p>
</div></blockquote>
</li>
</ul>
<p>Installation instructions:</p>
<ol class="arabic simple">
<li><p>Make sure you’re using the latest stable version of the Godot editor.</p></li>
<li><p>Create a new project for your experiments with LimboAI.</p></li>
<li><p>In Godot, click AssetLib tab at the top of the screen and search for LimboAI. Download it. LimboAI plugin will be downloaded with the demo project files. Don’t mind the errors printed at this point, this is due to the extension library not being loaded just yet.</p></li>
<li><p>Reload your project with <cite>Project -&gt; Reload project</cite>. There shouldn’t be any errors printed now.</p></li>
<li><p>In the project files, locate a scene file called <cite>showcase.tscn</cite> and run it. It’s the demo’s entry point.</p></li>
</ol>
</section>
<section id="get-module-version">
<h3>Get module version<a class="headerlink" href="#get-module-version" title="Link to this heading"></a></h3>
<p>Precompiled builds are available on the official
<a class="reference external" href="https://github.com/limbonaut/limboai#getting-limboai">LimboAI GitHub</a> page.</p>
<p>Installation instructions:</p>
<ol class="arabic simple">
<li><p>In <a class="reference external" href="https://github.com/limbonaut/limboai/releases/">GitHub releases</a>, download the latest pre-compiled release build for your platform.</p></li>
<li><p>Download the demo project archive from the same release.</p></li>
<li><p>Extract the pre-compiled editor and the demo project files.</p></li>
<li><p>Launch the pre-compiled editor binary, import and open the demo project.</p></li>
<li><p>Run the project.</p></li>
</ol>
<p><strong>Important</strong>: To export your game using the module version of LimboAI, make sure to use the pre-compiled export templates included in the same GitHub release build.</p>
</section>
</section>
<span id="document-getting-started/c-sharp"></span><section id="using-limboai-with-c">
<span id="csharp"></span><h2>Using LimboAI with C#<a class="headerlink" href="#using-limboai-with-c" title="Link to this heading"></a></h2>
<p>Here’s how you can use the module version with C# to write your tasks and states.</p>
<ol class="arabic simple">
<li><p>Locate LimboAI NuGet package files.</p></li>
</ol>
<p>Each provided build comes with a GodotSharp folder, which has packages under
“GodotSharp/Tools/nupkgs/”. Note down the directory path; you’ll need it in the next step.</p>
<ol class="arabic simple" start="2">
<li><p>Add a local source for NuGet packages using the following command:</p></li>
</ol>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>dotnet<span class="w"> </span>nuget<span class="w"> </span>add<span class="w"> </span><span class="nb">source</span><span class="w"> </span>path/to/limboai/nupkgs<span class="w"> </span>--name<span class="w"> </span>LimboNugetSource
</pre></div>
</div>
<ol class="arabic simple" start="3">
<li><p>Your C# project should be able to see LimboAI classes and compile.</p></li>
</ol>
<p>Regarding GDExtension, I can only confirm success with the module version and C#.
Unfortunately, I haven’t had any luck with the GDExtension version yet.
If you’ve had success with GDExtension, please let me know via Discord or email.</p>
</section>
<span id="document-getting-started/contributing"></span><section id="contributing">
<span id="id1"></span><h2>Contributing<a class="headerlink" href="#contributing" title="Link to this heading"></a></h2>
<p>We target the latest stable version of the Godot Engine for development until a
third beta or a release candidate of an upcoming Godot release becomes available.
If you want to contribute to the project, please ensure that you are using the
corresponding Godot version.</p>
<p>We follow the <a class="reference external" href="https://docs.godotengine.org/en/stable/contributing/development/code_style_guidelines.html#doc-code-style-guidelines">Godot code style guidelines</a>.
Please use <code class="docutils literal notranslate"><span class="pre">clang-format</span></code> to maintain consistent styling. You can install
<code class="docutils literal notranslate"><span class="pre">pre-commit</span></code> hooks for Git using <code class="docutils literal notranslate"><span class="pre">pre-commit</span> <span class="pre">install</span></code> to automate this process.</p>
<p>Please keep the minor versions backward-compatible when submitting pull requests.</p>
<p>We support building LimboAI as a module for the Godot Engine and as a GDExtension library.
Make sure your contribution is compatible with both. Our CI workflow will verify
that your changes can be compiled in both configurations.</p>
<section id="compiling-as-module-of-the-godot-engine">
<h3>Compiling as module of the Godot Engine<a class="headerlink" href="#compiling-as-module-of-the-godot-engine" title="Link to this heading"></a></h3>
<ol class="arabic simple">
<li><p>Clone the Godot Engine repository.</p></li>
<li><p>Switch to the latest stable tag.</p></li>
<li><p>Clone the LimboAI repository into the <code class="docutils literal notranslate"><span class="pre">modules/limboai</span></code> directory.</p></li>
</ol>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/godotengine/godot.git
git<span class="w"> </span>checkout<span class="w"> </span><span class="m">4</span>.3-stable<span class="w"> </span><span class="c1"># Replace "4.3-stable" with the latest stable tag</span>
git<span class="w"> </span>clone<span class="w"> </span>https://github.com/limbonaut/limboai<span class="w"> </span>modules/limboai
</pre></div>
</div>
<p>Consult the <a class="reference external" href="https://docs.godotengine.org/en/stable/engine_details/development/compiling/index.html">Godot Engine documentation</a>
for detailed instructions on building the engine.</p>
<p><strong>Unit tests</strong> can be compiled using the <code class="docutils literal notranslate"><span class="pre">tests=yes</span></code> build option. To execute them,
run the compiled Godot binary with the <code class="docutils literal notranslate"><span class="pre">--test</span> <span class="pre">--tc=&quot;*[LimboAI]*&quot;</span></code> command-line options.</p>
<section id="building-c-packages">
<h4>Building C# Packages<a class="headerlink" href="#building-c-packages" title="Link to this heading"></a></h4>
<p>If you want C# Support for LimboAI when building from source, follow Godot’s instructions for building from source with
C# Support: <a class="reference external" href="https://docs.godotengine.org/en/stable/engine_details/development/compiling/compiling_with_dotnet.html">Compiling with .NET</a>.
LimboAI’s classes will be included in the output from that build process.</p>
</section>
</section>
<section id="compiling-as-gdextension-library">
<h3>Compiling as GDExtension library<a class="headerlink" href="#compiling-as-gdextension-library" title="Link to this heading"></a></h3>
<p>You’ll need the SCons build tool and a C++ compiler. See also <a class="reference external" href="https://docs.godotengine.org/en/stable/engine_details/development/compiling/index.html">Compiling</a>.
Run <code class="docutils literal notranslate"><span class="pre">scons</span> <span class="pre">target=editor</span></code> to build the plugin library for your current platform.</p>
<ul class="simple">
<li><p>SCons will automatically clone the <code class="docutils literal notranslate"><span class="pre">godot-cpp</span></code> repository if it doesn’t already exist in the <code class="docutils literal notranslate"><span class="pre">limboai/godot-cpp</span></code> directory.</p></li>
<li><p>By default, built targets are placed in the demo project: <code class="docutils literal notranslate"><span class="pre">demo/addons/limboai/bin/</span></code>.</p></li>
</ul>
<p>Check <code class="docutils literal notranslate"><span class="pre">scons</span> <span class="pre">-h</span></code> for other options and targets.</p>
</section>
<section id="contributing-to-the-documentation">
<h3>Contributing to the documentation<a class="headerlink" href="#contributing-to-the-documentation" title="Link to this heading"></a></h3>
<p>Online documentation is created using <a class="reference external" href="https://www.sphinx-doc.org/en/master/">Sphinx</a>.
Source files are located in the <code class="docutils literal notranslate"><span class="pre">doc/source</span></code> directory in RST format and can
be built locally with <code class="docutils literal notranslate"><span class="pre">sphinx-build</span></code>. See the
<a class="reference external" href="https://www.sphinx-doc.org/en/master/tutorial/getting-started.html">Sphinx documentation</a>
for more details.</p>
<p>Class documentation resides in XML files within the <code class="docutils literal notranslate"><span class="pre">doc_classes/</span></code> directory.
If you create a new class or modify an existing one, you can run the compiled
Godot binary with the <code class="docutils literal notranslate"><span class="pre">--doctool</span></code> option in the root of the Godot source code
to generate the missing XML files or sections within those files in the class documentation.
After editing the XML files, please run the compiled editor binary with the <code class="docutils literal notranslate"><span class="pre">--doctool</span></code>
option again to update and tidy up the XML files.</p>
<p>Sphinx RST files for the class documentation are generated from
XML files using the Godot script <code class="docutils literal notranslate"><span class="pre">make_rst.py</span></code> and stored in the <code class="docutils literal notranslate"><span class="pre">doc/source/classes</span></code> directory.
This process is performed using our own script <code class="docutils literal notranslate"><span class="pre">scripts/update_rst.sh</span></code>. RST files
in <code class="docutils literal notranslate"><span class="pre">doc/source/classes</span></code> should not be edited manually.</p>
</section>
</section>
</div>
<div class="toctree-wrapper compound">
<span id="document-behavior-trees/introduction"></span><section id="introduction-to-behavior-trees">
<span id="introduction"></span><h2>Introduction to Behavior Trees<a class="headerlink" href="#introduction-to-behavior-trees" title="Link to this heading"></a></h2>
<blockquote>
<div><p><strong>🛈 Note:</strong> Demo project includes a tutorial that provides an introduction to behavior trees through illustrative examples.</p>
</div></blockquote>
<p><strong>Behavior Trees (BT)</strong> are hierarchical structures used to model and
control the behavior of agents in a game (e.g., characters, enemies,
entities). They are designed to make it easier to create complex and
highly modular behaviors for your games.</p>
<p>Behavior Trees are composed of tasks that represent specific actions or
decision-making rules. Tasks can be broadly categorized into two main
types: control tasks and leaf tasks. <strong>Control tasks</strong> determine the
execution flow within the tree. They include <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">Sequence</span></a>,
<a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">Selector</span></a>, and
<a class="reference internal" href="#document-classes/class_btinvert#class-btinvert"><span class="std std-ref">Invert</span></a>. <strong>Leaf tasks</strong> represent specific actions
to perform, like moving or attacking, or conditions that need to be
checked. The <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> class provides the foundation for various
building blocks of the Behavior Trees. Such tasks can <a class="reference internal" href="#document-behavior-trees/using-blackboard#blackboard"><span class="std std-ref">share data using the Blackboard</span></a>.</p>
<blockquote>
<div><p><strong>🛈 Note:</strong> To <a class="reference internal" href="#document-behavior-trees/custom-tasks#custom-tasks"><span class="std std-ref">create your own actions</span></a>, extend the <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a>
class.</p>
</div></blockquote>
<p>A Behavior Tree is usually processed each frame. It is traversed from top to bottom,
with the control tasks determining the control flow. Each task has a <a class="reference internal" href="#document-classes/class_bttask#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a>
method, which performs the task’s work and returns a status indicating its progress:
<code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, or <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> and <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> indicate the
outcome of finished work, while <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> status is returned when a task requires
more than one tick to complete its job. These statuses determine how the tree
progresses, with the <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> status usually meaning that the tree will
continue execution during the next frame.</p>
<p>There are <em>four types of tasks</em>:</p>
<ul class="simple">
<li><p><strong>Actions</strong> are leaf tasks that perform the actual work.</p>
<ul>
<li><p>Examples: <a class="reference internal" href="#document-classes/class_btplayanimation#class-btplayanimation"><span class="std std-ref">PlayAnimation</span></a>, <a class="reference internal" href="#document-classes/class_btwait#class-btwait"><span class="std std-ref">Wait</span></a>.</p></li>
</ul>
</li>
<li><p><strong>Conditions</strong> are leaf tasks that conduct various checks.</p>
<ul>
<li><p>Examples: <a class="reference internal" href="#document-classes/class_btcheckvar#class-btcheckvar"><span class="std std-ref">CheckVar</span></a>, <a class="reference internal" href="#document-behavior-trees/custom-tasks#example-in-range"><span class="std std-ref">InRange</span></a>.</p></li>
</ul>
</li>
<li><p><strong>Composites</strong> can have one or more child tasks, and dictate the execution flow of their children.</p>
<ul>
<li><p>Examples: <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">Sequence</span></a>, <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">Selector</span></a>, <a class="reference internal" href="#document-classes/class_btparallel#class-btparallel"><span class="std std-ref">Parallel</span></a>.</p></li>
</ul>
</li>
<li><p><strong>Decorators</strong> can only have a single child and they change how their child task operates.</p>
<ul>
<li><p>Examples: <a class="reference internal" href="#document-classes/class_btalwayssucceed#class-btalwayssucceed"><span class="std std-ref">AlwaysSucceed</span></a>, <a class="reference internal" href="#document-classes/class_btinvert#class-btinvert"><span class="std std-ref">Invert</span></a>, <a class="reference internal" href="#document-classes/class_bttimelimit#class-bttimelimit"><span class="std std-ref">TimeLimit</span></a>.</p></li>
</ul>
</li>
</ul>
<p><a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">Sequence</span></a> is one of the core composite tasks.
It executes its child tasks sequentially, from first to last, until one of them
returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, or all of them result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. In other words,
if any child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, the <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">Sequence</span></a>
execution will be aborted, and the <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">Sequence</span></a> itself will
return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p><a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">Selector</span></a> is another essential composite task.
It executes its child tasks sequentially, from first to last, until one of them
returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or all of them result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. In other words, when
a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, it moves on to the next one until it
finds the one that returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. Once a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>,
the <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">Selector</span></a> stops and also returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.
The purpose of the <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">Selector</span></a> is to find a child that succeeds.</p>
<p>Behavior Trees handle conditional logic using <strong>condition tasks</strong>. These
tasks check for specific conditions and return either <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or
<code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> based on the state of the agent or its environment (e.g.,
“IsLowOnHealth”, “IsTargetInSight”). Conditions can be used together
with <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">Sequence</span></a> and <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">Selector</span></a>
to craft your decision-making logic.</p>
<blockquote>
<div><p><strong>🛈 Note:</strong> To <a class="reference internal" href="#document-behavior-trees/custom-tasks#custom-tasks"><span class="std std-ref">create your own conditions</span></a>, extend the <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a>
class.</p>
</div></blockquote>
<p>Check out the <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> class documentation, which
provides the foundation for various building blocks of Behavior Trees.</p>
</section>
<span id="document-behavior-trees/create-tree"></span><section id="creating-behavior-trees">
<h2>Creating Behavior Trees<a class="headerlink" href="#creating-behavior-trees" title="Link to this heading"></a></h2>
<p>This chapter describes how to create and debug behavior trees.</p>
<section id="add-a-behavior-tree-to-an-agent">
<h3>Add a Behavior Tree to an agent<a class="headerlink" href="#add-a-behavior-tree-to-an-agent" title="Link to this heading"></a></h3>
<p>Follow these steps to add a behavior tree to a new or existing agent:</p>
<ol class="arabic simple">
<li><p>Make a scene file for your agent, or open an existing scene.</p></li>
<li><p>Add a <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a> node to your scene.</p></li>
<li><p>Select <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a>, and create a new behavior tree in the inspector.</p></li>
<li><p>Optionally, you can save the behavior tree to a file using the property’s context menu.</p></li>
<li><p>Click the behavior tree property to open it in the LimboAI editor.</p></li>
</ol>
</section>
<section id="debugging-behavior-trees">
<h3>Debugging Behavior Trees<a class="headerlink" href="#debugging-behavior-trees" title="Link to this heading"></a></h3>
<p>In Godot Engine, follow to “Bottom Panel &gt; Debugger &gt; LimboAI” tab. With the LimboAI debugger,
you can inspect any currently active behavior tree within the running project. The debugger can be detached
from the main editor window, which can be particularly useful if you have a HiDPI or a secondary display.</p>
<section id="inspecting-task-properties-and-blackboard">
<h4>Inspecting task properties and blackboard<a class="headerlink" href="#inspecting-task-properties-and-blackboard" title="Link to this heading"></a></h4>
<p>When you click on a task in the LimboAI debugger, its properties are shown in the remote Inspector panel,
including the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> reference. Click the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>
to open it and view all variables across the full scope chain, grouped by scope.
You can also edit variable values live, which can be useful for testing and debugging your game’s AI.</p>
</section>
</section>
</section>
<span id="document-behavior-trees/custom-tasks"></span><section id="creating-custom-tasks">
<span id="custom-tasks"></span><h2>Creating custom tasks<a class="headerlink" href="#creating-custom-tasks" title="Link to this heading"></a></h2>
<p>By default, user tasks should be placed in the <code class="docutils literal notranslate"><span class="pre">res://ai/tasks</span></code>
directory. You can set an alternative location for user tasks in the
<code class="docutils literal notranslate"><span class="pre">Project</span> <span class="pre">Settings</span> <span class="pre">→</span> <span class="pre">Limbo</span> <span class="pre">AI</span></code> (To see those options,
<code class="docutils literal notranslate"><span class="pre">Advanced</span> <span class="pre">Settings</span></code> should be enabled in the Project Settings).</p>
<p>Each subdirectory within the user tasks directory is treated as a category.
Therefore, if you create a subdirectory named “motion_and_physics,” your
custom tasks in that directory will automatically be categorized under
“Motion And Physics.”</p>
<p>When creating custom tasks, <strong>extend one of the following</strong> base classes:
<a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a>, <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a>, <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a>, <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a>.
More on task types you can read in the <a class="reference internal" href="#document-behavior-trees/introduction#introduction"><span class="std std-ref">Introduction to Behavior Trees</span></a>.</p>
<blockquote>
<div><p><strong>🛈 Note:</strong> To help you write new tasks, you can add a script template to
your project using “Misc → Create script template” menu option.</p>
</div></blockquote>
<p>Using the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> is covered in <a class="reference internal" href="#document-behavior-trees/using-blackboard#accessing-blackboard"><span class="std std-ref">Accessing the Blackboard in a Task</span></a>.</p>
<section id="task-anatomy">
<h3>Task anatomy<a class="headerlink" href="#task-anatomy" title="Link to this heading"></a></h3>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">tool</span>
<span class="k">extends</span><span class="w"> </span><span class="n">BTAction</span>
<span class="c1"># Task parameters.</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">parameter1</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">parameter2</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">Vector2</span>
<span class="c1">## Note: Each method declaration is optional.</span>
<span class="c1">## At minimum, you only need to define the "_tick" method.</span>
<span class="c1"># Called to generate a display name for the task (requires @tool).</span>
<span class="k">func</span><span class="w"> </span><span class="n">_generate_name</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">String</span><span class="p">:</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s2">"MyTask"</span>
<span class="c1"># Called to initialize the task.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_setup</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
<span class="c1"># Called when the task is entered.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_enter</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
<span class="c1"># Called when the task is exited.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_exit</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
<span class="c1"># Called each time this task is ticked (aka executed).</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">SUCCESS</span>
<span class="c1"># Strings returned from this method are displayed as warnings in the editor.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_get_configuration_warnings</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">PackedStringArray</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">warnings</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="nb nb-Type">PackedStringArray</span><span class="p">()</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">warnings</span>
</pre></div>
</div>
</section>
<section id="example-1-a-simple-action">
<h3>Example 1: A simple action<a class="headerlink" href="#example-1-a-simple-action" title="Link to this heading"></a></h3>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">tool</span>
<span class="k">extends</span><span class="w"> </span><span class="n">BTAction</span>
<span class="c1">## Shows or hides a node and returns SUCCESS.</span>
<span class="c1">## Returns FAILURE if the node is not found.</span>
<span class="c1"># Task parameters.</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">node_path</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">NodePath</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">visible</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="bp">true</span>
<span class="c1"># Called to generate a display name for the task (requires @tool).</span>
<span class="k">func</span><span class="w"> </span><span class="n">_generate_name</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">String</span><span class="p">:</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s2">"SetVisible </span><span class="si">%s</span><span class="s2"> node_path: </span><span class="se">\"</span><span class="si">%s</span><span class="se">\"</span><span class="s2">"</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="p">[</span><span class="n">visible</span><span class="p">,</span><span class="w"> </span><span class="n">node_path</span><span class="p">]</span>
<span class="c1"># Called each time this task is ticked (aka executed).</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">p_delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">n</span><span class="p">:</span><span class="w"> </span><span class="n">CanvasItem</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">scene_root</span><span class="o">.</span><span class="n">get_node_or_null</span><span class="p">(</span><span class="n">node_path</span><span class="p">)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">is_instance_valid</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
<span class="w"> </span><span class="n">n</span><span class="o">.</span><span class="n">visible</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">visible</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">SUCCESS</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">FAILURE</span>
</pre></div>
</div>
</section>
<section id="example-2-inrange-condition">
<span id="example-in-range"></span><h3>Example 2: InRange condition<a class="headerlink" href="#example-2-inrange-condition" title="Link to this heading"></a></h3>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">tool</span>
<span class="k">extends</span><span class="w"> </span><span class="n">BTCondition</span>
<span class="c1">## InRange condition checks if the agent is within a range of target,</span>
<span class="c1">## defined by distance_min and distance_max.</span>
<span class="c1">## Returns SUCCESS if the agent is within the defined range;</span>
<span class="c1">## otherwise, returns FAILURE.</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">distance_min</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">distance_max</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">target_var</span><span class="p">:</span><span class="w"> </span><span class="n">StringName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"target"</span>
<span class="k">var</span><span class="w"> </span><span class="n">_min_distance_squared</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span>
<span class="k">var</span><span class="w"> </span><span class="n">_max_distance_squared</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span>
<span class="c1"># Called to generate a display name for the task.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_generate_name</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">String</span><span class="p">:</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s2">"InRange (</span><span class="si">%d</span><span class="s2">, </span><span class="si">%d</span><span class="s2">) of </span><span class="si">%s</span><span class="s2">"</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="p">[</span><span class="n">distance_min</span><span class="p">,</span><span class="w"> </span><span class="n">distance_max</span><span class="p">,</span>
<span class="w"> </span><span class="n">LimboUtility</span><span class="o">.</span><span class="n">decorate_var</span><span class="p">(</span><span class="n">target_var</span><span class="p">)]</span>
<span class="c1"># Called to initialize the task.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_setup</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">_min_distance_squared</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">distance_min</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">distance_min</span>
<span class="w"> </span><span class="n">_max_distance_squared</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">distance_max</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">distance_max</span>
<span class="c1"># Called when the task is executed.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">_delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">target</span><span class="p">:</span><span class="w"> </span><span class="n">Node2D</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">get_var</span><span class="p">(</span><span class="n">target_var</span><span class="p">,</span><span class="w"> </span><span class="nb nb-Type">null</span><span class="p">)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">is_instance_valid</span><span class="p">(</span><span class="n">target</span><span class="p">):</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">FAILURE</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">dist_sq</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">agent</span><span class="o">.</span><span class="n">global_position</span><span class="o">.</span><span class="n">distance_squared_to</span><span class="p">(</span><span class="n">target</span><span class="o">.</span><span class="n">global_position</span><span class="p">)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">dist_sq</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="n">_min_distance_squared</span><span class="w"> </span><span class="ow">and</span><span class="w"> </span><span class="n">dist_sq</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="n">_max_distance_squared</span><span class="p">:</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">SUCCESS</span>
<span class="w"> </span><span class="k">else</span><span class="p">:</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">FAILURE</span>
</pre></div>
</div>
</section>
<section id="creating-tasks-in-c">
<h3>Creating tasks in C#<a class="headerlink" href="#creating-tasks-in-c" title="Link to this heading"></a></h3>
<p>You can use the following script template for custom tasks:</p>
<div class="highlight-csharp notranslate"><div class="highlight"><pre><span></span><span class="k">using</span><span class="w"> </span><span class="nn">Godot</span><span class="p">;</span>
<span class="k">using</span><span class="w"> </span><span class="nn">System</span><span class="p">;</span>
<span class="na">[Tool]</span>
<span class="k">public</span><span class="w"> </span><span class="k">partial</span><span class="w"> </span><span class="k">class</span><span class="w"> </span><span class="nc">_CLASS_</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">_BASE_</span>
<span class="p">{</span>
<span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="k">override</span><span class="w"> </span><span class="kt">string</span><span class="w"> </span><span class="nf">_GenerateName</span><span class="p">()</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s">"_CLASS_"</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="k">override</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">_Setup</span><span class="p">()</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="k">override</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">_Enter</span><span class="p">()</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="k">override</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">_Exit</span><span class="p">()</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="k">override</span><span class="w"> </span><span class="n">Status</span><span class="w"> </span><span class="nf">_Tick</span><span class="p">(</span><span class="kt">double</span><span class="w"> </span><span class="n">delta</span><span class="p">)</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">Status</span><span class="p">.</span><span class="n">Success</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="k">override</span><span class="w"> </span><span class="kt">string</span><span class="p">[]</span><span class="w"> </span><span class="nf">_GetConfigurationWarnings</span><span class="p">()</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">Array</span><span class="p">.</span><span class="n">Empty</span><span class="o">&lt;</span><span class="kt">string</span><span class="o">&gt;</span><span class="p">();</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</section>
</section>
<span id="document-behavior-trees/using-blackboard"></span><section id="sharing-data-using-blackboard">
<span id="blackboard"></span><h2>Sharing data using Blackboard<a class="headerlink" href="#sharing-data-using-blackboard" title="Link to this heading"></a></h2>
<p>To share data between different tasks and states, we employ a feature known as the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.
The <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> serves as a central repository where tasks and states can store and retrieve named variables,
allowing for seamless data interchange. Each instance of a behavior tree or a state machine gets its own dedicated <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>. It has the capability to store various data types,
including objects and resources.</p>
<p>Using the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, you can easily share data in your behavior trees, making the tasks in the behavior tree more flexible.</p>
<section id="accessing-the-blackboard-in-a-task">
<span id="accessing-blackboard"></span><h3>Accessing the Blackboard in a Task<a class="headerlink" href="#accessing-the-blackboard-in-a-task" title="Link to this heading"></a></h3>
<p>Every <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> has access to the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, providing a
straightforward mechanism for data exchange.
Here’s an example of how you can interact with the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> in GDScript:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">speed_var</span><span class="p">:</span><span class="w"> </span><span class="n">StringName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"speed"</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="c1"># Set the value of the "speed" variable:</span>
<span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">set_var</span><span class="p">(</span><span class="n">speed_var</span><span class="p">,</span><span class="w"> </span><span class="mf">200.0</span><span class="p">)</span>
<span class="w"> </span><span class="c1"># Get the value of the "speed" variable, with a default value of 100.0 if not found:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">speed</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">get_var</span><span class="p">(</span><span class="n">speed_var</span><span class="p">,</span><span class="w"> </span><span class="mf">100.0</span><span class="p">)</span>
<span class="w"> </span><span class="c1"># Check if the "speed" variable exists:</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">has_var</span><span class="p">(</span><span class="n">speed_var</span><span class="p">):</span>
<span class="w"> </span><span class="c1"># ...</span>
</pre></div>
</div>
<p>If you are accessing a variable that holds an object instance, and it is
expected that the instance may be null or freed, you can do it like this:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">object_var</span><span class="p">:</span><span class="w"> </span><span class="n">StringName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"object"</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="c1"># Get object instance stored in the "object" variable.</span>
<span class="w"> </span><span class="c1"># - Important: Avoid specifying a type for "obj" in GDScript</span>
<span class="w"> </span><span class="c1"># to prevent errors when the instance is freed.</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">obj</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">get_var</span><span class="p">(</span><span class="n">object_var</span><span class="p">)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">is_instance_valid</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span>
<span class="w"> </span><span class="c1"># ...</span>
</pre></div>
</div>
<p>It is recommended to suffix variable name properties with <code class="docutils literal notranslate"><span class="pre">_var</span></code>, like in the example above, which enables the
inspector to provide a more convenient property editor for the variable. This editor
allows you to select or add the variable to the blackboard plan, and provides a
warning icon if the variable does not exist in the blackboard plan.</p>
<blockquote>
<div><p><strong>🛈 Note:</strong> The variable doesn’t need to exist when you set it in code.</p>
</div></blockquote>
</section>
<section id="editing-the-blackboard-plan">
<span id="editing-plan"></span><h3>Editing the Blackboard Plan<a class="headerlink" href="#editing-the-blackboard-plan" title="Link to this heading"></a></h3>
<p>The Blackboard Plan, associated with each <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>
resource, dictates how the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> initializes for each
new instance of the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.
BlackboardPlan resource stores default values, type information, and data bindings
necessary for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> initialization.</p>
<p>To add, modify, or remove variables from the Blackboard Plan, follow these steps:</p>
<ol class="arabic simple">
<li><p>Open the LimboAI editor and load the behavior tree you want to edit.</p></li>
<li><p>In the editor, click on the small button located inside the tab. This will open the <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> in the Inspector.</p></li>
<li><p>In the Inspector, click the “Manage…” button to show the blackboard plan editor.</p></li>
<li><p>In the blackboard plan editor, you can add, remove, or reorder variables, and modify their data type and hint.</p></li>
<li><p>The hint provides additional information about the variable to the Inspector, such as minimum and maximum values for an integer variable. Learn more about <a class="reference external" href="https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#enum-globalscope-propertyhint">property hints in the official Godot documentation</a>.</p></li>
<li><p>You can specify the default values of the variables directly in the Inspector.</p></li>
</ol>
</section>
<section id="overriding-variables-in-btplayer">
<h3>Overriding variables in BTPlayer<a class="headerlink" href="#overriding-variables-in-btplayer" title="Link to this heading"></a></h3>
<p>Each <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a> node also has a “Blackboard Plan” property,
providing the ability to override values of the BehaviorTree’s blackboard variables.
These overrides are specific to the BTPlayer’s scene
and do not impact other scenes using the same <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.
To modify these values:</p>
<ol class="arabic simple">
<li><p>Select the BTPlayer node in the scene tree.</p></li>
<li><p>In the Inspector, locate the “Blackboard Plan” property.</p></li>
<li><p>Override the desired values to tailor the blackboard variables for the specific scene.</p></li>
</ol>
</section>
<section id="task-parameters">
<h3>Task parameters<a class="headerlink" href="#task-parameters" title="Link to this heading"></a></h3>
<p>In some cases, it can be beneficial to allow behavior tree tasks to export parameters
that can either be <strong>bound to a blackboard variable or specified directly</strong> by the user.
For this purpose, LimboAI provides special parameter types that begin with “BB”,
such as <a class="reference internal" href="#document-classes/class_bbint#class-bbint"><span class="std std-ref">BBInt</span></a>, <a class="reference internal" href="#document-classes/class_bbbool#class-bbbool"><span class="std std-ref">BBBool</span></a>, <a class="reference internal" href="#document-classes/class_bbstring#class-bbstring"><span class="std std-ref">BBString</span></a>,
<a class="reference internal" href="#document-classes/class_bbfloat#class-bbfloat"><span class="std std-ref">BBFloat</span></a>, <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>, and more.
For a complete list, please refer to the <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a> class reference.</p>
<p>Usage example:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">BTAction</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">speed</span><span class="p">:</span><span class="w"> </span><span class="n">BBFloat</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">current_speed</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">speed</span><span class="o">.</span><span class="n">get_value</span><span class="p">(</span><span class="n">scene_root</span><span class="p">,</span><span class="w"> </span><span class="n">blackboard</span><span class="p">,</span><span class="w"> </span><span class="mf">0.0</span><span class="p">)</span>
<span class="w"> </span><span class="o">...</span>
</pre></div>
</div>
</section>
<section id="connecting-variables-in-bts-to-hsms-variable-mapping">
<h3>Connecting variables in BTs to HSMs: Variable mapping<a class="headerlink" href="#connecting-variables-in-bts-to-hsms-variable-mapping" title="Link to this heading"></a></h3>
<p>Each <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> creates a new blackboard scope for its
BehaviorTree instance. Because BehaviorTrees are reusable resources that can run
in different contexts or on different agents, they do not automatically see
variables defined in the HSM. At runtime, HSM variables are usually accessible
inside the BT via the parent scope blackboard, but the recommended way to access
them is through <strong>mapping</strong>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>To learn more about scopes, see <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.</p>
</div>
<p>When both the BehaviorTree and the HSM declare variables in their respective
<a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> resources, the editor provides a <strong>Mapping</strong>
section in the BlackboardPlan inspector. Mapping is the intended and recommended way to
connect variables between related plans.</p>
<section id="key-points-about-mapping">
<h4>Key points about mapping<a class="headerlink" href="#key-points-about-mapping" title="Link to this heading"></a></h4>
<ul class="simple">
<li><p>Mapping connects two variables so they behave as a single logical variable at runtime.</p></li>
<li><p>Linked variables are updated immediately in both scopes — they literally share the
same state in memory (no polling or copying).</p></li>
<li><p>Mapping is explicit: you decide which variables the BT exposes as inputs and outputs.</p></li>
<li><p>Linkage is bidirectional — there is no distinction between input and output.</p></li>
<li><p>Mapping does not create new variables automatically — the variables must already
exist in both blackboard plans before they can be linked.</p></li>
</ul>
</section>
<section id="inspector-workflow">
<h4>Inspector workflow<a class="headerlink" href="#inspector-workflow" title="Link to this heading"></a></h4>
<ol class="arabic simple">
<li><p>Define the required variables in each BlackboardPlan (HSM plan and BT plan, for example).</p></li>
<li><p>Select the <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> node in the scene or a <a class="reference internal" href="#document-classes/class_btsubtree#class-btsubtree"><span class="std std-ref">BTSubtree</span></a>
inside a behavior tree.</p></li>
<li><p>In the Inspector, select the Blackboard Plan property.</p></li>
<li><p>In the BlackboardPlan resource inspector, locate the <strong>Mapping</strong> section.</p></li>
<li><p>Create mappings by pairing variables (<code class="docutils literal notranslate"><span class="pre">BT</span> <span class="pre">variable</span> <span class="pre">↔</span> <span class="pre">parent</span> <span class="pre">variable</span></code>).</p></li>
<li><p>On startup the mappings are applied, and the variables are automatically linked
for the running instance.</p></li>
</ol>
</section>
<section id="programmatic-alternative-linking-variables-in-code">
<h4>Programmatic alternative: linking variables in code<a class="headerlink" href="#programmatic-alternative-linking-variables-in-code" title="Link to this heading"></a></h4>
<p>You can also link variables directly in code using <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard-method-link-var"><span class="std std-ref">Blackboard.link_var</span></a>:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="c1"># Example: programmatically link a BT blackboard variable to an HSM blackboard variable</span>
<span class="c1"># Assume `hsm` is a LimboHSM instance and `bt_state` is a BTState instance</span>
<span class="k">var</span><span class="w"> </span><span class="n">hsm_bb</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">get_blackboard</span><span class="p">()</span>
<span class="k">var</span><span class="w"> </span><span class="n">bt_bb</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="n">bt_state</span><span class="o">.</span><span class="n">get_blackboard</span><span class="p">()</span>
<span class="c1"># NOTE: variable names do not need to match</span>
<span class="n">bt_bb</span><span class="o">.</span><span class="n">link_var</span><span class="p">(</span><span class="s2">"target_pos"</span><span class="p">,</span><span class="w"> </span><span class="n">hsm_bb</span><span class="p">,</span><span class="w"> </span><span class="s2">"target_pos"</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="best-practices">
<h4>Best practices<a class="headerlink" href="#best-practices" title="Link to this heading"></a></h4>
<ul class="simple">
<li><p>Declare all BT dependencies in the BT’s BlackboardPlan instead of relying on parent scopes.</p></li>
<li><p>Use <strong>Mapping</strong> to explicitly declare which variables should be shared with the HSM.</p></li>
<li><p>Prefer the inspector-based Mapping workflow for clarity and editor support; use
<code class="docutils literal notranslate"><span class="pre">link_var</span></code> only when runtime or programmatic setup is required.</p></li>
<li><p>Avoid writing to <code class="docutils literal notranslate"><span class="pre">blackboard.get_parent()</span></code> from inside BT tasks unless you have
a very specific reason and accept the coupling it introduces.</p></li>
</ul>
</section>
</section>
<section id="advanced-topic-blackboard-scopes">
<h3>Advanced topic: Blackboard scopes<a class="headerlink" href="#advanced-topic-blackboard-scopes" title="Link to this heading"></a></h3>
<p>The <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> in LimboAI can act as a parent scope
for another <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.
This means that if a specific variable is not found in the active scope,
the system will look in the parent <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> to find it.
This creates a “blackboard scope chain,” where each <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> can have its own parent scope,
and there is no limit to how many blackboards can be in this chain.
It’s important to note that the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> doesn’t modify values in the parent scopes.</p>
<p>Scopes are created automatically to prevent naming collisions between contextually separate environments:</p>
<ul class="simple">
<li><p>Within <a class="reference internal" href="#document-classes/class_btnewscope#class-btnewscope"><span class="std std-ref">BTNewScope</span></a>.</p></li>
<li><p>Under <a class="reference internal" href="#document-classes/class_btsubtree#class-btsubtree"><span class="std std-ref">BTSubtree</span></a> decorators.</p></li>
<li><p>With <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> that have a non-empty blackboard plan defined.</p></li>
<li><p>Under <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> nodes: A new scope is created at the root level,
and each <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> child also receives its own separate scope.</p></li>
</ul>
<section id="sharing-data-between-several-agents">
<h4>Sharing data between several agents<a class="headerlink" href="#sharing-data-between-several-agents" title="Link to this heading"></a></h4>
<p>The blackboard scope mechanism can also be used for sharing data between several agents.
In the following example, we have a group of agents, and we want to share a common target between them:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">BTAction</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">group_target_var</span><span class="p">:</span><span class="w"> </span><span class="n">StringName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"group_target"</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">has_var</span><span class="p">(</span><span class="n">group_target_var</span><span class="p">):</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">new_target</span><span class="p">:</span><span class="w"> </span><span class="n">Node</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">acquire_target</span><span class="p">()</span>
<span class="w"> </span><span class="c1"># Set common target shared between agents in a group:</span>
<span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">top</span><span class="p">()</span><span class="o">.</span><span class="n">set_var</span><span class="p">(</span><span class="n">group_target_var</span><span class="p">,</span><span class="w"> </span><span class="n">new_target</span><span class="p">)</span>
<span class="w"> </span><span class="c1"># Access common target shared between agents in a group:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">target</span><span class="p">:</span><span class="w"> </span><span class="n">Node</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">get_var</span><span class="p">(</span><span class="n">group_target_var</span><span class="p">)</span>
</pre></div>
</div>
<p>In this example, <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard-method-top"><span class="std std-ref">blackboard.top()</span></a> accesses the root scope of the
<a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> chain.
We assign that scope to each agent in a group through code:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">class_name</span><span class="w"> </span><span class="n">AgentGroup</span>
<span class="k">extends</span><span class="w"> </span><span class="n">Node2D</span>
<span class="c1">## AgentGroup node: Manages the shared Blackboard for agents in a group.</span>
<span class="c1">## Children of this node are assumed to be agents that belong to a common group.</span>
<span class="c1">## This implementation assumes that each agent has a "BTPlayer" node for AI.</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">blackboard_plan</span><span class="p">:</span><span class="w"> </span><span class="n">BlackboardPlan</span>
<span class="k">var</span><span class="w"> </span><span class="n">shared_scope</span><span class="p">:</span><span class="w"> </span><span class="n">Blackboard</span>
<span class="k">func</span><span class="w"> </span><span class="n">_ready</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">blackboard_plan</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nb nb-Type">null</span><span class="p">:</span>
<span class="w"> </span><span class="n">shared_scope</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Blackboard</span><span class="o">.</span><span class="n">new</span><span class="p">()</span>
<span class="w"> </span><span class="k">else</span><span class="p">:</span>
<span class="w"> </span><span class="n">shared_scope</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">blackboard_plan</span><span class="o">.</span><span class="n">create_blackboard</span><span class="p">()</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">child</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="n">get_children</span><span class="p">():</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">bt_player</span><span class="p">:</span><span class="w"> </span><span class="n">BTPlayer</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">child</span><span class="o">.</span><span class="n">find_child</span><span class="p">(</span><span class="s2">"BTPlayer"</span><span class="p">)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">is_instance_valid</span><span class="p">(</span><span class="n">bt_player</span><span class="p">):</span>
<span class="w"> </span><span class="n">bt_player</span><span class="o">.</span><span class="n">blackboard</span><span class="o">.</span><span class="n">set_parent</span><span class="p">(</span><span class="n">shared_scope</span><span class="p">)</span>
</pre></div>
</div>
<p>In conclusion, the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> scope chain not only
prevents naming conflicts that can occur between state machines, behavior trees, and sub-trees,
but it can also be used to share data between several agents.</p>
</section>
</section>
<section id="debugging-blackboard-variables">
<h3>Debugging blackboard variables<a class="headerlink" href="#debugging-blackboard-variables" title="Link to this heading"></a></h3>
<p>When debugging a running project, you can inspect <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variables
in the remote Inspector. Click on a task in the LimboAI debugger to view its properties,
then click the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> reference to see all variables across the full
scope chain, grouped by scope. Variables can be edited live to aid in debugging.
For state machines, select a <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> node in the Remote Scene Tree
to access its <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> in the same way.</p>
</section>
</section>
<span id="document-behavior-trees/accessing-nodes"></span><section id="accessing-nodes-in-the-scene-tree">
<span id="accessing-nodes"></span><h2>Accessing nodes in the scene tree<a class="headerlink" href="#accessing-nodes-in-the-scene-tree" title="Link to this heading"></a></h2>
<p>There are several ways to access nodes in the agent’s scene tree from a <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a>.</p>
<blockquote>
<div><p><strong>🛈 Note:</strong> The root node of the agent’s scene tree can be accessed with the
<a class="reference internal" href="#document-classes/class_bttask#class-bttask-property-scene-root"><span class="std std-ref">scene_root</span></a> property.</p>
</div></blockquote>
<section id="with-bbnode-property">
<h3>With <code class="docutils literal notranslate"><span class="pre">BBNode</span></code> property<a class="headerlink" href="#with-bbnode-property" title="Link to this heading"></a></h3>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">cast_param</span><span class="p">:</span><span class="w"> </span><span class="n">BBNode</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">node</span><span class="p">:</span><span class="w"> </span><span class="n">ShapeCast3D</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cast_param</span><span class="o">.</span><span class="n">get_value</span><span class="p">(</span><span class="n">scene_root</span><span class="p">,</span><span class="w"> </span><span class="n">blackboard</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="with-nodepath-property">
<h3>With <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> property<a class="headerlink" href="#with-nodepath-property" title="Link to this heading"></a></h3>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">cast_path</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">NodePath</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">node</span><span class="p">:</span><span class="w"> </span><span class="n">ShapeCast3D</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">scene_root</span><span class="o">.</span><span class="n">get_node</span><span class="p">(</span><span class="n">cast_path</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="using-blackboard-plan">
<h3>Using blackboard plan<a class="headerlink" href="#using-blackboard-plan" title="Link to this heading"></a></h3>
<p>You can <a class="reference internal" href="#document-behavior-trees/using-blackboard#editing-plan"><span class="std std-ref">create a blackboard variable</span></a> in the editor with the type <code class="docutils literal notranslate"><span class="pre">NodePath</span></code>
and point it to the proper node in the <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a> blackboard plan. By default,
any <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> variable will be replaced with the node instance when the blackboard is instantiated
at runtime (see <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan-property-prefetch-nodepath-vars"><span class="std std-ref">BlackboardPlan.prefetch_nodepath_vars</span></a>).</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">BTCondition</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">shape_var</span><span class="p">:</span><span class="w"> </span><span class="n">StringName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"shape_cast"</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">shape_cast</span><span class="p">:</span><span class="w"> </span><span class="n">ShapeCast3D</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">blackboard</span><span class="o">.</span><span class="n">get_var</span><span class="p">(</span><span class="n">shape_var</span><span class="p">)</span>
</pre></div>
</div>
<p>The property <span class="xref std std-ref">BTPlayer.prefetch_nodepath_vars</span> should be set to <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
</section>
</section>
</div>
<div class="toctree-wrapper compound">
<span id="document-hierarchical-state-machines/create-hsm"></span><section id="create-state-machines">
<span id="hsm"></span><h2>Create State Machines<a class="headerlink" href="#create-state-machines" title="Link to this heading"></a></h2>
<p>This guide will show how to set up and use a state machine using <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a>.</p>
<section id="initialization">
<h3>Initialization<a class="headerlink" href="#initialization" title="Link to this heading"></a></h3>
<p>To use the <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> state machine, you first need to initialize it in your code.
This is typically done in the <code class="docutils literal notranslate"><span class="pre">_ready</span></code> function of your script. Here’s an example of how to do this:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="err">@</span><span class="k">onready</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">hsm</span><span class="p">:</span><span class="w"> </span><span class="n">LimboHSM</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">$</span><span class="n">LimboHSM</span>
<span class="err">@</span><span class="k">onready</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">idle_state</span><span class="p">:</span><span class="w"> </span><span class="n">LimboState</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">$</span><span class="n">LimboHSM</span><span class="o">/</span><span class="n">IdleState</span>
<span class="err">@</span><span class="k">onready</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">move_state</span><span class="p">:</span><span class="w"> </span><span class="n">LimboState</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">$</span><span class="n">LimboHSM</span><span class="o">/</span><span class="n">MoveState</span>
<span class="k">func</span><span class="w"> </span><span class="n">_ready</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">_init_state_machine</span><span class="p">()</span>
<span class="k">func</span><span class="w"> </span><span class="n">_init_state_machine</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_transition</span><span class="p">(</span><span class="n">idle_state</span><span class="p">,</span><span class="w"> </span><span class="n">move_state</span><span class="p">,</span><span class="w"> </span><span class="n">idle_state</span><span class="o">.</span><span class="n">EVENT_FINISHED</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_transition</span><span class="p">(</span><span class="n">move_state</span><span class="p">,</span><span class="w"> </span><span class="n">idle_state</span><span class="p">,</span><span class="w"> </span><span class="n">move_state</span><span class="o">.</span><span class="n">EVENT_FINISHED</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">set_active</span><span class="p">(</span><span class="bp">true</span><span class="p">)</span>
</pre></div>
</div>
<p>In this example, we first declare the state machine and the states we want to use.
Then, in the <code class="docutils literal notranslate"><span class="pre">_init_state_machine</span></code> function, we add transitions between the states.
Finally, we initialize the state machine and set it to active.</p>
</section>
<section id="state-example">
<h3>State example<a class="headerlink" href="#state-example" title="Link to this heading"></a></h3>
<p>You can define the behavior of a state in a script and attach it to the state node.
Here’s an example of a state that plays an animation on an <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> and waits for it to finish:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">LimboState</span>
<span class="c1">## PlayAnimation: Play an animation on AnimationPlayer, and wait for it to finish.</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">animation_player</span><span class="p">:</span><span class="w"> </span><span class="n">AnimationPlayer</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">animation_name</span><span class="p">:</span><span class="w"> </span><span class="n">StringName</span>
<span class="k">func</span><span class="w"> </span><span class="n">_enter</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">animation_player</span><span class="o">.</span><span class="n">play</span><span class="p">(</span><span class="n">animation_name</span><span class="p">)</span>
<span class="k">func</span><span class="w"> </span><span class="n">_update</span><span class="p">(</span><span class="n">_delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">animation_player</span><span class="o">.</span><span class="n">is_playing</span><span class="p">()</span><span class="w"> </span>\
<span class="w"> </span><span class="ow">or</span><span class="w"> </span><span class="n">animation_player</span><span class="o">.</span><span class="n">assigned_animation</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">animation_name</span><span class="p">:</span>
<span class="w"> </span><span class="n">dispatch</span><span class="p">(</span><span class="n">EVENT_FINISHED</span><span class="p">)</span>
</pre></div>
</div>
<p>In this example, the <code class="docutils literal notranslate"><span class="pre">_enter</span></code> method is called when the state is entered, and it plays the specified animation.
The <code class="docutils literal notranslate"><span class="pre">_update</span></code> method is called every frame, and it checks if the animation is finished.
If it is, it dispatches the <code class="docutils literal notranslate"><span class="pre">EVENT_FINISHED</span></code> event, which can result in a transition to the next state.</p>
</section>
<section id="events-and-transitions">
<h3>Events and transitions<a class="headerlink" href="#events-and-transitions" title="Link to this heading"></a></h3>
<p>The <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> comes with an <strong>event system</strong> that helps
to <strong>decouple transitions</strong> from the state implementations.
A transition is associated with a specific event, a starting state, and a destination state,
and it is performed automatically when such an event is dispatched.</p>
<p>To register a transition and associate it with a specific event, you can use the
<a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm-method-add-transition"><span class="std std-ref">LimboHSM.add_transition</span></a> method:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="n">hsm</span><span class="o">.</span><span class="n">add_transition</span><span class="p">(</span><span class="n">idle_state</span><span class="p">,</span><span class="w"> </span><span class="n">move_state</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"movement_started"</span><span class="p">)</span>
</pre></div>
</div>
<p>In this example, we’re registering a transition from the <code class="docutils literal notranslate"><span class="pre">idle_state</span></code> to the <code class="docutils literal notranslate"><span class="pre">move_state</span></code>
when the <code class="docutils literal notranslate"><span class="pre">movement_started</span></code> event is dispatched.</p>
<p>A transition can be also associated with no particular starting state:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="n">hsm</span><span class="o">.</span><span class="n">add_transition</span><span class="p">(</span><span class="n">hsm</span><span class="o">.</span><span class="n">ANYSTATE</span><span class="p">,</span><span class="w"> </span><span class="n">move_state</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"movement_started"</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>Events are dispatched</strong> with the <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-method-dispatch"><span class="std std-ref">LimboState.dispatch</span></a> method.
It’s important to note that this method can be called from anywhere in the state machine hierarchy and outside of it.
Events are <strong>propagated from the leaf to the root</strong> state. This means that if an event is consumed by a state,
it won’t be propagated to its parent states.</p>
<p>States can also define <strong>event handlers</strong>, which are methods that react to specific events.
These event handlers typically don’t result in a state transition;
they are simply a mechanism for states to react to particular events.
You can use the <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-method-add-event-handler"><span class="std std-ref">LimboState.add_event_handler</span></a> method
to register event handlers in your states:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">LimboState</span>
<span class="k">func</span><span class="w"> </span><span class="n">_setup</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">add_event_handler</span><span class="p">(</span><span class="s2">"movement_started"</span><span class="p">,</span><span class="w"> </span><span class="n">_on_movement_started</span><span class="p">)</span>
<span class="k">func</span><span class="w"> </span><span class="n">_on_movement_started</span><span class="p">(</span><span class="n">cargo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb nb-Type">null</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">bool</span><span class="p">:</span>
<span class="w"> </span><span class="c1"># Handle the "movement_started" event here.</span>
<span class="w"> </span><span class="c1"># `cargo` can be passed with the event when calling `dispatch()`.</span>
<span class="w"> </span><span class="c1"># It's quite handy when you need to pass some data to the event handler.</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="bp">true</span>
</pre></div>
</div>
<p>If the event handler returns <code class="docutils literal notranslate"><span class="pre">true</span></code>, the event will be considered as consumed,
and it won’t propagate further or result in a state transition.</p>
</section>
<section id="state-anatomy">
<h3>State anatomy<a class="headerlink" href="#state-anatomy" title="Link to this heading"></a></h3>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">LimboState</span>
<span class="c1">## Called once, when state is initialized.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_setup</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
<span class="c1">## Called when state is entered.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_enter</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
<span class="c1">## Called when state is exited.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_exit</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
<span class="c1">## Called each frame when this state is active.</span>
<span class="k">func</span><span class="w"> </span><span class="n">_update</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">pass</span>
</pre></div>
</div>
</section>
<section id="using-behavior-trees-with-state-machines">
<h3>Using behavior trees with state machines<a class="headerlink" href="#using-behavior-trees-with-state-machines" title="Link to this heading"></a></h3>
<p>The <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> is a specialized state node in <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> that can host a behavior tree.
When a <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> is active, it executes the hosted behavior tree each frame,
effectively using the behavior tree as its implementation.</p>
<p>This allows you to combine the power of behavior trees with the structure and control of state machines.
Behavior trees are excellent for defining complex, hierarchical behaviors,
while state machines are great for managing the flow and transitions between different behaviors.</p>
<p>Once the <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> has been created, a <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> can be created for a given <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">LimboHSM</span></a>:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">CharacterBody2D</span>
<span class="k">var</span><span class="w"> </span><span class="n">hsm</span><span class="p">:</span><span class="w"> </span><span class="n">LimboHSM</span>
<span class="err">@</span><span class="k">export</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">behavior_tree</span><span class="p">:</span><span class="w"> </span><span class="n">BehaviorTree</span>
<span class="k">func</span><span class="w"> </span><span class="n">_ready</span><span class="p">():</span>
<span class="w"> </span><span class="n">hsm</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">LimboHSM</span><span class="o">.</span><span class="n">new</span><span class="p">()</span>
<span class="w"> </span><span class="n">add_child</span><span class="p">(</span><span class="n">hsm</span><span class="p">)</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">bt_state</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="n">BTState</span><span class="p">()</span><span class="o">.</span><span class="n">new</span><span class="p">()</span>
<span class="w"> </span><span class="n">bt_state</span><span class="o">.</span><span class="n">named</span><span class="p">(</span><span class="s2">"Supplied BT"</span><span class="p">)</span>
<span class="w"> </span><span class="c1"># Set the behavior tree, or use a load("res://ai/trees/...") call</span>
<span class="w"> </span><span class="n">bt_state</span><span class="o">.</span><span class="n">behavior_tree</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">behavior_tree</span>
<span class="w"> </span><span class="n">bt_state</span><span class="o">.</span><span class="n">set_scene_root_hint</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_child</span><span class="p">(</span><span class="n">bt_state</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">initial_state</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">bt_state</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">set_active</span><span class="p">(</span><span class="bp">true</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="single-file-state-machine-setup">
<h3>Single-file state machine setup<a class="headerlink" href="#single-file-state-machine-setup" title="Link to this heading"></a></h3>
<p>In certain scenarios, such as prototyping or during game jams,
it’s practical to keep the state machine code in a single file.
For such cases, <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> <strong>supports delegation</strong> and provides <strong>chained methods</strong> for easier setup.
Let’s illustrate this with a practical code example:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">CharacterBody2D</span>
<span class="k">var</span><span class="w"> </span><span class="n">hsm</span><span class="p">:</span><span class="w"> </span><span class="n">LimboHSM</span>
<span class="err">@</span><span class="k">onready</span><span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">animation_player</span><span class="p">:</span><span class="w"> </span><span class="n">AnimationPlayer</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">$</span><span class="n">AnimationPlayer</span>
<span class="k">func</span><span class="w"> </span><span class="n">_ready</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">_init_state_machine</span><span class="p">()</span>
<span class="k">func</span><span class="w"> </span><span class="n">_init_state_machine</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="n">hsm</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">LimboHSM</span><span class="o">.</span><span class="n">new</span><span class="p">()</span>
<span class="w"> </span><span class="n">add_child</span><span class="p">(</span><span class="n">hsm</span><span class="p">)</span>
<span class="w"> </span><span class="c1"># Use chained methods and delegation to set up states:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">idle_state</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="n">LimboState</span><span class="o">.</span><span class="n">new</span><span class="p">()</span><span class="o">.</span><span class="n">named</span><span class="p">(</span><span class="s2">"Idle"</span><span class="p">)</span><span class="w"> </span>\
<span class="w"> </span><span class="o">.</span><span class="n">call_on_enter</span><span class="p">(</span><span class="k">func</span><span class="p">():</span><span class="w"> </span><span class="n">animation_player</span><span class="o">.</span><span class="n">play</span><span class="p">(</span><span class="s2">"idle"</span><span class="p">))</span><span class="w"> </span>\
<span class="w"> </span><span class="o">.</span><span class="n">call_on_update</span><span class="p">(</span><span class="n">_idle_update</span><span class="p">)</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">move_state</span><span class="w"> </span><span class="p">:</span><span class="o">=</span><span class="w"> </span><span class="n">LimboState</span><span class="o">.</span><span class="n">new</span><span class="p">()</span><span class="o">.</span><span class="n">named</span><span class="p">(</span><span class="s2">"Move"</span><span class="p">)</span><span class="w"> </span>\
<span class="w"> </span><span class="o">.</span><span class="n">call_on_enter</span><span class="p">(</span><span class="k">func</span><span class="p">():</span><span class="w"> </span><span class="n">animation_player</span><span class="o">.</span><span class="n">play</span><span class="p">(</span><span class="s2">"walk"</span><span class="p">))</span><span class="w"> </span>\
<span class="w"> </span><span class="o">.</span><span class="n">call_on_update</span><span class="p">(</span><span class="n">_move_update</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_child</span><span class="p">(</span><span class="n">idle_state</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_child</span><span class="p">(</span><span class="n">move_state</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_transition</span><span class="p">(</span><span class="n">idle_state</span><span class="p">,</span><span class="w"> </span><span class="n">move_state</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"movement_started"</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">add_transition</span><span class="p">(</span><span class="n">move_state</span><span class="p">,</span><span class="w"> </span><span class="n">idle_state</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"movement_ended"</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">set_active</span><span class="p">(</span><span class="bp">true</span><span class="p">)</span>
<span class="k">func</span><span class="w"> </span><span class="n">_idle_update</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">dir</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">Vector2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Input</span><span class="o">.</span><span class="n">get_vector</span><span class="p">(</span>
<span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_left"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_right"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_up"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_down"</span><span class="p">)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">dir</span><span class="o">.</span><span class="n">is_zero_approx</span><span class="p">():</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">dispatch</span><span class="p">(</span><span class="o">&amp;</span><span class="s2">"movement_started"</span><span class="p">)</span>
<span class="k">func</span><span class="w"> </span><span class="n">_move_update</span><span class="p">(</span><span class="n">delta</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">float</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">dir</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">Vector2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Input</span><span class="o">.</span><span class="n">get_vector</span><span class="p">(</span>
<span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_left"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_right"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_up"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="s2">"ui_down"</span><span class="p">)</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">desired_velocity</span><span class="p">:</span><span class="w"> </span><span class="nb nb-Type">Vector2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">dir</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">200.0</span>
<span class="w"> </span><span class="n">velocity</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">desired_velocity</span>
<span class="w"> </span><span class="n">move_and_slide</span><span class="p">()</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">desired_velocity</span><span class="o">.</span><span class="n">is_zero_approx</span><span class="p">():</span>
<span class="w"> </span><span class="n">hsm</span><span class="o">.</span><span class="n">dispatch</span><span class="p">(</span><span class="o">&amp;</span><span class="s2">"movement_ended"</span><span class="p">)</span>
</pre></div>
</div>
</section>
</section>
</div>
<div class="toctree-wrapper compound">
<span id="document-classes/featured-classes"></span><section id="important-classes">
<span id="featured-classes"></span><h2>Important classes<a class="headerlink" href="#important-classes" title="Link to this heading"></a></h2>
<p>There are a lot of classes introduced in LimboAI. Here is a list of the most important ones you should know about:</p>
<div class="toctree-wrapper compound">
<span id="document-classes/class_bttask"></span><section id="bttask">
<span id="class-bttask"></span><h3>BTTask<a class="headerlink" href="#bttask" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a>, <a class="reference internal" href="#document-classes/class_btcomment#class-btcomment"><span class="std std-ref">BTComment</span></a>, <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a>, <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a>, <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a></p>
<p>Base class for all <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks.</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p>Base class for all <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. A task is a basic building block in a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> that represents a specific behavior or control flow. Tasks are used to create complex behaviors by combining and nesting them in a hierarchy.</p>
<p>A task can be one of the following types: action, condition, composite, or decorator. Each type of task has its own corresponding subclass: <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a>, <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a>, <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a>, <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a>.</p>
<p>Tasks perform their work and return their status using the <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a> method. Status values are defined in <a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a>. Tasks can be initialized using the <a class="reference internal" href="#class-bttask-private-method-setup"><span class="std std-ref">_setup</span></a> method. See also <a class="reference internal" href="#class-bttask-private-method-enter"><span class="std std-ref">_enter</span></a> &amp; <a class="reference internal" href="#class-bttask-private-method-exit"><span class="std std-ref">_exit</span></a>.</p>
<p><strong>Note:</strong> Do not extend <strong>BTTask</strong> directly for your own tasks. Instead, extend one of the subtypes mentioned above.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h4>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Node</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-property-agent"><span class="std std-ref">agent</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-property-blackboard"><span class="std std-ref">blackboard</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-property-custom-name"><span class="std std-ref">custom_name</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-property-elapsed-time"><span class="std std-ref">elapsed_time</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Node</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-property-scene-root"><span class="std std-ref">scene_root</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-property-status"><span class="std std-ref">status</span></a></p></td>
<td></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-private-method-enter"><span class="std std-ref">_enter</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-private-method-exit"><span class="std std-ref">_exit</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-private-method-generate-name"><span class="std std-ref">_generate_name</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-private-method-get-configuration-warnings"><span class="std std-ref">_get_configuration_warnings</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-private-method-setup"><span class="std std-ref">_setup</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-abort"><span class="std std-ref">abort</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-add-child"><span class="std std-ref">add_child</span></a>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-add-child-at-index"><span class="std std-ref">add_child_at_index</span></a>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>, idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-clone"><span class="std std-ref">clone</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-editor-get-behavior-tree"><span class="std std-ref">editor_get_behavior_tree</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-execute"><span class="std std-ref">execute</span></a>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-child"><span class="std std-ref">get_child</span></a>(idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-child-count"><span class="std std-ref">get_child_count</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-child-count-excluding-comments"><span class="std std-ref">get_child_count_excluding_comments</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-index"><span class="std std-ref">get_index</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-parent"><span class="std std-ref">get_parent</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-root"><span class="std std-ref">get_root</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-get-task-name"><span class="std std-ref">get_task_name</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-has-child"><span class="std std-ref">has_child</span></a>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-initialize"><span class="std std-ref">initialize</span></a>(agent: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-is-descendant-of"><span class="std std-ref">is_descendant_of</span></a>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-is-root"><span class="std std-ref">is_root</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-next-sibling"><span class="std std-ref">next_sibling</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-print-tree"><span class="std std-ref">print_tree</span></a>(initial_tabs: <code class="docutils literal notranslate"><span class="pre">int</span></code> = 0)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-remove-child"><span class="std std-ref">remove_child</span></a>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-bttask-method-remove-child-at-index"><span class="std std-ref">remove_child_at_index</span></a>(idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h4>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h4>
<p class="classref-property" id="class-bttask-property-agent"><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>agent</strong> <a class="reference internal" href="#class-bttask-property-agent"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_agent</strong>(value: <code class="docutils literal notranslate"><span class="pre">Node</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>get_agent</strong>()</p></li>
</ul>
<p>The agent is the contextual object for the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance. This is usually the parent of the <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a> node that utilizes the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resource.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bttask-property-blackboard"><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>blackboard</strong> <a class="reference internal" href="#class-bttask-property-blackboard"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>get_blackboard</strong>()</p></li>
</ul>
<p>Provides access to the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>. Blackboard is used to share data among tasks of the associated <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
<p>See <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> for additional info.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bttask-property-custom-name"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>custom_name</strong> = <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code> <a class="reference internal" href="#class-bttask-property-custom-name"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_custom_name</strong>(value: <code class="docutils literal notranslate"><span class="pre">String</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_custom_name</strong>()</p></li>
</ul>
<p>User-provided name for the task. If not empty, it is used by the editor to represent the task. See <a class="reference internal" href="#class-bttask-method-get-task-name"><span class="std std-ref">get_task_name</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bttask-property-elapsed-time"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>elapsed_time</strong> <a class="reference internal" href="#class-bttask-property-elapsed-time"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_elapsed_time</strong>()</p></li>
</ul>
<p>Elapsed time since the task was “entered”. See <a class="reference internal" href="#class-bttask-private-method-enter"><span class="std std-ref">_enter</span></a>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">0</span></code> when task is not <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bttask-property-scene-root"><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>scene_root</strong> <a class="reference internal" href="#class-bttask-property-scene-root"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>get_scene_root</strong>()</p></li>
</ul>
<p>Root node of the scene the behavior tree is used in (e.g., the owner of the <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a> node). Can be uses to retrieve <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> references.</p>
<p><strong>Example:</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">extends</span> <span class="n">BTAction</span>
<span class="nd">@export</span> <span class="n">var</span> <span class="n">node_path</span><span class="p">:</span> <span class="n">NodePath</span>
<span class="n">func</span> <span class="n">_setup</span><span class="p">():</span>
<span class="n">var</span> <span class="n">node</span><span class="p">:</span> <span class="n">Node</span> <span class="o">=</span> <span class="n">scene_root</span><span class="o">.</span><span class="n">get_node</span><span class="p">(</span><span class="n">node_path</span><span class="p">)</span>
</pre></div>
</div>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bttask-property-status"><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>status</strong> <a class="reference internal" href="#class-bttask-property-status"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>get_status</strong>()</p></li>
</ul>
<p>Last execution <a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> returned by <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-bttask-private-method-enter"><abbr title="No return value.">void</abbr> <strong>_enter</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-bttask-private-method-enter"><span class="std std-ref">🔗</span></a></p>
<p>Called when task is “entered”, i.e. when task is executed while not having a <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> <a class="reference internal" href="#class-bttask-property-status"><span class="std std-ref">status</span></a>.</p>
<p>It is called before <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a> in the execution order. This method is used when preparation is needed before main work begins, usually when it takes more than one tick to finish the task. See also <a class="reference internal" href="#class-bttask-method-execute"><span class="std std-ref">execute</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-private-method-exit"><abbr title="No return value.">void</abbr> <strong>_exit</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-bttask-private-method-exit"><span class="std std-ref">🔗</span></a></p>
<p>Called when task is “exited”, i.e. after <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a> returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> status. See also <a class="reference internal" href="#class-bttask-method-execute"><span class="std std-ref">execute</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-private-method-generate-name"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>_generate_name</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-private-method-generate-name"><span class="std std-ref">🔗</span></a></p>
<p>Called to generate a display name for the task unless <a class="reference internal" href="#class-bttask-property-custom-name"><span class="std std-ref">custom_name</span></a> is set. See <a class="reference internal" href="#class-bttask-method-get-task-name"><span class="std std-ref">get_task_name</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-private-method-get-configuration-warnings"><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> <strong>_get_configuration_warnings</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-private-method-get-configuration-warnings"><span class="std std-ref">🔗</span></a></p>
<p>The string returned by this method is shown as a warning message in the behavior tree editor. Any task script that overrides this method must include <code class="docutils literal notranslate"><span class="pre">&#64;tool</span></code> annotation at the top of the file.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-private-method-setup"><abbr title="No return value.">void</abbr> <strong>_setup</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-bttask-private-method-setup"><span class="std std-ref">🔗</span></a></p>
<p>Called to initialize a task during initialization step. It is called only once before the task’s first execution tick. This method allows you to set up any necessary state or configurations for the task before it begins executing.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-private-method-tick"><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>_tick</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">🔗</span></a></p>
<p>Called when task is “ticked”, i.e. executed by <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a> or <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a> during an update.</p>
<p>Returns execution status as defined in <a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a>.</p>
<p><strong>Note:</strong> Tasks perform their main function by implementing this method.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-abort"><abbr title="No return value.">void</abbr> <strong>abort</strong>() <a class="reference internal" href="#class-bttask-method-abort"><span class="std std-ref">🔗</span></a></p>
<p>Resets the task and its children recursively. If a task is in the <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> state, it is exited and its status is reset to <code class="docutils literal notranslate"><span class="pre">FRESH</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-add-child"><abbr title="No return value.">void</abbr> <strong>add_child</strong>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>) <a class="reference internal" href="#class-bttask-method-add-child"><span class="std std-ref">🔗</span></a></p>
<p>Adds a child task. The <code class="docutils literal notranslate"><span class="pre">task</span></code> is placed at the end of the children list.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-add-child-at-index"><abbr title="No return value.">void</abbr> <strong>add_child_at_index</strong>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>, idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <a class="reference internal" href="#class-bttask-method-add-child-at-index"><span class="std std-ref">🔗</span></a></p>
<p>Adds a child task. The <code class="docutils literal notranslate"><span class="pre">task</span></code> is placed at <code class="docutils literal notranslate"><span class="pre">idx</span></code> position in the children list.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-clone"><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>clone</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-clone"><span class="std std-ref">🔗</span></a></p>
<p>Duplicates the task and its children, copying the exported members. Sub-resources are shared for efficiency, except for <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a> subtypes, which are always copied. Used by the editor to instantiate <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> and copy-paste tasks.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-editor-get-behavior-tree"><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>editor_get_behavior_tree</strong>() <a class="reference internal" href="#class-bttask-method-editor-get-behavior-tree"><span class="std std-ref">🔗</span></a></p>
<p>Returns the behavior tree that owns this task. This is only available in the editor.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-execute"><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>execute</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-bttask-method-execute"><span class="std std-ref">🔗</span></a></p>
<p>Performs task’s execution. The execution follows a specific sequence:</p>
<ul class="simple">
<li><p>If task’s current <a class="reference internal" href="#class-bttask-property-status"><span class="std std-ref">status</span></a> is not <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, the <a class="reference internal" href="#class-bttask-private-method-enter"><span class="std std-ref">_enter</span></a> method is called first.</p></li>
<li><p>Next, the <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a> method is called next to perform the task’s work.</p></li>
<li><p>If the <a class="reference internal" href="#class-bttask-private-method-tick"><span class="std std-ref">_tick</span></a> method returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> status, the <a class="reference internal" href="#class-bttask-private-method-exit"><span class="std std-ref">_exit</span></a> method will be called next as part of the execution cleanup.</p></li>
</ul>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-child"><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>get_child</strong>(idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-get-child"><span class="std std-ref">🔗</span></a></p>
<p>Returns a child task by specifying its index.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-child-count"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_child_count</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-get-child-count"><span class="std std-ref">🔗</span></a></p>
<p>Returns the number of child tasks.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-child-count-excluding-comments"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_child_count_excluding_comments</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-get-child-count-excluding-comments"><span class="std std-ref">🔗</span></a></p>
<p>Returns the number of child tasks not counting <a class="reference internal" href="#document-classes/class_btcomment#class-btcomment"><span class="std std-ref">BTComment</span></a> tasks.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-index"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_index</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-get-index"><span class="std std-ref">🔗</span></a></p>
<p>Returns the task’s position in the behavior tree branch. Returns <code class="docutils literal notranslate"><span class="pre">-1</span></code> if the task doesn’t belong to a task tree, i.e. doesn’t have a parent.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-parent"><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>get_parent</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-get-parent"><span class="std std-ref">🔗</span></a></p>
<p>Returns the task’s parent.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-root"><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>get_root</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-get-root"><span class="std std-ref">🔗</span></a></p>
<p>Returns the root task of the behavior tree.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-get-task-name"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_task_name</strong>() <a class="reference internal" href="#class-bttask-method-get-task-name"><span class="std std-ref">🔗</span></a></p>
<p>The string returned by this method is used to represent the task in the editor.</p>
<p>Method <a class="reference internal" href="#class-bttask-private-method-generate-name"><span class="std std-ref">_generate_name</span></a> is called to generate a display name for the task unless <a class="reference internal" href="#class-bttask-property-custom-name"><span class="std std-ref">custom_name</span></a> is set.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-has-child"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>has_child</strong>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-has-child"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if <code class="docutils literal notranslate"><span class="pre">task</span></code> is a child of this task.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-initialize"><abbr title="No return value.">void</abbr> <strong>initialize</strong>(agent: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>) <a class="reference internal" href="#class-bttask-method-initialize"><span class="std std-ref">🔗</span></a></p>
<p>Initilizes the task. Assigns <a class="reference internal" href="#class-bttask-property-agent"><span class="std std-ref">agent</span></a> and <a class="reference internal" href="#class-bttask-property-blackboard"><span class="std std-ref">blackboard</span></a>, and calls <a class="reference internal" href="#class-bttask-private-method-setup"><span class="std std-ref">_setup</span></a> for the task and its children.</p>
<p>The method is called recursively for each child task. <code class="docutils literal notranslate"><span class="pre">scene_root</span></code> should be the root node of the scene the behavior tree is used in (e.g., the owner of the node that contains the behavior tree).</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-is-descendant-of"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_descendant_of</strong>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-is-descendant-of"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if this task is a descendant of <code class="docutils literal notranslate"><span class="pre">task</span></code>. In other words, this task must be a child of <code class="docutils literal notranslate"><span class="pre">task</span></code> or one of its children or grandchildren.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-is-root"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_root</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-is-root"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if this task is the root task of its behavior tree. A behavior tree can have only one root task.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-next-sibling"><a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>next_sibling</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bttask-method-next-sibling"><span class="std std-ref">🔗</span></a></p>
<p>Returns the next task after this task in the parent’s children list.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">null</span></code> if this task has no parent or it is the last child in the parent’s children list.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-print-tree"><abbr title="No return value.">void</abbr> <strong>print_tree</strong>(initial_tabs: <code class="docutils literal notranslate"><span class="pre">int</span></code> = 0) <a class="reference internal" href="#class-bttask-method-print-tree"><span class="std std-ref">🔗</span></a></p>
<p>Prints the subtree that starts with this task to the console.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-remove-child"><abbr title="No return value.">void</abbr> <strong>remove_child</strong>(task: <a class="reference internal" href="#class-bttask"><span class="std std-ref">BTTask</span></a>) <a class="reference internal" href="#class-bttask-method-remove-child"><span class="std std-ref">🔗</span></a></p>
<p>Removes <code class="docutils literal notranslate"><span class="pre">task</span></code> from children.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bttask-method-remove-child-at-index"><abbr title="No return value.">void</abbr> <strong>remove_child_at_index</strong>(idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <a class="reference internal" href="#class-bttask-method-remove-child-at-index"><span class="std std-ref">🔗</span></a></p>
<p>Removes a child task at a specified index from children.</p>
</section>
</section>
<span id="document-classes/class_btplayer"></span><section id="btplayer">
<span id="class-btplayer"></span><h3>BTPlayer<a class="headerlink" href="#btplayer" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong></p>
<p>Player of <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resources.</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p><strong>BTPlayer</strong> node is used to instantiate and play <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resources at runtime. During initialization, the behavior tree instance is given references to the agent, the <a class="reference internal" href="#class-btplayer-property-blackboard"><span class="std std-ref">blackboard</span></a>, and the current scene root. The agent can be specified by the <a class="reference internal" href="#class-btplayer-property-agent-node"><span class="std std-ref">agent_node</span></a> property (defaults to the BTPlayer’s parent node).</p>
<p>For an introduction to behavior trees, see <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h4>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-active"><span class="std std-ref">active</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">NodePath</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-agent-node"><span class="std std-ref">agent_node</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">NodePath(&quot;..&quot;)</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-behavior-tree"><span class="std std-ref">behavior_tree</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-blackboard"><span class="std std-ref">blackboard</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-blackboard-plan"><span class="std std-ref">blackboard_plan</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-monitor-performance"><span class="std std-ref">monitor_performance</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btplayer-property-update-mode"><span class="std std-ref">update_mode</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a></p></td>
<td><p><a class="reference internal" href="#class-btplayer-method-get-bt-instance"><span class="std std-ref">get_bt_instance</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btplayer-method-restart"><span class="std std-ref">restart</span></a>()</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btplayer-method-set-bt-instance"><span class="std std-ref">set_bt_instance</span></a>(bt_instance: <a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a>)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btplayer-method-set-scene-root-hint"><span class="std std-ref">set_scene_root_hint</span></a>(scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btplayer-method-update"><span class="std std-ref">update</span></a>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="signals">
<h4>Signals<a class="headerlink" href="#signals" title="Link to this heading"></a></h4>
<p class="classref-signal" id="class-btplayer-signal-behavior-tree-finished"><strong>behavior_tree_finished</strong>(status: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <a class="reference internal" href="#class-btplayer-signal-behavior-tree-finished"><span class="std std-ref">🔗</span></a></p>
<p><strong>Deprecated:</strong> Use <a class="reference internal" href="#class-btplayer-signal-updated"><span class="std std-ref">updated</span></a> signal instead.</p>
<p>Emitted when the behavior tree has finished executing and returned <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Argument <code class="docutils literal notranslate"><span class="pre">status</span></code> holds the status returned by the behavior tree. See <a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-signal" id="class-btplayer-signal-updated"><strong>updated</strong>(status: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <a class="reference internal" href="#class-btplayer-signal-updated"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when BTPlayer has finished the behavior tree update.</p>
<p>Argument <code class="docutils literal notranslate"><span class="pre">status</span></code> holds the status returned by the behavior tree. See <a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="enumerations">
<h4>Enumerations<a class="headerlink" href="#enumerations" title="Link to this heading"></a></h4>
<p class="classref-enumeration" id="enum-btplayer-updatemode">enum <strong>UpdateMode</strong>: <a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-btplayer-constant-idle"><a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>IDLE</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>Execute behavior tree during the idle process.</p>
<p class="classref-enumeration-constant" id="class-btplayer-constant-physics"><a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>PHYSICS</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>Execute behavior tree during the physics process.</p>
<p class="classref-enumeration-constant" id="class-btplayer-constant-manual"><a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>MANUAL</strong> = <code class="docutils literal notranslate"><span class="pre">2</span></code></p>
<p>Behavior tree is executed manually by calling <a class="reference internal" href="#class-btplayer-method-update"><span class="std std-ref">update</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h4>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h4>
<p class="classref-property" id="class-btplayer-property-active"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>active</strong> = <code class="docutils literal notranslate"><span class="pre">true</span></code> <a class="reference internal" href="#class-btplayer-property-active"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_active</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_active</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, the behavior tree will be executed during update.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayer-property-agent-node"><code class="docutils literal notranslate"><span class="pre">NodePath</span></code> <strong>agent_node</strong> = <code class="docutils literal notranslate"><span class="pre">NodePath(&quot;..&quot;)</span></code> <a class="reference internal" href="#class-btplayer-property-agent-node"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_agent_node</strong>(value: <code class="docutils literal notranslate"><span class="pre">NodePath</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">NodePath</span></code> <strong>get_agent_node</strong>()</p></li>
</ul>
<p>Path to the node that will be used as the agent. Setting it after instantiation will have no effect.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayer-property-behavior-tree"><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>behavior_tree</strong> <a class="reference internal" href="#class-btplayer-property-behavior-tree"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_behavior_tree</strong>(value: <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>get_behavior_tree</strong>()</p></li>
</ul>
<p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resource to instantiate and execute at runtime.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayer-property-blackboard"><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>blackboard</strong> <a class="reference internal" href="#class-btplayer-property-blackboard"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_blackboard</strong>(value: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>get_blackboard</strong>()</p></li>
</ul>
<p>Holds data shared by the behavior tree tasks. See <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayer-property-blackboard-plan"><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>blackboard_plan</strong> <a class="reference internal" href="#class-btplayer-property-blackboard-plan"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_blackboard_plan</strong>(value: <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>get_blackboard_plan</strong>()</p></li>
</ul>
<p>Stores and manages variables that will be used in constructing new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> instances.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayer-property-monitor-performance"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>monitor_performance</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btplayer-property-monitor-performance"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_monitor_performance</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_monitor_performance</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, adds a performance monitor to “Debugger-&gt;Monitors” for each instance of this <strong>BTPlayer</strong> node.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayer-property-update-mode"><a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>update_mode</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-btplayer-property-update-mode"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_update_mode</strong>(value: <a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a>)</p></li>
<li><p><a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>get_update_mode</strong>()</p></li>
</ul>
<p>Determines when the behavior tree is executed. See <a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-btplayer-method-get-bt-instance"><a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a> <strong>get_bt_instance</strong>() <a class="reference internal" href="#class-btplayer-method-get-bt-instance"><span class="std std-ref">🔗</span></a></p>
<p>Returns the behavior tree instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btplayer-method-restart"><abbr title="No return value.">void</abbr> <strong>restart</strong>() <a class="reference internal" href="#class-btplayer-method-restart"><span class="std std-ref">🔗</span></a></p>
<p>Resets the behavior tree’s execution. Each running task will be aborted and the next tree execution will start anew. This method does not reset <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btplayer-method-set-bt-instance"><abbr title="No return value.">void</abbr> <strong>set_bt_instance</strong>(bt_instance: <a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a>) <a class="reference internal" href="#class-btplayer-method-set-bt-instance"><span class="std std-ref">🔗</span></a></p>
<p>Sets the <a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a> to play. This method is useful when you want to switch to a different behavior tree instance at runtime. See also <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree-method-instantiate"><span class="std std-ref">BehaviorTree.instantiate</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btplayer-method-set-scene-root-hint"><abbr title="No return value.">void</abbr> <strong>set_scene_root_hint</strong>(scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>) <a class="reference internal" href="#class-btplayer-method-set-scene-root-hint"><span class="std std-ref">🔗</span></a></p>
<p>Sets the <code class="docutils literal notranslate"><span class="pre">Node</span></code> that will be used as the scene root for the newly instantiated behavior tree. Should be called before the <strong>BTPlayer</strong> is added to the scene tree (before <code class="docutils literal notranslate"><span class="pre">NOTIFICATION_READY</span></code>). This is typically useful when creating <strong>BTPlayer</strong> nodes dynamically from code.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btplayer-method-update"><abbr title="No return value.">void</abbr> <strong>update</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-btplayer-method-update"><span class="std std-ref">🔗</span></a></p>
<p>Executes the root task of the behavior tree instance if <a class="reference internal" href="#class-btplayer-property-active"><span class="std std-ref">active</span></a> is <code class="docutils literal notranslate"><span class="pre">true</span></code>. Call this method when <a class="reference internal" href="#class-btplayer-property-update-mode"><span class="std std-ref">update_mode</span></a> is set to <a class="reference internal" href="#class-btplayer-constant-manual"><span class="std std-ref">MANUAL</span></a>. When <a class="reference internal" href="#class-btplayer-property-update-mode"><span class="std std-ref">update_mode</span></a> is not <a class="reference internal" href="#class-btplayer-constant-manual"><span class="std std-ref">MANUAL</span></a>, the <a class="reference internal" href="#class-btplayer-method-update"><span class="std std-ref">update</span></a> will be called automatically. See <a class="reference internal" href="#enum-btplayer-updatemode"><span class="std std-ref">UpdateMode</span></a>.</p>
</section>
</section>
<span id="document-classes/class_blackboard"></span><section id="blackboard">
<span id="class-blackboard"></span><h3>Blackboard<a class="headerlink" href="#blackboard" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong></p>
<p>A key/value storage for sharing among <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> states and <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks.</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p>Blackboard is where data is stored and shared between states in the <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> system and tasks in a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>. Each state and task in the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> can access this Blackboard, allowing them to read and write data. This makes it easy to share information between different actions and behaviors.</p>
<p>Blackboard can also act as a parent scope for another Blackboard. If a specific variable is not found in the active scope, it looks in the parent Blackboard to find it. A parent Blackboard can itself have its own parent scope, forming what we call a “blackboard scope chain.” Importantly, there is no limit to how many Blackboards can be in this chain, and the Blackboard doesn’t modify values in the parent scopes.</p>
<p>New scopes can be created using the <a class="reference internal" href="#document-classes/class_btnewscope#class-btnewscope"><span class="std std-ref">BTNewScope</span></a> and <a class="reference internal" href="#document-classes/class_btsubtree#class-btsubtree"><span class="std std-ref">BTSubtree</span></a> decorators. Additionally, a new scope is automatically created for any <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> that has defined non-empty Blackboard data or for any root-level <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> node.</p>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-bind-var-to-property"><span class="std std-ref">bind_var_to_property</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, object: <code class="docutils literal notranslate"><span class="pre">Object</span></code>, property: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, create: <code class="docutils literal notranslate"><span class="pre">bool</span></code> = false)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-clear"><span class="std std-ref">clear</span></a>()</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-erase-var"><span class="std std-ref">erase_var</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-get-parent"><span class="std std-ref">get_parent</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Variant</span></code></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-get-var"><span class="std std-ref">get_var</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, default: <code class="docutils literal notranslate"><span class="pre">Variant</span></code> = null, complain: <code class="docutils literal notranslate"><span class="pre">bool</span></code> = true) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Dictionary</span></code></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-get-vars-as-dict"><span class="std std-ref">get_vars_as_dict</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-has-var"><span class="std std-ref">has_var</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-link-var"><span class="std std-ref">link_var</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, target_blackboard: <a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a>, target_var: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, create: <code class="docutils literal notranslate"><span class="pre">bool</span></code> = false)</p></td>
</tr>
<tr class="row-odd"><td><p><span class="xref std std-ref">Array</span>[<code class="docutils literal notranslate"><span class="pre">StringName</span></code>]</p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-list-vars"><span class="std std-ref">list_vars</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-populate-from-dict"><span class="std std-ref">populate_from_dict</span></a>(dictionary: <code class="docutils literal notranslate"><span class="pre">Dictionary</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-print-state"><span class="std std-ref">print_state</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-set-parent"><span class="std std-ref">set_parent</span></a>(blackboard: <a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-set-var"><span class="std std-ref">set_var</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, value: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-top"><span class="std std-ref">top</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboard-method-unbind-var"><span class="std std-ref">unbind_var</span></a>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-blackboard-method-bind-var-to-property"><abbr title="No return value.">void</abbr> <strong>bind_var_to_property</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, object: <code class="docutils literal notranslate"><span class="pre">Object</span></code>, property: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, create: <code class="docutils literal notranslate"><span class="pre">bool</span></code> = false) <a class="reference internal" href="#class-blackboard-method-bind-var-to-property"><span class="std std-ref">🔗</span></a></p>
<p>Establish a binding between a variable and the object’s property specified by <code class="docutils literal notranslate"><span class="pre">property</span></code> and <code class="docutils literal notranslate"><span class="pre">object</span></code>. Changes to the variable update the property, and vice versa. If <code class="docutils literal notranslate"><span class="pre">create</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, the variable will be created if it doesn’t exist.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-clear"><abbr title="No return value.">void</abbr> <strong>clear</strong>() <a class="reference internal" href="#class-blackboard-method-clear"><span class="std std-ref">🔗</span></a></p>
<p>Removes all variables from the Blackboard. Parent scopes are not affected.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-erase-var"><abbr title="No return value.">void</abbr> <strong>erase_var</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <a class="reference internal" href="#class-blackboard-method-erase-var"><span class="std std-ref">🔗</span></a></p>
<p>Removes a variable by its name.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-get-parent"><a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>get_parent</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-get-parent"><span class="std std-ref">🔗</span></a></p>
<p>Returns a Blackboard that serves as the parent scope for this instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-get-var"><code class="docutils literal notranslate"><span class="pre">Variant</span></code> <strong>get_var</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, default: <code class="docutils literal notranslate"><span class="pre">Variant</span></code> = null, complain: <code class="docutils literal notranslate"><span class="pre">bool</span></code> = true) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-get-var"><span class="std std-ref">🔗</span></a></p>
<p>Returns variable value or <code class="docutils literal notranslate"><span class="pre">default</span></code> if variable doesn’t exist. If <code class="docutils literal notranslate"><span class="pre">complain</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, an error will be printed if variable doesn’t exist. If the variable doesn’t exist in the current <strong>Blackboard</strong> scope, it will look in the parent scope <strong>Blackboard</strong> to find it.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-get-vars-as-dict"><code class="docutils literal notranslate"><span class="pre">Dictionary</span></code> <strong>get_vars_as_dict</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-get-vars-as-dict"><span class="std std-ref">🔗</span></a></p>
<p>Returns all variables in the Blackboard as a dictionary. Keys are the variable names, values are the variable values. Parent scopes are not included.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-has-var"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>has_var</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-has-var"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the Blackboard contains the <code class="docutils literal notranslate"><span class="pre">var_name</span></code> variable, including the parent scopes.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-link-var"><abbr title="No return value.">void</abbr> <strong>link_var</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, target_blackboard: <a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a>, target_var: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, create: <code class="docutils literal notranslate"><span class="pre">bool</span></code> = false) <a class="reference internal" href="#class-blackboard-method-link-var"><span class="std std-ref">🔗</span></a></p>
<p>Links a variable to another Blackboard variable. If a variable is linked to another variable, their state will always be identical, and any change to one will be reflected in the other. If <code class="docutils literal notranslate"><span class="pre">create</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, the variable will be created if it doesn’t exist.</p>
<p>You can use this method to link a variable in the current scope to a variable in another scope, or in another Blackboard instance. A variable can only be linked to one other variable. Calling this method again will overwrite the previous link. However, it is possible to link to the same variable from multiple different variables.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-list-vars"><span class="xref std std-ref">Array</span>[<code class="docutils literal notranslate"><span class="pre">StringName</span></code>] <strong>list_vars</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-list-vars"><span class="std std-ref">🔗</span></a></p>
<p>Returns all variable names in the Blackboard. Parent scopes are not included.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-populate-from-dict"><abbr title="No return value.">void</abbr> <strong>populate_from_dict</strong>(dictionary: <code class="docutils literal notranslate"><span class="pre">Dictionary</span></code>) <a class="reference internal" href="#class-blackboard-method-populate-from-dict"><span class="std std-ref">🔗</span></a></p>
<p>Fills the Blackboard with multiple variables from a dictionary. The dictionary keys must be variable names and the dictionary values must be variable values. Keys must be StringName or String.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-print-state"><abbr title="No return value.">void</abbr> <strong>print_state</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-print-state"><span class="std std-ref">🔗</span></a></p>
<p>Prints the values of all variables in each scope.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-set-parent"><abbr title="No return value.">void</abbr> <strong>set_parent</strong>(blackboard: <a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a>) <a class="reference internal" href="#class-blackboard-method-set-parent"><span class="std std-ref">🔗</span></a></p>
<p>Assigns the parent scope. If a value isn’t in the current Blackboard scope, it will look in the parent scope Blackboard to find it.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-set-var"><abbr title="No return value.">void</abbr> <strong>set_var</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, value: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>) <a class="reference internal" href="#class-blackboard-method-set-var"><span class="std std-ref">🔗</span></a></p>
<p>Assigns a value to a variable in the current Blackboard scope. If the variable doesn’t exist, it will be created. If the variable already exists in the parent scope, the parent scope value will NOT be changed.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-top"><a class="reference internal" href="#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>top</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboard-method-top"><span class="std std-ref">🔗</span></a></p>
<p>Returns the topmost <strong>Blackboard</strong> in the scope chain.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboard-method-unbind-var"><abbr title="No return value.">void</abbr> <strong>unbind_var</strong>(var_name: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <a class="reference internal" href="#class-blackboard-method-unbind-var"><span class="std std-ref">🔗</span></a></p>
<p>Remove binding from a variable.</p>
</section>
</section>
<span id="document-classes/class_bbparam"></span><section id="bbparam">
<span id="class-bbparam"></span><h3>BBParam<a class="headerlink" href="#bbparam" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_bbaabb#class-bbaabb"><span class="std std-ref">BBAabb</span></a>, <a class="reference internal" href="#document-classes/class_bbarray#class-bbarray"><span class="std std-ref">BBArray</span></a>, <a class="reference internal" href="#document-classes/class_bbbasis#class-bbbasis"><span class="std std-ref">BBBasis</span></a>, <a class="reference internal" href="#document-classes/class_bbbool#class-bbbool"><span class="std std-ref">BBBool</span></a>, <a class="reference internal" href="#document-classes/class_bbbytearray#class-bbbytearray"><span class="std std-ref">BBByteArray</span></a>, <a class="reference internal" href="#document-classes/class_bbcolor#class-bbcolor"><span class="std std-ref">BBColor</span></a>, <a class="reference internal" href="#document-classes/class_bbcolorarray#class-bbcolorarray"><span class="std std-ref">BBColorArray</span></a>, <a class="reference internal" href="#document-classes/class_bbdictionary#class-bbdictionary"><span class="std std-ref">BBDictionary</span></a>, <a class="reference internal" href="#document-classes/class_bbfloat#class-bbfloat"><span class="std std-ref">BBFloat</span></a>, <a class="reference internal" href="#document-classes/class_bbfloat32array#class-bbfloat32array"><span class="std std-ref">BBFloat32Array</span></a>, <a class="reference internal" href="#document-classes/class_bbfloat64array#class-bbfloat64array"><span class="std std-ref">BBFloat64Array</span></a>, <a class="reference internal" href="#document-classes/class_bbint#class-bbint"><span class="std std-ref">BBInt</span></a>, <a class="reference internal" href="#document-classes/class_bbint32array#class-bbint32array"><span class="std std-ref">BBInt32Array</span></a>, <a class="reference internal" href="#document-classes/class_bbint64array#class-bbint64array"><span class="std std-ref">BBInt64Array</span></a>, <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>, <a class="reference internal" href="#document-classes/class_bbplane#class-bbplane"><span class="std std-ref">BBPlane</span></a>, <a class="reference internal" href="#document-classes/class_bbprojection#class-bbprojection"><span class="std std-ref">BBProjection</span></a>, <a class="reference internal" href="#document-classes/class_bbquaternion#class-bbquaternion"><span class="std std-ref">BBQuaternion</span></a>, <a class="reference internal" href="#document-classes/class_bbrect2#class-bbrect2"><span class="std std-ref">BBRect2</span></a>, <a class="reference internal" href="#document-classes/class_bbrect2i#class-bbrect2i"><span class="std std-ref">BBRect2i</span></a>, <a class="reference internal" href="#document-classes/class_bbstring#class-bbstring"><span class="std std-ref">BBString</span></a>, <a class="reference internal" href="#document-classes/class_bbstringarray#class-bbstringarray"><span class="std std-ref">BBStringArray</span></a>, <a class="reference internal" href="#document-classes/class_bbstringname#class-bbstringname"><span class="std std-ref">BBStringName</span></a>, <a class="reference internal" href="#document-classes/class_bbtransform2d#class-bbtransform2d"><span class="std std-ref">BBTransform2D</span></a>, <a class="reference internal" href="#document-classes/class_bbtransform3d#class-bbtransform3d"><span class="std std-ref">BBTransform3D</span></a>, <a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>, <a class="reference internal" href="#document-classes/class_bbvector2#class-bbvector2"><span class="std std-ref">BBVector2</span></a>, <a class="reference internal" href="#document-classes/class_bbvector2array#class-bbvector2array"><span class="std std-ref">BBVector2Array</span></a>, <a class="reference internal" href="#document-classes/class_bbvector2i#class-bbvector2i"><span class="std std-ref">BBVector2i</span></a>, <a class="reference internal" href="#document-classes/class_bbvector3#class-bbvector3"><span class="std std-ref">BBVector3</span></a>, <a class="reference internal" href="#document-classes/class_bbvector3array#class-bbvector3array"><span class="std std-ref">BBVector3Array</span></a>, <a class="reference internal" href="#document-classes/class_bbvector3i#class-bbvector3i"><span class="std std-ref">BBVector3i</span></a>, <a class="reference internal" href="#document-classes/class_bbvector4#class-bbvector4"><span class="std std-ref">BBVector4</span></a>, <a class="reference internal" href="#document-classes/class_bbvector4i#class-bbvector4i"><span class="std std-ref">BBVector4i</span></a></p>
<p>A base class for LimboAI typed parameters.</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p>A base class for LimboAI typed parameters, with the ability to reference a <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variable or hold a raw value of a specific <span class="xref std std-ref">Variant.Type</span>.</p>
<p><strong>Note</strong>: Don’t instantiate. Use specific subtypes instead.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h4>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Variant</span></code></p></td>
<td><p><a class="reference internal" href="#class-bbparam-property-saved-value"><span class="std std-ref">saved_value</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">null</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a></p></td>
<td><p><a class="reference internal" href="#class-bbparam-property-value-source"><span class="std std-ref">value_source</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-bbparam-property-variable"><span class="std std-ref">variable</span></a></p></td>
<td></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><span class="xref std std-ref">Variant.Type</span></p></td>
<td><p><a class="reference internal" href="#class-bbparam-method-get-type"><span class="std std-ref">get_type</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Variant</span></code></p></td>
<td><p><a class="reference internal" href="#class-bbparam-method-get-value"><span class="std std-ref">get_value</span></a>(scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, default: <code class="docutils literal notranslate"><span class="pre">Variant</span></code> = null)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="enumerations">
<h4>Enumerations<a class="headerlink" href="#enumerations" title="Link to this heading"></a></h4>
<p class="classref-enumeration" id="enum-bbparam-valuesource">enum <strong>ValueSource</strong>: <a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-bbparam-constant-saved-value"><a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a> <strong>SAVED_VALUE</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>The value is stored directly within the BBParam resource.</p>
<p class="classref-enumeration-constant" id="class-bbparam-constant-blackboard-var"><a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a> <strong>BLACKBOARD_VAR</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>The value is referenced by a variable name and retrieved from the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>. The variable name is stored within the BBParam resource.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h4>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h4>
<p class="classref-property" id="class-bbparam-property-saved-value"><code class="docutils literal notranslate"><span class="pre">Variant</span></code> <strong>saved_value</strong> = <code class="docutils literal notranslate"><span class="pre">null</span></code> <a class="reference internal" href="#class-bbparam-property-saved-value"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_saved_value</strong>(value: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">Variant</span></code> <strong>get_saved_value</strong>()</p></li>
</ul>
<p>Stores the parameter value when <a class="reference internal" href="#class-bbparam-property-value-source"><span class="std std-ref">value_source</span></a> is set to <a class="reference internal" href="#class-bbparam-constant-saved-value"><span class="std std-ref">SAVED_VALUE</span></a>. The data type of the value is determined by <a class="reference internal" href="#class-bbparam-method-get-type"><span class="std std-ref">get_type</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bbparam-property-value-source"><a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a> <strong>value_source</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-bbparam-property-value-source"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_value_source</strong>(value: <a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a>)</p></li>
<li><p><a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a> <strong>get_value_source</strong>()</p></li>
</ul>
<p>Specifies the source of the value for BBParam. See <a class="reference internal" href="#enum-bbparam-valuesource"><span class="std std-ref">ValueSource</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-bbparam-property-variable"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>variable</strong> <a class="reference internal" href="#class-bbparam-property-variable"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_variable</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_variable</strong>()</p></li>
</ul>
<p>Stores the name of a <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variable when <a class="reference internal" href="#class-bbparam-property-value-source"><span class="std std-ref">value_source</span></a> is set to <a class="reference internal" href="#class-bbparam-constant-blackboard-var"><span class="std std-ref">BLACKBOARD_VAR</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-bbparam-method-get-type"><span class="xref std std-ref">Variant.Type</span> <strong>get_type</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-bbparam-method-get-type"><span class="std std-ref">🔗</span></a></p>
<p>Returns the expected data type of the parameter.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-bbparam-method-get-value"><code class="docutils literal notranslate"><span class="pre">Variant</span></code> <strong>get_value</strong>(scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, default: <code class="docutils literal notranslate"><span class="pre">Variant</span></code> = null) <a class="reference internal" href="#class-bbparam-method-get-value"><span class="std std-ref">🔗</span></a></p>
<p>Returns the value of the parameter.</p>
</section>
</section>
<span id="document-classes/class_limbostate"></span><section id="limbostate">
<span id="class-limbostate"></span><h3>LimboState<a class="headerlink" href="#limbostate" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a>, <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a></p>
<p>A state node for Hierarchical State Machines (HSM).</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p>A LimboAI state node for Hierarchical State Machines (HSM).</p>
<p>You can create your state behavior by extending this class. To implement your state logic, you can override <a class="reference internal" href="#class-limbostate-private-method-enter"><span class="std std-ref">_enter</span></a>, <a class="reference internal" href="#class-limbostate-private-method-exit"><span class="std std-ref">_exit</span></a>, <a class="reference internal" href="#class-limbostate-private-method-setup"><span class="std std-ref">_setup</span></a>, and <a class="reference internal" href="#class-limbostate-private-method-update"><span class="std std-ref">_update</span></a>. Alternatively, you can delegate state implementation to external methods using the <code class="docutils literal notranslate"><span class="pre">call_on_*</span></code> methods.</p>
<p>For additional details on state machines, refer to <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h4>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-limbostate-property-event-finished"><span class="std std-ref">EVENT_FINISHED</span></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Node</span></code></p></td>
<td><p><a class="reference internal" href="#class-limbostate-property-agent"><span class="std std-ref">agent</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-property-blackboard"><span class="std std-ref">blackboard</span></a></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-property-blackboard-plan"><span class="std std-ref">blackboard_plan</span></a></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-private-method-enter"><span class="std std-ref">_enter</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-private-method-exit"><span class="std std-ref">_exit</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-private-method-setup"><span class="std std-ref">_setup</span></a>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-private-method-update"><span class="std std-ref">_update</span></a>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-add-event-handler"><span class="std std-ref">add_event_handler</span></a>(event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, handler: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-call-on-enter"><span class="std std-ref">call_on_enter</span></a>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-call-on-exit"><span class="std std-ref">call_on_exit</span></a>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-call-on-update"><span class="std std-ref">call_on_update</span></a>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-clear-guard"><span class="std std-ref">clear_guard</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-dispatch"><span class="std std-ref">dispatch</span></a>(event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, cargo: <code class="docutils literal notranslate"><span class="pre">Variant</span></code> = null)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-get-root"><span class="std std-ref">get_root</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-is-active"><span class="std std-ref">is_active</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-named"><span class="std std-ref">named</span></a>(name: <code class="docutils literal notranslate"><span class="pre">String</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbostate-method-set-guard"><span class="std std-ref">set_guard</span></a>(guard_callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="signals">
<h4>Signals<a class="headerlink" href="#signals" title="Link to this heading"></a></h4>
<p class="classref-signal" id="class-limbostate-signal-entered"><strong>entered</strong>() <a class="reference internal" href="#class-limbostate-signal-entered"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the state is entered.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-signal" id="class-limbostate-signal-exited"><strong>exited</strong>() <a class="reference internal" href="#class-limbostate-signal-exited"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the state is exited.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-signal" id="class-limbostate-signal-setup"><strong>setup</strong>() <a class="reference internal" href="#class-limbostate-signal-setup"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the state is initialized.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-signal" id="class-limbostate-signal-updated"><strong>updated</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-limbostate-signal-updated"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the state is updated.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h4>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h4>
<p class="classref-property" id="class-limbostate-property-event-finished"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>EVENT_FINISHED</strong> <a class="reference internal" href="#class-limbostate-property-event-finished"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>event_finished</strong>()</p></li>
</ul>
<p>A commonly used event that indicates that the state has finished its work.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-limbostate-property-agent"><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>agent</strong> <a class="reference internal" href="#class-limbostate-property-agent"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_agent</strong>(value: <code class="docutils literal notranslate"><span class="pre">Node</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>get_agent</strong>()</p></li>
</ul>
<p>An agent associated with the state, assigned during initialization.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-limbostate-property-blackboard"><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>blackboard</strong> <a class="reference internal" href="#class-limbostate-property-blackboard"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>get_blackboard</strong>()</p></li>
</ul>
<p>A key/value data store shared by states within the state machine to which this state belongs.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-limbostate-property-blackboard-plan"><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>blackboard_plan</strong> <a class="reference internal" href="#class-limbostate-property-blackboard-plan"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_blackboard_plan</strong>(value: <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>get_blackboard_plan</strong>()</p></li>
</ul>
<p>Stores and manages variables that will be used in constructing new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> instances.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-limbostate-private-method-enter"><abbr title="No return value.">void</abbr> <strong>_enter</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-limbostate-private-method-enter"><span class="std std-ref">🔗</span></a></p>
<p>Called when the state is entered.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-private-method-exit"><abbr title="No return value.">void</abbr> <strong>_exit</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-limbostate-private-method-exit"><span class="std std-ref">🔗</span></a></p>
<p>Called when the state is exited. This happens on a transition to another state, and when the state machine is removed from the scene tree (e.g., when the node is freed with <span class="xref std std-ref">Node.queue_free</span> or the scene changes). Due to implementation details, <a class="reference internal" href="#class-limbostate-private-method-exit"><span class="std std-ref">_exit</span></a> will not be called on <span class="xref std std-ref">Object.free</span>!</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-private-method-setup"><abbr title="No return value.">void</abbr> <strong>_setup</strong>() <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-limbostate-private-method-setup"><span class="std std-ref">🔗</span></a></p>
<p>Called once during initialization. Use this method to initialize your state.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-private-method-update"><abbr title="No return value.">void</abbr> <strong>_update</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <abbr title="This method should typically be overridden by the user to have any effect.">virtual</abbr> <a class="reference internal" href="#class-limbostate-private-method-update"><span class="std std-ref">🔗</span></a></p>
<p>Called during the update. Implement your state’s behavior with this method.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-add-event-handler"><abbr title="No return value.">void</abbr> <strong>add_event_handler</strong>(event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, handler: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>) <a class="reference internal" href="#class-limbostate-method-add-event-handler"><span class="std std-ref">🔗</span></a></p>
<p>Registers a <code class="docutils literal notranslate"><span class="pre">handler</span></code> to be called when <code class="docutils literal notranslate"><span class="pre">event</span></code> is dispatched. The handler function should have the following signature:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">func</span> <span class="n">my_event_handler</span><span class="p">(</span><span class="n">cargo</span><span class="o">=</span><span class="n">null</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">bool</span><span class="p">:</span>
</pre></div>
</div>
<p>If the handler returns <code class="docutils literal notranslate"><span class="pre">true</span></code>, the event will be consumed. Cargo is an optional parameter that can be passed to the handler. See also <a class="reference internal" href="#class-limbostate-method-dispatch"><span class="std std-ref">dispatch</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-call-on-enter"><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>call_on_enter</strong>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>) <a class="reference internal" href="#class-limbostate-method-call-on-enter"><span class="std std-ref">🔗</span></a></p>
<p>A chained method that connects the <a class="reference internal" href="#class-limbostate-signal-entered"><span class="std std-ref">entered</span></a> signal to a <code class="docutils literal notranslate"><span class="pre">callable</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-call-on-exit"><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>call_on_exit</strong>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>) <a class="reference internal" href="#class-limbostate-method-call-on-exit"><span class="std std-ref">🔗</span></a></p>
<p>A chained method that connects the <a class="reference internal" href="#class-limbostate-signal-exited"><span class="std std-ref">exited</span></a> signal to a <code class="docutils literal notranslate"><span class="pre">callable</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-call-on-update"><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>call_on_update</strong>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>) <a class="reference internal" href="#class-limbostate-method-call-on-update"><span class="std std-ref">🔗</span></a></p>
<p>A chained method that connects the <a class="reference internal" href="#class-limbostate-signal-updated"><span class="std std-ref">updated</span></a> signal to a <code class="docutils literal notranslate"><span class="pre">callable</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-clear-guard"><abbr title="No return value.">void</abbr> <strong>clear_guard</strong>() <a class="reference internal" href="#class-limbostate-method-clear-guard"><span class="std std-ref">🔗</span></a></p>
<p>Clears the guard function, removing the <code class="docutils literal notranslate"><span class="pre">Callable</span></code> previously set by <a class="reference internal" href="#class-limbostate-method-set-guard"><span class="std std-ref">set_guard</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-dispatch"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>dispatch</strong>(event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, cargo: <code class="docutils literal notranslate"><span class="pre">Variant</span></code> = null) <a class="reference internal" href="#class-limbostate-method-dispatch"><span class="std std-ref">🔗</span></a></p>
<p>Recursively dispatches a state machine event named <code class="docutils literal notranslate"><span class="pre">event</span></code> with an optional argument <code class="docutils literal notranslate"><span class="pre">cargo</span></code>. Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the event was consumed.</p>
<p>Events propagate from the leaf state to the root state, and propagation stops as soon as any state consumes the event. States will consume the event if they have a related transition or event handler. For more information on event handlers, see <a class="reference internal" href="#class-limbostate-method-add-event-handler"><span class="std std-ref">add_event_handler</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-get-root"><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>get_root</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limbostate-method-get-root"><span class="std std-ref">🔗</span></a></p>
<p>Returns the root <strong>LimboState</strong>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-is-active"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_active</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limbostate-method-is-active"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if it is currently active, meaning it is the active substate of the parent <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-named"><a class="reference internal" href="#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>named</strong>(name: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <a class="reference internal" href="#class-limbostate-method-named"><span class="std std-ref">🔗</span></a></p>
<p>A chained method for setting the name of this state.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbostate-method-set-guard"><abbr title="No return value.">void</abbr> <strong>set_guard</strong>(guard_callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>) <a class="reference internal" href="#class-limbostate-method-set-guard"><span class="std std-ref">🔗</span></a></p>
<p>Sets the guard function, which is a function called each time a transition to this state is considered. If the function returns <code class="docutils literal notranslate"><span class="pre">false</span></code>, the transition will be disallowed.</p>
</section>
</section>
<span id="document-classes/class_limbohsm"></span><section id="limbohsm">
<span id="class-limbohsm"></span><h3>LimboHSM<a class="headerlink" href="#limbohsm" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p>
<p>Event-based Hierarchical State Machine (HSM).</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p>Event-based Hierarchical State Machine (HSM) that manages <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> instances and facilitates transitions between them. LimboHSM is a <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> in itself and can also serve as a child of another LimboHSM node.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h4>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-property-anystate"><span class="std std-ref">ANYSTATE</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-property-initial-state"><span class="std std-ref">initial_state</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-property-update-mode"><span class="std std-ref">update_mode</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-add-transition"><span class="std std-ref">add_transition</span></a>(from_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, to_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, guard: <code class="docutils literal notranslate"><span class="pre">Callable</span></code> = Callable())</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-change-active-state"><span class="std std-ref">change_active_state</span></a>(state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-get-active-state"><span class="std std-ref">get_active_state</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-get-leaf-state"><span class="std std-ref">get_leaf_state</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-get-previous-active-state"><span class="std std-ref">get_previous_active_state</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-has-transition"><span class="std std-ref">has_transition</span></a>(from_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-initialize"><span class="std std-ref">initialize</span></a>(agent: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, parent_scope: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> = null)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-remove-transition"><span class="std std-ref">remove_transition</span></a>(from_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-set-active"><span class="std std-ref">set_active</span></a>(active: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-limbohsm-method-update"><span class="std std-ref">update</span></a>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="signals">
<h4>Signals<a class="headerlink" href="#signals" title="Link to this heading"></a></h4>
<p class="classref-signal" id="class-limbohsm-signal-active-state-changed"><strong>active_state_changed</strong>(current: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, previous: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>) <a class="reference internal" href="#class-limbohsm-signal-active-state-changed"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the currently active substate is switched to a different substate.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="enumerations">
<h4>Enumerations<a class="headerlink" href="#enumerations" title="Link to this heading"></a></h4>
<p class="classref-enumeration" id="enum-limbohsm-updatemode">enum <strong>UpdateMode</strong>: <a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-limbohsm-constant-idle"><a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>IDLE</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>Update the state machine during the idle process.</p>
<p class="classref-enumeration-constant" id="class-limbohsm-constant-physics"><a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>PHYSICS</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>Update the state machine during the physics process.</p>
<p class="classref-enumeration-constant" id="class-limbohsm-constant-manual"><a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>MANUAL</strong> = <code class="docutils literal notranslate"><span class="pre">2</span></code></p>
<p>Manually update the state machine by calling <a class="reference internal" href="#class-limbohsm-method-update"><span class="std std-ref">update</span></a> from a script.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h4>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h4>
<p class="classref-property" id="class-limbohsm-property-anystate"><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>ANYSTATE</strong> <a class="reference internal" href="#class-limbohsm-property-anystate"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>anystate</strong>()</p></li>
</ul>
<p>Useful for defining a transition from any state.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-limbohsm-property-initial-state"><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>initial_state</strong> <a class="reference internal" href="#class-limbohsm-property-initial-state"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_initial_state</strong>(value: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>get_initial_state</strong>()</p></li>
</ul>
<p>The substate that becomes active when the state machine is activated using the <a class="reference internal" href="#class-limbohsm-method-set-active"><span class="std std-ref">set_active</span></a> method. If not explicitly set, the first child of the LimboHSM will be considered the initial state.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-limbohsm-property-update-mode"><a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>update_mode</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-limbohsm-property-update-mode"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_update_mode</strong>(value: <a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a>)</p></li>
<li><p><a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a> <strong>get_update_mode</strong>()</p></li>
</ul>
<p>Specifies when the state machine should be updated. See <a class="reference internal" href="#enum-limbohsm-updatemode"><span class="std std-ref">UpdateMode</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-limbohsm-method-add-transition"><abbr title="No return value.">void</abbr> <strong>add_transition</strong>(from_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, to_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>, guard: <code class="docutils literal notranslate"><span class="pre">Callable</span></code> = Callable()) <a class="reference internal" href="#class-limbohsm-method-add-transition"><span class="std std-ref">🔗</span></a></p>
<p>Establishes a transition from one state to another when <code class="docutils literal notranslate"><span class="pre">event</span></code> is dispatched. Both <code class="docutils literal notranslate"><span class="pre">from_state</span></code> and <code class="docutils literal notranslate"><span class="pre">to_state</span></code> must be immediate children of this <strong>LimboHSM</strong>.</p>
<p>Optionally, a <code class="docutils literal notranslate"><span class="pre">guard</span></code> function can be specified, which must return a boolean value. If the guard function returns <code class="docutils literal notranslate"><span class="pre">false</span></code>, the transition will not occur. The guard function is called immediately before the transition is considered. For a state-wide guard function, check out <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-method-set-guard"><span class="std std-ref">LimboState.set_guard</span></a>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">func</span> <span class="n">my_guard</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="nb">bool</span><span class="p">:</span>
<span class="k">return</span> <span class="n">is_some_condition_met</span><span class="p">()</span>
</pre></div>
</div>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-change-active-state"><abbr title="No return value.">void</abbr> <strong>change_active_state</strong>(state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>) <a class="reference internal" href="#class-limbohsm-method-change-active-state"><span class="std std-ref">🔗</span></a></p>
<p>Changes the currently active substate to <code class="docutils literal notranslate"><span class="pre">state</span></code>. If <code class="docutils literal notranslate"><span class="pre">state</span></code> is already active, it will be exited and reentered.</p>
<p><code class="docutils literal notranslate"><span class="pre">state</span></code> must be a child of this <strong>LimboHSM</strong>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-get-active-state"><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>get_active_state</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limbohsm-method-get-active-state"><span class="std std-ref">🔗</span></a></p>
<p>Returns the currently active substate.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-get-leaf-state"><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>get_leaf_state</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limbohsm-method-get-leaf-state"><span class="std std-ref">🔗</span></a></p>
<p>Returns the currently active leaf state within the state machine.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-get-previous-active-state"><a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> <strong>get_previous_active_state</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limbohsm-method-get-previous-active-state"><span class="std std-ref">🔗</span></a></p>
<p>Returns the previously active substate.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-has-transition"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>has_transition</strong>(from_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limbohsm-method-has-transition"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if there is a transition from <code class="docutils literal notranslate"><span class="pre">from_state</span></code> for a given <code class="docutils literal notranslate"><span class="pre">event</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-initialize"><abbr title="No return value.">void</abbr> <strong>initialize</strong>(agent: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, parent_scope: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> = null) <a class="reference internal" href="#class-limbohsm-method-initialize"><span class="std std-ref">🔗</span></a></p>
<p>Initiates the state and calls <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-private-method-setup"><span class="std std-ref">LimboState._setup</span></a> for both itself and all substates.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-remove-transition"><abbr title="No return value.">void</abbr> <strong>remove_transition</strong>(from_state: <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a>, event: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>) <a class="reference internal" href="#class-limbohsm-method-remove-transition"><span class="std std-ref">🔗</span></a></p>
<p>Removes a transition from a state associated with specific <code class="docutils literal notranslate"><span class="pre">event</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-set-active"><abbr title="No return value.">void</abbr> <strong>set_active</strong>(active: <code class="docutils literal notranslate"><span class="pre">bool</span></code>) <a class="reference internal" href="#class-limbohsm-method-set-active"><span class="std std-ref">🔗</span></a></p>
<p>When set to <code class="docutils literal notranslate"><span class="pre">true</span></code>, switches the state to <a class="reference internal" href="#class-limbohsm-property-initial-state"><span class="std std-ref">initial_state</span></a> and activates state processing according to <a class="reference internal" href="#class-limbohsm-property-update-mode"><span class="std std-ref">update_mode</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limbohsm-method-update"><abbr title="No return value.">void</abbr> <strong>update</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-limbohsm-method-update"><span class="std std-ref">🔗</span></a></p>
<p>Calls <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-private-method-update"><span class="std std-ref">LimboState._update</span></a> on itself and the active substate, with the call cascading down to the leaf state. This method is automatically triggered if <a class="reference internal" href="#class-limbohsm-property-update-mode"><span class="std std-ref">update_mode</span></a> is not set to <a class="reference internal" href="#class-limbohsm-constant-manual"><span class="std std-ref">MANUAL</span></a>.</p>
</section>
</section>
<span id="document-classes/class_btstate"></span><section id="btstate">
<span id="class-btstate"></span><h3>BTState<a class="headerlink" href="#btstate" title="Link to this heading"></a></h3>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a></p>
<p>A state node for <a class="reference internal" href="#document-classes/class_limbohsm#class-limbohsm"><span class="std std-ref">LimboHSM</span></a> that hosts a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
<section class="classref-introduction-group" id="description">
<h4>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h4>
<p>BTState is a <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate"><span class="std std-ref">LimboState</span></a> node that manages a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> to provide behavior logic for the state. It instantiates and runs the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resource, dispatching a state machine event upon <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. Event names are customizable through <a class="reference internal" href="#class-btstate-property-success-event"><span class="std std-ref">success_event</span></a> and <a class="reference internal" href="#class-btstate-property-failure-event"><span class="std std-ref">failure_event</span></a>. For further details on state machine events, see <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-method-dispatch"><span class="std std-ref">LimboState.dispatch</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h4>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a></p></td>
<td><p><a class="reference internal" href="#class-btstate-property-behavior-tree"><span class="std std-ref">behavior_tree</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btstate-property-failure-event"><span class="std std-ref">failure_event</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;failure&quot;</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btstate-property-monitor-performance"><span class="std std-ref">monitor_performance</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btstate-property-success-event"><span class="std std-ref">success_event</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;success&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h4>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h4>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a></p></td>
<td><p><a class="reference internal" href="#class-btstate-method-get-bt-instance"><span class="std std-ref">get_bt_instance</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btstate-method-set-scene-root-hint"><span class="std std-ref">set_scene_root_hint</span></a>(scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h4>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h4>
<p class="classref-property" id="class-btstate-property-behavior-tree"><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>behavior_tree</strong> <a class="reference internal" href="#class-btstate-property-behavior-tree"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_behavior_tree</strong>(value: <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>get_behavior_tree</strong>()</p></li>
</ul>
<p>A <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resource that defines state behavior.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btstate-property-failure-event"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>failure_event</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;failure&quot;</span></code> <a class="reference internal" href="#class-btstate-property-failure-event"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_failure_event</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_failure_event</strong>()</p></li>
</ul>
<p>HSM event that will be dispatched when the behavior tree results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. See <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-method-dispatch"><span class="std std-ref">LimboState.dispatch</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btstate-property-monitor-performance"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>monitor_performance</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btstate-property-monitor-performance"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_monitor_performance</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_monitor_performance</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, adds a performance monitor to “Debugger-&gt;Monitors” for each instance of this <strong>BTState</strong> node.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btstate-property-success-event"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>success_event</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;success&quot;</span></code> <a class="reference internal" href="#class-btstate-property-success-event"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_success_event</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_success_event</strong>()</p></li>
</ul>
<p>HSM event that will be dispatched when the behavior tree results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. See <a class="reference internal" href="#document-classes/class_limbostate#class-limbostate-method-dispatch"><span class="std std-ref">LimboState.dispatch</span></a>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h4>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h4>
<p class="classref-method" id="class-btstate-method-get-bt-instance"><a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a> <strong>get_bt_instance</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btstate-method-get-bt-instance"><span class="std std-ref">🔗</span></a></p>
<p>Returns the behavior tree instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btstate-method-set-scene-root-hint"><abbr title="No return value.">void</abbr> <strong>set_scene_root_hint</strong>(scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>) <a class="reference internal" href="#class-btstate-method-set-scene-root-hint"><span class="std std-ref">🔗</span></a></p>
<p>Sets the <code class="docutils literal notranslate"><span class="pre">Node</span></code> that will be used as the scene root for the newly instantiated behavior tree. Should be called before the state machine is initialized. This is typically useful when creating <strong>BTState</strong> nodes dynamically from code.</p>
</section>
</section>
</div>
<p>Full class reference is available in the side bar.</p>
</section>
<span id="document-classes/class_bbaabb"></span><section id="bbaabb">
<span id="class-bbaabb"></span><h2>BBAabb<a class="headerlink" href="#bbaabb" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>AABB-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbarray"></span><section id="bbarray">
<span id="class-bbarray"></span><h2>BBArray<a class="headerlink" href="#bbarray" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbbasis"></span><section id="bbbasis">
<span id="class-bbbasis"></span><h2>BBBasis<a class="headerlink" href="#bbbasis" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Basis-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbbool"></span><section id="bbbool">
<span id="class-bbbool"></span><h2>BBBool<a class="headerlink" href="#bbbool" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Bool-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbbytearray"></span><section id="bbbytearray">
<span id="class-bbbytearray"></span><h2>BBByteArray<a class="headerlink" href="#bbbytearray" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>ByteArray-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbcolor"></span><section id="bbcolor">
<span id="class-bbcolor"></span><h2>BBColor<a class="headerlink" href="#bbcolor" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Color-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbcolorarray"></span><section id="bbcolorarray">
<span id="class-bbcolorarray"></span><h2>BBColorArray<a class="headerlink" href="#bbcolorarray" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>ColorArray-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbdictionary"></span><section id="bbdictionary">
<span id="class-bbdictionary"></span><h2>BBDictionary<a class="headerlink" href="#bbdictionary" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Dictionary-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbfloat"></span><section id="bbfloat">
<span id="class-bbfloat"></span><h2>BBFloat<a class="headerlink" href="#bbfloat" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Float-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbfloat32array"></span><section id="bbfloat32array">
<span id="class-bbfloat32array"></span><h2>BBFloat32Array<a class="headerlink" href="#bbfloat32array" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>PackedFloat32Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbfloat64array"></span><section id="bbfloat64array">
<span id="class-bbfloat64array"></span><h2>BBFloat64Array<a class="headerlink" href="#bbfloat64array" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>PackedFloat64Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbint"></span><section id="bbint">
<span id="class-bbint"></span><h2>BBInt<a class="headerlink" href="#bbint" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Integer-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbint32array"></span><section id="bbint32array">
<span id="class-bbint32array"></span><h2>BBInt32Array<a class="headerlink" href="#bbint32array" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>PackedInt32Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbint64array"></span><section id="bbint64array">
<span id="class-bbint64array"></span><h2>BBInt64Array<a class="headerlink" href="#bbint64array" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>PackedInt64Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbnode"></span><section id="bbnode">
<span id="class-bbnode"></span><h2>BBNode<a class="headerlink" href="#bbnode" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Node-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Node-type parameter intended for use with <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
<p>If the source is a blackboard variable, it allows any type extended from <code class="docutils literal notranslate"><span class="pre">Object</span></code>.</p>
</section>
</section>
<span id="document-classes/class_bbplane"></span><section id="bbplane">
<span id="class-bbplane"></span><h2>BBPlane<a class="headerlink" href="#bbplane" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Plane-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbprojection"></span><section id="bbprojection">
<span id="class-bbprojection"></span><h2>BBProjection<a class="headerlink" href="#bbprojection" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Projection-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbquaternion"></span><section id="bbquaternion">
<span id="class-bbquaternion"></span><h2>BBQuaternion<a class="headerlink" href="#bbquaternion" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Quaternion-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbrect2"></span><section id="bbrect2">
<span id="class-bbrect2"></span><h2>BBRect2<a class="headerlink" href="#bbrect2" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Rect2-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbrect2i"></span><section id="bbrect2i">
<span id="class-bbrect2i"></span><h2>BBRect2i<a class="headerlink" href="#bbrect2i" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Rect2i-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbstring"></span><section id="bbstring">
<span id="class-bbstring"></span><h2>BBString<a class="headerlink" href="#bbstring" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>String-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbstringarray"></span><section id="bbstringarray">
<span id="class-bbstringarray"></span><h2>BBStringArray<a class="headerlink" href="#bbstringarray" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>StringArray-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbstringname"></span><section id="bbstringname">
<span id="class-bbstringname"></span><h2>BBStringName<a class="headerlink" href="#bbstringname" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>StringName-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbtransform2d"></span><section id="bbtransform2d">
<span id="class-bbtransform2d"></span><h2>BBTransform2D<a class="headerlink" href="#bbtransform2d" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Transform2D-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbtransform3d"></span><section id="bbtransform3d">
<span id="class-bbtransform3d"></span><h2>BBTransform3D<a class="headerlink" href="#bbtransform3d" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Transform3D-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvariant"></span><section id="bbvariant">
<span id="class-bbvariant"></span><h2>BBVariant<a class="headerlink" href="#bbvariant" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Variant-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Variant-type parameter intended for use with <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
<p>The data type is specified by <a class="reference internal" href="#class-bbvariant-property-type"><span class="std std-ref">type</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><span class="xref std std-ref">Variant.Type</span></p></td>
<td><p><a class="reference internal" href="#class-bbvariant-property-type"><span class="std std-ref">type</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-bbvariant-property-type"><span class="xref std std-ref">Variant.Type</span> <strong>type</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-bbvariant-property-type"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_type</strong>(value: <span class="xref std std-ref">Variant.Type</span>)</p></li>
<li><p><span class="xref std std-ref">Variant.Type</span> <strong>get_type</strong>()</p></li>
</ul>
<p>Specified <span class="xref std std-ref">Variant.Type</span> for the parameter value.</p>
</section>
</section>
<span id="document-classes/class_bbvector2"></span><section id="bbvector2">
<span id="class-bbvector2"></span><h2>BBVector2<a class="headerlink" href="#bbvector2" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector2-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector2array"></span><section id="bbvector2array">
<span id="class-bbvector2array"></span><h2>BBVector2Array<a class="headerlink" href="#bbvector2array" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector2Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector2i"></span><section id="bbvector2i">
<span id="class-bbvector2i"></span><h2>BBVector2i<a class="headerlink" href="#bbvector2i" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector2i-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector3"></span><section id="bbvector3">
<span id="class-bbvector3"></span><h2>BBVector3<a class="headerlink" href="#bbvector3" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector3-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector3array"></span><section id="bbvector3array">
<span id="class-bbvector3array"></span><h2>BBVector3Array<a class="headerlink" href="#bbvector3array" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector3Array-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector3i"></span><section id="bbvector3i">
<span id="class-bbvector3i"></span><h2>BBVector3i<a class="headerlink" href="#bbvector3i" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector3i-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector4"></span><section id="bbvector4">
<span id="class-bbvector4"></span><h2>BBVector4<a class="headerlink" href="#bbvector4" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector4-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_bbvector4i"></span><section id="bbvector4i">
<span id="class-bbvector4i"></span><h2>BBVector4i<a class="headerlink" href="#bbvector4i" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a></p>
<p>Vector4i-type parameter for <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> tasks. See <a class="reference internal" href="#document-classes/class_bbparam#class-bbparam"><span class="std std-ref">BBParam</span></a>.</p>
</section>
<span id="document-classes/class_behaviortree"></span><section id="behaviortree">
<span id="class-behaviortree"></span><h2>BehaviorTree<a class="headerlink" href="#behaviortree" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p>Contains Behavior Tree data.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Behavior Trees are hierarchical structures used to model and control the behavior of agents in a game (e.g., characters, enemies, entities). They are designed to make it easier to create complex and highly modular behaviors for your games.</p>
<p>Behavior Trees are composed of tasks that represent specific actions or decision-making rules. Tasks can be broadly categorized into two main types: control tasks and leaf tasks. Control tasks determine the execution flow within the tree. They include <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a>, <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a>, and <a class="reference internal" href="#document-classes/class_btinvert#class-btinvert"><span class="std std-ref">BTInvert</span></a>. Leaf tasks represent specific actions to perform, like moving or attacking, or conditions that need to be checked. The <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> class provides the foundation for various building blocks of the Behavior Trees. BT tasks can share data with the help of <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>. See <a class="reference internal" href="#document-classes/class_bttask#class-bttask-property-blackboard"><span class="std std-ref">BTTask.blackboard</span></a> and <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.</p>
<p><strong>Note:</strong> To create your own actions, extend the <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> class.</p>
<p>The BehaviorTree is executed from the root task and follows the rules specified by the control tasks, all the way down to the leaf tasks, which represent the actual actions that the agent should perform or conditions that should be checked. Each task returns a status when it is executed. It can be <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. These statuses determine how the tree progresses. They are defined in <a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a>.</p>
<p>Behavior Trees handle conditional logic using condition tasks. These tasks check for specific conditions and return either <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> based on the state of the agent or its environment (e.g., “IsLowOnHealth”, “IsTargetInSight”). Conditions can be used together with <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a> and <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a> to craft your decision-making logic.</p>
<p><strong>Note</strong>: To create your own conditions, extend the <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a> class.</p>
<p>Check out the <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> class, which provides the foundation for various building blocks of Behavior Trees.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-property-blackboard-plan"><span class="std std-ref">blackboard_plan</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-property-description"><span class="std std-ref">description</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-method-clone"><span class="std std-ref">clone</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-method-copy-other"><span class="std std-ref">copy_other</span></a>(other: <a class="reference internal" href="#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-method-get-root-task"><span class="std std-ref">get_root_task</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-method-instantiate"><span class="std std-ref">instantiate</span></a>(agent: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, instance_owner: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, custom_scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code> = null) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-behaviortree-method-set-root-task"><span class="std std-ref">set_root_task</span></a>(task: <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="signals">
<h3>Signals<a class="headerlink" href="#signals" title="Link to this heading"></a></h3>
<p class="classref-signal" id="class-behaviortree-signal-plan-changed"><strong>plan_changed</strong>() <a class="reference internal" href="#class-behaviortree-signal-plan-changed"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> changes.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-behaviortree-property-blackboard-plan"><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>blackboard_plan</strong> <a class="reference internal" href="#class-behaviortree-property-blackboard-plan"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_blackboard_plan</strong>(value: <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>get_blackboard_plan</strong>()</p></li>
</ul>
<p>Stores and manages variables that will be used in constructing new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> instances.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-behaviortree-property-description"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>description</strong> = <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code> <a class="reference internal" href="#class-behaviortree-property-description"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_description</strong>(value: <code class="docutils literal notranslate"><span class="pre">String</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_description</strong>()</p></li>
</ul>
<p>User-provided description of the <strong>BehaviorTree</strong>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-behaviortree-method-clone"><a class="reference internal" href="#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>clone</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-behaviortree-method-clone"><span class="std std-ref">🔗</span></a></p>
<p>Makes a copy of the BehaviorTree resource.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-behaviortree-method-copy-other"><abbr title="No return value.">void</abbr> <strong>copy_other</strong>(other: <a class="reference internal" href="#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>) <a class="reference internal" href="#class-behaviortree-method-copy-other"><span class="std std-ref">🔗</span></a></p>
<p>Become a copy of another behavior tree.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-behaviortree-method-get-root-task"><a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>get_root_task</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-behaviortree-method-get-root-task"><span class="std std-ref">🔗</span></a></p>
<p>Returns the root task of the BehaviorTree resource.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-behaviortree-method-instantiate"><a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a> <strong>instantiate</strong>(agent: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, instance_owner: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, custom_scene_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code> = null) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-behaviortree-method-instantiate"><span class="std std-ref">🔗</span></a></p>
<p>Instantiates the behavior tree and returns <a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a>. <code class="docutils literal notranslate"><span class="pre">instance_owner</span></code> should be the scene node that will own the behavior tree instance. This is typically a <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer"><span class="std std-ref">BTPlayer</span></a>, <a class="reference internal" href="#document-classes/class_btstate#class-btstate"><span class="std std-ref">BTState</span></a>, or a custom player node that controls the behavior tree execution. Make sure to pass a <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> with values populated from <a class="reference internal" href="#class-behaviortree-property-blackboard-plan"><span class="std std-ref">blackboard_plan</span></a>. See also <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan-method-populate-blackboard"><span class="std std-ref">BlackboardPlan.populate_blackboard</span></a> &amp; <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan-method-create-blackboard"><span class="std std-ref">BlackboardPlan.create_blackboard</span></a>.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">custom_scene_root</span></code> is not <code class="docutils literal notranslate"><span class="pre">null</span></code>, it will be used as the scene root for the newly instantiated behavior tree; otherwise, the scene root will be set to <code class="docutils literal notranslate"><span class="pre">instance_owner.owner</span></code>. Scene root is essential for <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> instances to work properly.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-behaviortree-method-set-root-task"><abbr title="No return value.">void</abbr> <strong>set_root_task</strong>(task: <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a>) <a class="reference internal" href="#class-behaviortree-method-set-root-task"><span class="std std-ref">🔗</span></a></p>
<p>Assigns a new root task to the <strong>BehaviorTree</strong> resource.</p>
</section>
</section>
<span id="document-classes/class_behaviortreedata"></span><section id="behaviortreedata">
<span id="class-behaviortreedata"></span><h2>BehaviorTreeData<a class="headerlink" href="#behaviortreedata" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p>Represents current state of a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>This class is used by the LimboAI debugger for the serialization and deserialization of <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance data.</p>
<p>Additionally, it can be used with <a class="reference internal" href="#document-classes/class_behaviortreeview#class-behaviortreeview"><span class="std std-ref">BehaviorTreeView</span></a> to visualize the current state of a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance. It is meant to be utilized in custom in-game tools.</p>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#class-behaviortreedata"><span class="std std-ref">BehaviorTreeData</span></a></p></td>
<td><p><a class="reference internal" href="#class-behaviortreedata-method-create-from-bt-instance"><span class="std std-ref">create_from_bt_instance</span></a>(bt_instance: <a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a>) <abbr title="This method doesn't need an instance to be called, so it can be called directly using the class name.">static</abbr></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-behaviortreedata-method-create-from-bt-instance"><a class="reference internal" href="#class-behaviortreedata"><span class="std std-ref">BehaviorTreeData</span></a> <strong>create_from_bt_instance</strong>(bt_instance: <a class="reference internal" href="#document-classes/class_btinstance#class-btinstance"><span class="std std-ref">BTInstance</span></a>) <abbr title="This method doesn't need an instance to be called, so it can be called directly using the class name.">static</abbr> <a class="reference internal" href="#class-behaviortreedata-method-create-from-bt-instance"><span class="std std-ref">🔗</span></a></p>
<p>Returns current state of the <code class="docutils literal notranslate"><span class="pre">bt_instance</span></code> encoded as a <strong>BehaviorTreeData</strong>, suitable for use with <a class="reference internal" href="#document-classes/class_behaviortreeview#class-behaviortreeview"><span class="std std-ref">BehaviorTreeView</span></a>.</p>
<p>Behavior tree instance can be acquired with <a class="reference internal" href="#document-classes/class_btplayer#class-btplayer-method-get-bt-instance"><span class="std std-ref">BTPlayer.get_bt_instance</span></a>.</p>
</section>
</section>
<span id="document-classes/class_behaviortreeview"></span><section id="behaviortreeview">
<span id="class-behaviortreeview"></span><h2>BehaviorTreeView<a class="headerlink" href="#behaviortreeview" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p>Visualizes the current state of a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Visualizes the current state of a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance. See also <a class="reference internal" href="#document-classes/class_behaviortreedata#class-behaviortreedata"><span class="std std-ref">BehaviorTreeData</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-behaviortreeview-property-update-interval-msec"><span class="std std-ref">update_interval_msec</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-behaviortreeview-method-clear"><span class="std std-ref">clear</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-behaviortreeview-method-update-tree"><span class="std std-ref">update_tree</span></a>(behavior_tree_data: <a class="reference internal" href="#document-classes/class_behaviortreedata#class-behaviortreedata"><span class="std std-ref">BehaviorTreeData</span></a>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="signals">
<h3>Signals<a class="headerlink" href="#signals" title="Link to this heading"></a></h3>
<p class="classref-signal" id="class-behaviortreeview-signal-task-selected"><strong>task_selected</strong>(type_name: <code class="docutils literal notranslate"><span class="pre">String</span></code>, script_path: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <a class="reference internal" href="#class-behaviortreeview-signal-task-selected"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when a task item is selected in <strong>BehaviorTreeView</strong>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-behaviortreeview-property-update-interval-msec"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>update_interval_msec</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-behaviortreeview-property-update-interval-msec"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_update_interval_msec</strong>(value: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_update_interval_msec</strong>()</p></li>
</ul>
<p>Minimum delay between two updates (in milliseconds). Set to higher values for a lower CPU load.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-behaviortreeview-method-clear"><abbr title="No return value.">void</abbr> <strong>clear</strong>() <a class="reference internal" href="#class-behaviortreeview-method-clear"><span class="std std-ref">🔗</span></a></p>
<p>Clears the tree view.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-behaviortreeview-method-update-tree"><abbr title="No return value.">void</abbr> <strong>update_tree</strong>(behavior_tree_data: <a class="reference internal" href="#document-classes/class_behaviortreedata#class-behaviortreedata"><span class="std std-ref">BehaviorTreeData</span></a>) <a class="reference internal" href="#class-behaviortreeview-method-update-tree"><span class="std std-ref">🔗</span></a></p>
<p>Updates the representation of a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> instance. See also <a class="reference internal" href="#document-classes/class_behaviortreedata#class-behaviortreedata"><span class="std std-ref">BehaviorTreeData</span></a>.</p>
</section>
</section>
<span id="document-classes/class_blackboardplan"></span><section id="blackboardplan">
<span id="class-blackboardplan"></span><h2>BlackboardPlan<a class="headerlink" href="#blackboardplan" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p>Stores and manages variables that will be used in constructing new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> instances.</p>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-property-prefetch-nodepath-vars"><span class="std std-ref">prefetch_nodepath_vars</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-create-blackboard"><span class="std std-ref">create_blackboard</span></a>(prefetch_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, parent_scope: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> = null, prefetch_root_for_base_plan: <code class="docutils literal notranslate"><span class="pre">Node</span></code> = null)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-get-base-plan"><span class="std std-ref">get_base_plan</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Callable</span></code></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-get-parent-scope-plan-provider"><span class="std std-ref">get_parent_scope_plan_provider</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-is-derived"><span class="std std-ref">is_derived</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-populate-blackboard"><span class="std std-ref">populate_blackboard</span></a>(blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, overwrite: <code class="docutils literal notranslate"><span class="pre">bool</span></code>, prefetch_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, prefetch_root_for_base_plan: <code class="docutils literal notranslate"><span class="pre">Node</span></code> = null)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-set-base-plan"><span class="std std-ref">set_base_plan</span></a>(blackboard_plan: <a class="reference internal" href="#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a>)</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-set-parent-scope-plan-provider"><span class="std std-ref">set_parent_scope_plan_provider</span></a>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-blackboardplan-method-sync-with-base-plan"><span class="std std-ref">sync_with_base_plan</span></a>()</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-blackboardplan-property-prefetch-nodepath-vars"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>prefetch_nodepath_vars</strong> = <code class="docutils literal notranslate"><span class="pre">true</span></code> <a class="reference internal" href="#class-blackboardplan-property-prefetch-nodepath-vars"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_prefetch_nodepath_vars</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_prefetching_nodepath_vars</strong>()</p></li>
</ul>
<p>Enables or disables <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> variable prefetching. If <code class="docutils literal notranslate"><span class="pre">true</span></code>, <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> values will be replaced with node instances when the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> is created.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-blackboardplan-method-create-blackboard"><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>create_blackboard</strong>(prefetch_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, parent_scope: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> = null, prefetch_root_for_base_plan: <code class="docutils literal notranslate"><span class="pre">Node</span></code> = null) <a class="reference internal" href="#class-blackboardplan-method-create-blackboard"><span class="std std-ref">🔗</span></a></p>
<p>Constructs a new instance of a <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> using this plan. If <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> prefetching is enabled, <code class="docutils literal notranslate"><span class="pre">prefetch_root</span></code> will be used to retrieve node instances for <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> variables and substitute their values.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-get-base-plan"><a class="reference internal" href="#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>get_base_plan</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboardplan-method-get-base-plan"><span class="std std-ref">🔗</span></a></p>
<p>Returns the base plan. See <a class="reference internal" href="#class-blackboardplan-method-is-derived"><span class="std std-ref">is_derived</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-get-parent-scope-plan-provider"><code class="docutils literal notranslate"><span class="pre">Callable</span></code> <strong>get_parent_scope_plan_provider</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboardplan-method-get-parent-scope-plan-provider"><span class="std std-ref">🔗</span></a></p>
<p>Returns the parent scope plan provider - a callable that returns a <strong>BlackboardPlan</strong>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-is-derived"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_derived</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-blackboardplan-method-is-derived"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if this plan is derived from another, i.e., the base plan is not <code class="docutils literal notranslate"><span class="pre">null</span></code>. A derived plan can only contain variables that are present in the base plan, and only variable values can be different.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-populate-blackboard"><abbr title="No return value.">void</abbr> <strong>populate_blackboard</strong>(blackboard: <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>, overwrite: <code class="docutils literal notranslate"><span class="pre">bool</span></code>, prefetch_root: <code class="docutils literal notranslate"><span class="pre">Node</span></code>, prefetch_root_for_base_plan: <code class="docutils literal notranslate"><span class="pre">Node</span></code> = null) <a class="reference internal" href="#class-blackboardplan-method-populate-blackboard"><span class="std std-ref">🔗</span></a></p>
<p>Populates <code class="docutils literal notranslate"><span class="pre">blackboard</span></code> with the variables from this plan. If <code class="docutils literal notranslate"><span class="pre">overwrite</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, existing variables with the same names will be overwritten. If <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> prefetching is enabled, <code class="docutils literal notranslate"><span class="pre">prefetch_root</span></code> will be used to retrieve node instances for <code class="docutils literal notranslate"><span class="pre">NodePath</span></code> variables and substitute their values.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-set-base-plan"><abbr title="No return value.">void</abbr> <strong>set_base_plan</strong>(blackboard_plan: <a class="reference internal" href="#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a>) <a class="reference internal" href="#class-blackboardplan-method-set-base-plan"><span class="std std-ref">🔗</span></a></p>
<p>Sets the base plan. If assigned, this plan will be derived from the base plan.</p>
<p>Use with caution, as it will remove variables not present in the base plan. Only use this for custom tooling.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-set-parent-scope-plan-provider"><abbr title="No return value.">void</abbr> <strong>set_parent_scope_plan_provider</strong>(callable: <code class="docutils literal notranslate"><span class="pre">Callable</span></code>) <a class="reference internal" href="#class-blackboardplan-method-set-parent-scope-plan-provider"><span class="std std-ref">🔗</span></a></p>
<p>Sets the parent scope plan provider - a callable that returns a <strong>BlackboardPlan</strong>. Used to provide hints in the inspector. When set, mapping feature becomes available.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-blackboardplan-method-sync-with-base-plan"><abbr title="No return value.">void</abbr> <strong>sync_with_base_plan</strong>() <a class="reference internal" href="#class-blackboardplan-method-sync-with-base-plan"><span class="std std-ref">🔗</span></a></p>
<p>Synchronizes this plan with the base plan: removes variables not present in the base plan, and updates type information. Only use this for custom tooling.</p>
</section>
</section>
<span id="document-classes/class_bt"></span><section id="bt">
<span id="class-bt"></span><h2>BT<a class="headerlink" href="#bt" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a></p>
<p>Base of <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a>.</p>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="enumerations">
<h3>Enumerations<a class="headerlink" href="#enumerations" title="Link to this heading"></a></h3>
<p class="classref-enumeration" id="enum-bt-status">enum <strong>Status</strong>: <a class="reference internal" href="#enum-bt-status"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-bt-constant-fresh"><a class="reference internal" href="#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>FRESH</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>Task wasn’t executed yet or it was aborted and reset.</p>
<p class="classref-enumeration-constant" id="class-bt-constant-running"><a class="reference internal" href="#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>RUNNING</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>Task is being performed and hasn’t finished yet.</p>
<p class="classref-enumeration-constant" id="class-bt-constant-failure"><a class="reference internal" href="#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>FAILURE</strong> = <code class="docutils literal notranslate"><span class="pre">2</span></code></p>
<p>Task has finished with failure.</p>
<p class="classref-enumeration-constant" id="class-bt-constant-success"><a class="reference internal" href="#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>SUCCESS</strong> = <code class="docutils literal notranslate"><span class="pre">3</span></code></p>
<p>Task has finished with success.</p>
</section>
</section>
<span id="document-classes/class_btaction"></span><section id="btaction">
<span id="class-btaction"></span><h2>BTAction<a class="headerlink" href="#btaction" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btawaitanimation#class-btawaitanimation"><span class="std std-ref">BTAwaitAnimation</span></a>, <a class="reference internal" href="#document-classes/class_btcallmethod#class-btcallmethod"><span class="std std-ref">BTCallMethod</span></a>, <a class="reference internal" href="#document-classes/class_btconsoleprint#class-btconsoleprint"><span class="std std-ref">BTConsolePrint</span></a>, <a class="reference internal" href="#document-classes/class_btevaluateexpression#class-btevaluateexpression"><span class="std std-ref">BTEvaluateExpression</span></a>, <a class="reference internal" href="#document-classes/class_btfail#class-btfail"><span class="std std-ref">BTFail</span></a>, <a class="reference internal" href="#document-classes/class_btpauseanimation#class-btpauseanimation"><span class="std std-ref">BTPauseAnimation</span></a>, <a class="reference internal" href="#document-classes/class_btplayanimation#class-btplayanimation"><span class="std std-ref">BTPlayAnimation</span></a>, <a class="reference internal" href="#document-classes/class_btrandomwait#class-btrandomwait"><span class="std std-ref">BTRandomWait</span></a>, <a class="reference internal" href="#document-classes/class_btsetagentproperty#class-btsetagentproperty"><span class="std std-ref">BTSetAgentProperty</span></a>, <a class="reference internal" href="#document-classes/class_btsetvar#class-btsetvar"><span class="std std-ref">BTSetVar</span></a>, <a class="reference internal" href="#document-classes/class_btstopanimation#class-btstopanimation"><span class="std std-ref">BTStopAnimation</span></a>, <a class="reference internal" href="#document-classes/class_btwait#class-btwait"><span class="std std-ref">BTWait</span></a>, <a class="reference internal" href="#document-classes/class_btwaitticks#class-btwaitticks"><span class="std std-ref">BTWaitTicks</span></a></p>
<p>Base class for all <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> actions.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Base class for all actions within a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>. You can create your own actions by extending the <strong>BTAction</strong> class.</p>
<p>Represents a specific behavior or action in a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> that an agent should execute. Actions are the lowest level of the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> hierarchy and are responsible for performing the actual work required to achieve a goal. Actions do not have child tasks.</p>
<p>A single action can perform a task within one or multiple ticks. If it takes more than one tick to complete the task, the action should return <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> status. When the task is finished, the action returns either <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> to indicate the outcome.</p>
</section>
</section>
<span id="document-classes/class_btalwaysfail"></span><section id="btalwaysfail">
<span id="class-btalwaysfail"></span><h2>BTAlwaysFail<a class="headerlink" href="#btalwaysfail" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that converts <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> into <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
<span id="document-classes/class_btalwayssucceed"></span><section id="btalwayssucceed">
<span id="class-btalwayssucceed"></span><h2>BTAlwaysSucceed<a class="headerlink" href="#btalwayssucceed" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that converts <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> into <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
<span id="document-classes/class_btawaitanimation"></span><section id="btawaitanimation">
<span id="class-btawaitanimation"></span><h2>BTAwaitAnimation<a class="headerlink" href="#btawaitanimation" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that waits for an animation to finish playing.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTAwaitAnimation action waits for an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node to finish playing and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if the specified animation has finished playing or if the specified animation is not currently playing.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the specified animation doesn’t exist or if the action fails to get the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btawaitanimation-property-animation-name"><span class="std std-ref">animation_name</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btawaitanimation-property-animation-player"><span class="std std-ref">animation_player</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btawaitanimation-property-max-time"><span class="std std-ref">max_time</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btawaitanimation-property-animation-name"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>animation_name</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btawaitanimation-property-animation-name"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_name</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_animation_name</strong>()</p></li>
</ul>
<p>Animation’s key within the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btawaitanimation-property-animation-player"><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>animation_player</strong> <a class="reference internal" href="#class-btawaitanimation-property-animation-player"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_player</strong>(value: <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>get_animation_player</strong>()</p></li>
</ul>
<p>Parameter that specifies the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btawaitanimation-property-max-time"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>max_time</strong> = <code class="docutils literal notranslate"><span class="pre">1.0</span></code> <a class="reference internal" href="#class-btawaitanimation-property-max-time"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_max_time</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_max_time</strong>()</p></li>
</ul>
<p>The maximum duration to wait for the animation to complete (in seconds). If the animation doesn’t finish within this time, BTAwaitAnimation will stop waiting and return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btcallmethod"></span><section id="btcallmethod">
<span id="class-btcallmethod"></span><h2>BTCallMethod<a class="headerlink" href="#btcallmethod" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that calls a method on a specified <code class="docutils literal notranslate"><span class="pre">Node</span></code> or <code class="docutils literal notranslate"><span class="pre">Object</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTCallMethod action calls a <a class="reference internal" href="#class-btcallmethod-property-method"><span class="std std-ref">method</span></a> on the specified <code class="docutils literal notranslate"><span class="pre">Node</span></code> or <code class="docutils literal notranslate"><span class="pre">Object</span></code> instance and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the action encounters an issue during the method execution.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>]</p></td>
<td><p><a class="reference internal" href="#class-btcallmethod-property-args"><span class="std std-ref">args</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">[]</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcallmethod-property-args-include-delta"><span class="std std-ref">args_include_delta</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcallmethod-property-method"><span class="std std-ref">method</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btcallmethod-property-node"><span class="std std-ref">node</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcallmethod-property-result-var"><span class="std std-ref">result_var</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btcallmethod-property-args"><span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>] <strong>args</strong> = <code class="docutils literal notranslate"><span class="pre">[]</span></code> <a class="reference internal" href="#class-btcallmethod-property-args"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_args</strong>(value: <span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>])</p></li>
<li><p><span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>] <strong>get_args</strong>()</p></li>
</ul>
<p>The arguments to be passed when calling the method.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcallmethod-property-args-include-delta"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>args_include_delta</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btcallmethod-property-args-include-delta"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_include_delta</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_delta_included</strong>()</p></li>
</ul>
<p>Include delta as a first parameter and shift the position of the rest of the arguments if any.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcallmethod-property-method"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>method</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btcallmethod-property-method"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_method</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_method</strong>()</p></li>
</ul>
<p>The name of the method to be called.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcallmethod-property-node"><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>node</strong> <a class="reference internal" href="#class-btcallmethod-property-node"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_node_param</strong>(value: <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>get_node_param</strong>()</p></li>
</ul>
<p>Specifies the <code class="docutils literal notranslate"><span class="pre">Node</span></code> or <code class="docutils literal notranslate"><span class="pre">Object</span></code> instance containing the method to be called.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcallmethod-property-result-var"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>result_var</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btcallmethod-property-result-var"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_result_var</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_result_var</strong>()</p></li>
</ul>
<p>if non-empty, assign the result of the method call to the blackboard variable specified by this property.</p>
</section>
</section>
<span id="document-classes/class_btcheckagentproperty"></span><section id="btcheckagentproperty">
<span id="class-btcheckagentproperty"></span><h2>BTCheckAgentProperty<a class="headerlink" href="#btcheckagentproperty" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT condition that checks agent’s property value.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTCheckAgentProperty examines the agent’s property value and compares it to <a class="reference internal" href="#class-btcheckagentproperty-property-value"><span class="std std-ref">value</span></a>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> based on the <a class="reference internal" href="#class-btcheckagentproperty-property-check-type"><span class="std std-ref">check_type</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a></p></td>
<td><p><a class="reference internal" href="#class-btcheckagentproperty-property-check-type"><span class="std std-ref">check_type</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcheckagentproperty-property-property"><span class="std std-ref">property</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a></p></td>
<td><p><a class="reference internal" href="#class-btcheckagentproperty-property-value"><span class="std std-ref">value</span></a></p></td>
<td></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btcheckagentproperty-property-check-type"><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>check_type</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-btcheckagentproperty-property-check-type"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_check_type</strong>(value: <a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>get_check_type</strong>()</p></li>
</ul>
<p>The type of check to be performed.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcheckagentproperty-property-property"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>property</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btcheckagentproperty-property-property"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_property</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_property</strong>()</p></li>
</ul>
<p>Parameter that specifies the agent’s property to be compared.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcheckagentproperty-property-value"><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>value</strong> <a class="reference internal" href="#class-btcheckagentproperty-property-value"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_value</strong>(value: <a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>get_value</strong>()</p></li>
</ul>
<p>Parameter that specifies the value against which an agent’s property will be compared.</p>
</section>
</section>
<span id="document-classes/class_btchecktrigger"></span><section id="btchecktrigger">
<span id="class-btchecktrigger"></span><h2>BTCheckTrigger<a class="headerlink" href="#btchecktrigger" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT condition that checks a trigger (a boolean variable).</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p><strong>BTCheckTrigger</strong> verifies whether the <a class="reference internal" href="#class-btchecktrigger-property-variable"><span class="std std-ref">variable</span></a> is set to <code class="docutils literal notranslate"><span class="pre">true</span></code>. If it is, the task switches it to <code class="docutils literal notranslate"><span class="pre">false</span></code> and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. Otherwise, it returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p><strong>BTCheckTrigger</strong> can function as a “gate” within a <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a>: when the trigger variable is set to <code class="docutils literal notranslate"><span class="pre">true</span></code>, it permits the execution of subsequent tasks and then changes the variable to <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btchecktrigger-property-variable"><span class="std std-ref">variable</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btchecktrigger-property-variable"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>variable</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btchecktrigger-property-variable"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_variable</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_variable</strong>()</p></li>
</ul>
<p>A boolean variable on the blackboard used as a trigger. See also <a class="reference internal" href="#document-classes/class_bttask#class-bttask-property-blackboard"><span class="std std-ref">BTTask.blackboard</span></a>.</p>
<p>If variable’s value is <code class="docutils literal notranslate"><span class="pre">true</span></code>, <strong>BTCheckTrigger</strong> will switch it to <code class="docutils literal notranslate"><span class="pre">false</span></code> and return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>If variable’s value is <code class="docutils literal notranslate"><span class="pre">false</span></code>, <strong>BTCheckTrigger</strong> will return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btcheckvar"></span><section id="btcheckvar">
<span id="class-btcheckvar"></span><h2>BTCheckVar<a class="headerlink" href="#btcheckvar" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcondition#class-btcondition"><span class="std std-ref">BTCondition</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT condition that checks a variable on the blackboard.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTCheckVar evaluates the <a class="reference internal" href="#class-btcheckvar-property-variable"><span class="std std-ref">variable</span></a> against <a class="reference internal" href="#class-btcheckvar-property-value"><span class="std std-ref">value</span></a> and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> based on the <a class="reference internal" href="#class-btcheckvar-property-check-type"><span class="std std-ref">check_type</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a></p></td>
<td><p><a class="reference internal" href="#class-btcheckvar-property-check-type"><span class="std std-ref">check_type</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a></p></td>
<td><p><a class="reference internal" href="#class-btcheckvar-property-value"><span class="std std-ref">value</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcheckvar-property-variable"><span class="std std-ref">variable</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btcheckvar-property-check-type"><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>check_type</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-btcheckvar-property-check-type"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_check_type</strong>(value: <a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>get_check_type</strong>()</p></li>
</ul>
<p>The type of check to be performed.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcheckvar-property-value"><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>value</strong> <a class="reference internal" href="#class-btcheckvar-property-value"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_value</strong>(value: <a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>get_value</strong>()</p></li>
</ul>
<p>A parameter that specifies the value against which the <a class="reference internal" href="#class-btcheckvar-property-variable"><span class="std std-ref">variable</span></a> will be compared.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcheckvar-property-variable"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>variable</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btcheckvar-property-variable"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_variable</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_variable</strong>()</p></li>
</ul>
<p>The name of the variable to check its value.</p>
</section>
</section>
<span id="document-classes/class_btcomment"></span><section id="btcomment">
<span id="class-btcomment"></span><h2>BTComment<a class="headerlink" href="#btcomment" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BTComment adds annotations or explanatory notes to a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTComment is used to add annotations or explanatory notes to a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
<p>Comments are not executed as part of the tree and are removed from runtime instances of the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
</section>
</section>
<span id="document-classes/class_btcomposite"></span><section id="btcomposite">
<span id="class-btcomposite"></span><h2>BTComposite<a class="headerlink" href="#btcomposite" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btdynamicselector#class-btdynamicselector"><span class="std std-ref">BTDynamicSelector</span></a>, <a class="reference internal" href="#document-classes/class_btdynamicsequence#class-btdynamicsequence"><span class="std std-ref">BTDynamicSequence</span></a>, <a class="reference internal" href="#document-classes/class_btparallel#class-btparallel"><span class="std std-ref">BTParallel</span></a>, <a class="reference internal" href="#document-classes/class_btprobabilityselector#class-btprobabilityselector"><span class="std std-ref">BTProbabilitySelector</span></a>, <a class="reference internal" href="#document-classes/class_btrandomselector#class-btrandomselector"><span class="std std-ref">BTRandomSelector</span></a>, <a class="reference internal" href="#document-classes/class_btrandomsequence#class-btrandomsequence"><span class="std std-ref">BTRandomSequence</span></a>, <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a>, <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a></p>
<p>Base class for BT composite tasks.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Base class for all <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> composite tasks. You can create your own composite tasks by extending the BTComposite class.</p>
<p>Composite is a control task within a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> that contains one or more child tasks. It defines the structure and flow of the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> by specifying how child tasks are executed. Composites can be used to group related tasks into a single unit, making it easier to manage and maintain the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>. Examples of <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> composites include <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a>, <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a>, and <a class="reference internal" href="#document-classes/class_btparallel#class-btparallel"><span class="std std-ref">BTParallel</span></a>.</p>
</section>
</section>
<span id="document-classes/class_btcondition"></span><section id="btcondition">
<span id="class-btcondition"></span><h2>BTCondition<a class="headerlink" href="#btcondition" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btcheckagentproperty#class-btcheckagentproperty"><span class="std std-ref">BTCheckAgentProperty</span></a>, <a class="reference internal" href="#document-classes/class_btchecktrigger#class-btchecktrigger"><span class="std std-ref">BTCheckTrigger</span></a>, <a class="reference internal" href="#document-classes/class_btcheckvar#class-btcheckvar"><span class="std std-ref">BTCheckVar</span></a></p>
<p>Base class for BT conditions.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Base class for all <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> conditions. You can create your own conditions by extending the <strong>BTCondition</strong> class.</p>
<p>Condition is a task within a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> that checks for a specific condition before executing subsequent tasks. It is often used inside composite tasks to control the execution flow. Conditions are used to verify the state of the environment, check for the presence of an enemy, or evaluate the health status of the agent. The use of condition tasks in a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> can improve system efficiency and prevent unnecessary actions. However, they may not be suitable for complex decision-making processes, and too many condition tasks can make the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> difficult to read.</p>
<p>Conditions typically don’t take multiple ticks to finish and return either <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> immediately.</p>
</section>
</section>
<span id="document-classes/class_btconsoleprint"></span><section id="btconsoleprint">
<span id="class-btconsoleprint"></span><h2>BTConsolePrint<a class="headerlink" href="#btconsoleprint" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action task that outputs text to the console.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTConsolePrint action outputs text to the console and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. It can include placeholders for format arguments similar to GDScript’s % operator.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code></p></td>
<td><p><a class="reference internal" href="#class-btconsoleprint-property-bb-format-parameters"><span class="std std-ref">bb_format_parameters</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray()</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-btconsoleprint-property-text"><span class="std std-ref">text</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btconsoleprint-property-bb-format-parameters"><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> <strong>bb_format_parameters</strong> = <code class="docutils literal notranslate"><span class="pre">PackedStringArray()</span></code> <a class="reference internal" href="#class-btconsoleprint-property-bb-format-parameters"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_bb_format_parameters</strong>(value: <code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> <strong>get_bb_format_parameters</strong>()</p></li>
</ul>
<p>The values of format parameters are used as format arguments for the text that will be printed.</p>
<p><strong>Note:</strong> The returned array is <em>copied</em> and any changes to it will not update the original property value. See <code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> for more details.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btconsoleprint-property-text"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>text</strong> = <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code> <a class="reference internal" href="#class-btconsoleprint-property-text"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_text</strong>(value: <code class="docutils literal notranslate"><span class="pre">String</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_text</strong>()</p></li>
</ul>
<p>The text to be printed, which can include multiple placeholders to be substituted with format arguments. These placeholders follow the same format as GDScript’s % operator and typically start with ‘%’ followed by a format specifier. For instance: %s for string, %d for integer, %f for real.</p>
</section>
</section>
<span id="document-classes/class_btcooldown"></span><section id="btcooldown">
<span id="class-btcooldown"></span><h2>BTCooldown<a class="headerlink" href="#btcooldown" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that executes its child task only if <a class="reference internal" href="#class-btcooldown-property-duration"><span class="std std-ref">duration</span></a> time has passed since the previous execution.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTCooldown runs its child task only if <a class="reference internal" href="#class-btcooldown-property-duration"><span class="std std-ref">duration</span></a> time has passed since the last successful child task execution. It will only consider successful executions unless <a class="reference internal" href="#class-btcooldown-property-trigger-on-failure"><span class="std std-ref">trigger_on_failure</span></a> is set to <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, if the child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, if the child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, and triggers the cooldown timer.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, if the child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> or if <a class="reference internal" href="#class-btcooldown-property-duration"><span class="std std-ref">duration</span></a> time didn’t pass since the previous execution.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcooldown-property-cooldown-state-var"><span class="std std-ref">cooldown_state_var</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcooldown-property-duration"><span class="std std-ref">duration</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">10.0</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcooldown-property-process-pause"><span class="std std-ref">process_pause</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcooldown-property-start-cooled"><span class="std std-ref">start_cooled</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btcooldown-property-trigger-on-failure"><span class="std std-ref">trigger_on_failure</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btcooldown-property-cooldown-state-var"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>cooldown_state_var</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btcooldown-property-cooldown-state-var"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_cooldown_state_var</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_cooldown_state_var</strong>()</p></li>
</ul>
<p>A boolean variable used to store the cooldown state in the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>. If left empty, the variable will be automatically generated and assigned.</p>
<p>If the variable’s value is set to <code class="docutils literal notranslate"><span class="pre">true</span></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 <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcooldown-property-duration"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>duration</strong> = <code class="docutils literal notranslate"><span class="pre">10.0</span></code> <a class="reference internal" href="#class-btcooldown-property-duration"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_duration</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_duration</strong>()</p></li>
</ul>
<p>Time to wait before permitting another child’s execution.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcooldown-property-process-pause"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>process_pause</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btcooldown-property-process-pause"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_process_pause</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_process_pause</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, process cooldown when the <code class="docutils literal notranslate"><span class="pre">SceneTree</span></code> is paused.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcooldown-property-start-cooled"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>start_cooled</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btcooldown-property-start-cooled"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_start_cooled</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_start_cooled</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, initiate a cooldown as if the child had been executed before the first BT tick.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btcooldown-property-trigger-on-failure"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>trigger_on_failure</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btcooldown-property-trigger-on-failure"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_trigger_on_failure</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_trigger_on_failure</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, the cooldown will be activated if the child task also returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. Otherwise, the cooldown will only be triggered when the child task returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btdecorator"></span><section id="btdecorator">
<span id="class-btdecorator"></span><h2>BTDecorator<a class="headerlink" href="#btdecorator" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btalwaysfail#class-btalwaysfail"><span class="std std-ref">BTAlwaysFail</span></a>, <a class="reference internal" href="#document-classes/class_btalwayssucceed#class-btalwayssucceed"><span class="std std-ref">BTAlwaysSucceed</span></a>, <a class="reference internal" href="#document-classes/class_btcooldown#class-btcooldown"><span class="std std-ref">BTCooldown</span></a>, <a class="reference internal" href="#document-classes/class_btdelay#class-btdelay"><span class="std std-ref">BTDelay</span></a>, <a class="reference internal" href="#document-classes/class_btforeach#class-btforeach"><span class="std std-ref">BTForEach</span></a>, <a class="reference internal" href="#document-classes/class_btinvert#class-btinvert"><span class="std std-ref">BTInvert</span></a>, <a class="reference internal" href="#document-classes/class_btnewscope#class-btnewscope"><span class="std std-ref">BTNewScope</span></a>, <a class="reference internal" href="#document-classes/class_btprobability#class-btprobability"><span class="std std-ref">BTProbability</span></a>, <a class="reference internal" href="#document-classes/class_btrepeat#class-btrepeat"><span class="std std-ref">BTRepeat</span></a>, <a class="reference internal" href="#document-classes/class_btrepeatuntilfailure#class-btrepeatuntilfailure"><span class="std std-ref">BTRepeatUntilFailure</span></a>, <a class="reference internal" href="#document-classes/class_btrepeatuntilsuccess#class-btrepeatuntilsuccess"><span class="std std-ref">BTRepeatUntilSuccess</span></a>, <a class="reference internal" href="#document-classes/class_btrunlimit#class-btrunlimit"><span class="std std-ref">BTRunLimit</span></a>, <a class="reference internal" href="#document-classes/class_bttimelimit#class-bttimelimit"><span class="std std-ref">BTTimeLimit</span></a></p>
<p>Base class for BT decorators.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Base class for all <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> decorators. You can create your own decorators by extending the BTDecorator class.</p>
<p>A decorator is a task within a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> that alters the behavior of its child task. Decorators can have only one child task.</p>
<p>Decorators can be used to add conditions, limits, or other constraints to the execution of a task. Examples of <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> decorators include <a class="reference internal" href="#document-classes/class_btinvert#class-btinvert"><span class="std std-ref">BTInvert</span></a>, <a class="reference internal" href="#document-classes/class_btrepeat#class-btrepeat"><span class="std std-ref">BTRepeat</span></a>, and <a class="reference internal" href="#document-classes/class_btcooldown#class-btcooldown"><span class="std std-ref">BTCooldown</span></a>. The use of <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> decorators can simplify the design and implementation of complex behaviors by adding additional logic to existing tasks.</p>
</section>
</section>
<span id="document-classes/class_btdelay"></span><section id="btdelay">
<span id="class-btdelay"></span><h2>BTDelay<a class="headerlink" href="#btdelay" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that introduces a delay before executing its child task.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTDelay introduces a delay of <a class="reference internal" href="#class-btdelay-property-seconds"><span class="std std-ref">seconds</span></a> before executing its child task. Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> during the delay period.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btdelay-property-seconds"><span class="std std-ref">seconds</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btdelay-property-seconds"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>seconds</strong> = <code class="docutils literal notranslate"><span class="pre">1.0</span></code> <a class="reference internal" href="#class-btdelay-property-seconds"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_seconds</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_seconds</strong>()</p></li>
</ul>
<p>Delay duration in seconds.</p>
</section>
</section>
<span id="document-classes/class_btdynamicselector"></span><section id="btdynamicselector">
<span id="class-btdynamicselector"></span><h2>BTDynamicSelector<a class="headerlink" href="#btdynamicselector" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that executes tasks from scratch every tick until first <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTDynamicSelector executes its child tasks sequentially, from first to last, until any child returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. Unlike <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a>, it will execute tasks from the beginning every tick, reevaluating their statuses. It is quite useful when you want to retry higher-priority behaviors in every tick.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. BTDynamicSelector will remember the last <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> child, but, unlike <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a>, on the next execution tick, it will reexecute preceding tasks and reevaluate their return statuses. If any of the preceding tasks doesn’t result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, it will abort the remembered <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> task.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if all child tasks result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btdynamicsequence"></span><section id="btdynamicsequence">
<span id="class-btdynamicsequence"></span><h2>BTDynamicSequence<a class="headerlink" href="#btdynamicsequence" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that executes tasks from scratch every tick as long as they return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTDynamicSequence executes its child tasks sequentially, from first to last, for as long as they return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. Unlike <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a>, it will execute tasks from the beginning every tick, reevaluating their statuses. It is quite useful when you want to recheck conditions preceding a long-running action during each tick and abort the <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> action when any condition results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. BTDynamicSequence will remember the last <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> child, but, unlike <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a>, on the next execution tick, it will reexecute preceding tasks and reevaluate their return statuses. If any of the preceding tasks doesn’t result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, it will abort the remembered <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> task.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if all child tasks result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btevaluateexpression"></span><section id="btevaluateexpression">
<span id="class-btevaluateexpression"></span><h2>BTEvaluateExpression<a class="headerlink" href="#btevaluateexpression" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that evaluates an <code class="docutils literal notranslate"><span class="pre">Expression</span></code> against a specified <code class="docutils literal notranslate"><span class="pre">Node</span></code> or <code class="docutils literal notranslate"><span class="pre">Object</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTEvaluateExpression action evaluates an <a class="reference internal" href="#class-btevaluateexpression-property-expression-string"><span class="std std-ref">expression_string</span></a> on the specified <code class="docutils literal notranslate"><span class="pre">Node</span></code> or <code class="docutils literal notranslate"><span class="pre">Object</span></code> instance and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> when the <code class="docutils literal notranslate"><span class="pre">Expression</span></code> executes successfully.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the action encounters an issue during the <code class="docutils literal notranslate"><span class="pre">Expression</span></code> parsing or execution.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-property-expression-string"><span class="std std-ref">expression_string</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-property-input-include-delta"><span class="std std-ref">input_include_delta</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code></p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-property-input-names"><span class="std std-ref">input_names</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray()</span></code></p></td>
</tr>
<tr class="row-even"><td><p><span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>]</p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-property-input-values"><span class="std std-ref">input_values</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">[]</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-property-node"><span class="std std-ref">node</span></a></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-property-result-var"><span class="std std-ref">result_var</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><span class="xref std std-ref">Error</span></p></td>
<td><p><a class="reference internal" href="#class-btevaluateexpression-method-parse"><span class="std std-ref">parse</span></a>()</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btevaluateexpression-property-expression-string"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>expression_string</strong> = <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code> <a class="reference internal" href="#class-btevaluateexpression-property-expression-string"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_expression_string</strong>(value: <code class="docutils literal notranslate"><span class="pre">String</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_expression_string</strong>()</p></li>
</ul>
<p>The expression string to be parsed and executed.</p>
<p><strong>Warning:</strong> Call <a class="reference internal" href="#class-btevaluateexpression-method-parse"><span class="std std-ref">parse</span></a> after updating <a class="reference internal" href="#class-btevaluateexpression-property-expression-string"><span class="std std-ref">expression_string</span></a> to update the internal <code class="docutils literal notranslate"><span class="pre">Expression</span></code> as it won’t be updated automatically.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btevaluateexpression-property-input-include-delta"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>input_include_delta</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btevaluateexpression-property-input-include-delta"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_input_include_delta</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_input_delta_included</strong>()</p></li>
</ul>
<p>If enabled, the input variable <code class="docutils literal notranslate"><span class="pre">delta</span></code> will be added to <a class="reference internal" href="#class-btevaluateexpression-property-input-names"><span class="std std-ref">input_names</span></a> and <a class="reference internal" href="#class-btevaluateexpression-property-input-values"><span class="std std-ref">input_values</span></a>.</p>
<p><strong>Warning:</strong> Call <a class="reference internal" href="#class-btevaluateexpression-method-parse"><span class="std std-ref">parse</span></a> after toggling <a class="reference internal" href="#class-btevaluateexpression-property-input-include-delta"><span class="std std-ref">input_include_delta</span></a> to update the internal <code class="docutils literal notranslate"><span class="pre">Expression</span></code> as it won’t be updated automatically.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btevaluateexpression-property-input-names"><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> <strong>input_names</strong> = <code class="docutils literal notranslate"><span class="pre">PackedStringArray()</span></code> <a class="reference internal" href="#class-btevaluateexpression-property-input-names"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_input_names</strong>(value: <code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> <strong>get_input_names</strong>()</p></li>
</ul>
<p>List of variable names within <a class="reference internal" href="#class-btevaluateexpression-property-expression-string"><span class="std std-ref">expression_string</span></a> for which the user will provide values for through <a class="reference internal" href="#class-btevaluateexpression-property-input-values"><span class="std std-ref">input_values</span></a>.</p>
<p><strong>Warning:</strong> Call <a class="reference internal" href="#class-btevaluateexpression-method-parse"><span class="std std-ref">parse</span></a> after updating <a class="reference internal" href="#class-btevaluateexpression-property-input-names"><span class="std std-ref">input_names</span></a> to update the internal <code class="docutils literal notranslate"><span class="pre">Expression</span></code> as it won’t be updated automatically.</p>
<p><strong>Note:</strong> The returned array is <em>copied</em> and any changes to it will not update the original property value. See <code class="docutils literal notranslate"><span class="pre">PackedStringArray</span></code> for more details.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btevaluateexpression-property-input-values"><span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>] <strong>input_values</strong> = <code class="docutils literal notranslate"><span class="pre">[]</span></code> <a class="reference internal" href="#class-btevaluateexpression-property-input-values"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_input_values</strong>(value: <span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>])</p></li>
<li><p><span class="xref std std-ref">Array</span>[<a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>] <strong>get_input_values</strong>()</p></li>
</ul>
<p>List of values for variables specified in <a class="reference internal" href="#class-btevaluateexpression-property-input-names"><span class="std std-ref">input_names</span></a>. The values are mapped to the variables by their array index.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btevaluateexpression-property-node"><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>node</strong> <a class="reference internal" href="#class-btevaluateexpression-property-node"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_node_param</strong>(value: <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>get_node_param</strong>()</p></li>
</ul>
<p>Specifies the <code class="docutils literal notranslate"><span class="pre">Node</span></code> or <code class="docutils literal notranslate"><span class="pre">Object</span></code> instance containing the method to be called.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btevaluateexpression-property-result-var"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>result_var</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btevaluateexpression-property-result-var"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_result_var</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_result_var</strong>()</p></li>
</ul>
<p>if non-empty, assign the result of the method call to the blackboard variable specified by this property.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-btevaluateexpression-method-parse"><span class="xref std std-ref">Error</span> <strong>parse</strong>() <a class="reference internal" href="#class-btevaluateexpression-method-parse"><span class="std std-ref">🔗</span></a></p>
<p>Calls <span class="xref std std-ref">Expression.parse</span> considering <a class="reference internal" href="#class-btevaluateexpression-property-input-include-delta"><span class="std std-ref">input_include_delta</span></a> and <a class="reference internal" href="#class-btevaluateexpression-property-input-names"><span class="std std-ref">input_names</span></a> and returns its error code.</p>
</section>
</section>
<span id="document-classes/class_btfail"></span><section id="btfail">
<span id="class-btfail"></span><h2>BTFail<a class="headerlink" href="#btfail" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that always returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
<span id="document-classes/class_btforeach"></span><section id="btforeach">
<span id="class-btforeach"></span><h2>BTForEach<a class="headerlink" href="#btforeach" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that executes its child task for each element of an <code class="docutils literal notranslate"><span class="pre">Array</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTForEach executes its child task for each element of an <code class="docutils literal notranslate"><span class="pre">Array</span></code>. During each iteration, the next element is stored in the specified <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variable.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> or if the child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> on a non-last iteration.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> on the last iteration.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btforeach-property-array-var"><span class="std std-ref">array_var</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btforeach-property-save-var"><span class="std std-ref">save_var</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btforeach-property-array-var"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>array_var</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btforeach-property-array-var"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_array_var</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_array_var</strong>()</p></li>
</ul>
<p>A variable within the <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> that holds an <code class="docutils literal notranslate"><span class="pre">Array</span></code>, which is used for the iteration process.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btforeach-property-save-var"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>save_var</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btforeach-property-save-var"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_save_var</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_save_var</strong>()</p></li>
</ul>
<p>A <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variable used to store an element of the array referenced by <a class="reference internal" href="#class-btforeach-property-array-var"><span class="std std-ref">array_var</span></a>.</p>
</section>
</section>
<span id="document-classes/class_btinstance"></span><section id="btinstance">
<span id="class-btinstance"></span><h2>BTInstance<a class="headerlink" href="#btinstance" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p>Represents a runtime instance of a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resource.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>Can be created using the <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree-method-instantiate"><span class="std std-ref">BehaviorTree.instantiate</span></a> method.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btinstance-property-monitor-performance"><span class="std std-ref">monitor_performance</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Node</span></code></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-get-agent"><span class="std std-ref">get_agent</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-get-blackboard"><span class="std std-ref">get_blackboard</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-get-last-status"><span class="std std-ref">get_last_status</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Node</span></code></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-get-owner-node"><span class="std std-ref">get_owner_node</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-get-root-task"><span class="std std-ref">get_root_task</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-get-source-bt-path"><span class="std std-ref">get_source_bt_path</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-is-instance-valid"><span class="std std-ref">is_instance_valid</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-register-with-debugger"><span class="std std-ref">register_with_debugger</span></a>()</p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-unregister-with-debugger"><span class="std std-ref">unregister_with_debugger</span></a>()</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a></p></td>
<td><p><a class="reference internal" href="#class-btinstance-method-update"><span class="std std-ref">update</span></a>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="signals">
<h3>Signals<a class="headerlink" href="#signals" title="Link to this heading"></a></h3>
<p class="classref-signal" id="class-btinstance-signal-freed"><strong>freed</strong>() <a class="reference internal" href="#class-btinstance-signal-freed"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the behavior tree instance is freed. Used by debugger to unregister.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-signal" id="class-btinstance-signal-updated"><strong>updated</strong>(status: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <a class="reference internal" href="#class-btinstance-signal-updated"><span class="std std-ref">🔗</span></a></p>
<p>Emitted when the behavior tree instance has finished updating.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btinstance-property-monitor-performance"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>monitor_performance</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btinstance-property-monitor-performance"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_monitor_performance</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_monitor_performance</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, adds a performance monitor for this instance to “Debugger-&gt;Monitors” in the editor.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-btinstance-method-get-agent"><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>get_agent</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-get-agent"><span class="std std-ref">🔗</span></a></p>
<p>Returns the agent of the behavior tree instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-get-blackboard"><a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> <strong>get_blackboard</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-get-blackboard"><span class="std std-ref">🔗</span></a></p>
<p>Returns the blackboard of the behavior tree instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-get-last-status"><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>get_last_status</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-get-last-status"><span class="std std-ref">🔗</span></a></p>
<p>Returns the execution status of the last update.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-get-owner-node"><code class="docutils literal notranslate"><span class="pre">Node</span></code> <strong>get_owner_node</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-get-owner-node"><span class="std std-ref">🔗</span></a></p>
<p>Returns the scene <code class="docutils literal notranslate"><span class="pre">Node</span></code> that owns this behavior tree instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-get-root-task"><a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>get_root_task</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-get-root-task"><span class="std std-ref">🔗</span></a></p>
<p>Returns the root task of the behavior tree instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-get-source-bt-path"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_source_bt_path</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-get-source-bt-path"><span class="std std-ref">🔗</span></a></p>
<p>Returns the file path to the behavior tree resource that was used to create this instance.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-is-instance-valid"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>is_instance_valid</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btinstance-method-is-instance-valid"><span class="std std-ref">🔗</span></a></p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the behavior tree instance is properly initialized and can be used.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-register-with-debugger"><abbr title="No return value.">void</abbr> <strong>register_with_debugger</strong>() <a class="reference internal" href="#class-btinstance-method-register-with-debugger"><span class="std std-ref">🔗</span></a></p>
<p>Registers the behavior tree instance with the debugger.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-unregister-with-debugger"><abbr title="No return value.">void</abbr> <strong>unregister_with_debugger</strong>() <a class="reference internal" href="#class-btinstance-method-unregister-with-debugger"><span class="std std-ref">🔗</span></a></p>
<p>Unregisters the behavior tree instance from the debugger. This is typically not necessary, as the debugger will automatically unregister the instance when it is freed.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btinstance-method-update"><a class="reference internal" href="#document-classes/class_bt#enum-bt-status"><span class="std std-ref">Status</span></a> <strong>update</strong>(delta: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-btinstance-method-update"><span class="std std-ref">🔗</span></a></p>
<p>Ticks the behavior tree instance and returns its status.</p>
</section>
</section>
<span id="document-classes/class_btinvert"></span><section id="btinvert">
<span id="class-btinvert"></span><h2>BTInvert<a class="headerlink" href="#btinvert" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that transforms <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> into <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> and <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> into <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTInvert transforms <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> into <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> and <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> into <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btnewscope"></span><section id="btnewscope">
<span id="class-btnewscope"></span><h2>BTNewScope<a class="headerlink" href="#btnewscope" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p><strong>Inherited By:</strong> <a class="reference internal" href="#document-classes/class_btsubtree#class-btsubtree"><span class="std std-ref">BTSubtree</span></a></p>
<p>BT decorator that creates a new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> scope.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTNewScope creates a new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> scope during initialization and populates it with data. See <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a>.</p>
<p>Returns the status of the child task execution.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a></p></td>
<td><p><a class="reference internal" href="#class-btnewscope-property-blackboard-plan"><span class="std std-ref">blackboard_plan</span></a></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btnewscope-property-blackboard-plan"><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>blackboard_plan</strong> <a class="reference internal" href="#class-btnewscope-property-blackboard-plan"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_blackboard_plan</strong>(value: <a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_blackboardplan#class-blackboardplan"><span class="std std-ref">BlackboardPlan</span></a> <strong>get_blackboard_plan</strong>()</p></li>
</ul>
<p>Stores and manages variables that will be used in constructing new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> instances.</p>
</section>
</section>
<span id="document-classes/class_btparallel"></span><section id="btparallel">
<span id="class-btparallel"></span><h2>BTParallel<a class="headerlink" href="#btparallel" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that executes all of its child tasks simultaneously.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTParallel executes all of its child tasks simultaneously. Note that BTParallel doesn’t involve multithreading. It processes each task sequentially, from first to last, in the same tick before returning a result. If one of the abort criterea is met, any tasks currently <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> will be terminated, and the result will be either <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> or <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. The <a class="reference internal" href="#class-btparallel-property-num-failures-required"><span class="std std-ref">num_failures_required</span></a> determines when BTParallel fails and <a class="reference internal" href="#class-btparallel-property-num-successes-required"><span class="std std-ref">num_successes_required</span></a> when it succeeds. When both are fullfilled, it gives priority to <a class="reference internal" href="#class-btparallel-property-num-failures-required"><span class="std std-ref">num_failures_required</span></a>.</p>
<p>If set to <a class="reference internal" href="#class-btparallel-property-repeat"><span class="std std-ref">repeat</span></a>, all child tasks will be re-executed each tick, regardless of whether they previously resulted in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> when the required number of child tasks result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. When <a class="reference internal" href="#class-btparallel-property-repeat"><span class="std std-ref">repeat</span></a> is set to <code class="docutils literal notranslate"><span class="pre">false</span></code>, if none of the criteria were met and all child tasks resulted in either <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTParallel will return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> when the required number of child tasks result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if none of the criterea were fulfilled, and either <a class="reference internal" href="#class-btparallel-property-repeat"><span class="std std-ref">repeat</span></a> is set to <code class="docutils literal notranslate"><span class="pre">true</span></code> or a child task resulted in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-btparallel-property-num-failures-required"><span class="std std-ref">num_failures_required</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-btparallel-property-num-successes-required"><span class="std std-ref">num_successes_required</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btparallel-property-repeat"><span class="std std-ref">repeat</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btparallel-property-num-failures-required"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>num_failures_required</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-btparallel-property-num-failures-required"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_num_failures_required</strong>(value: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_num_failures_required</strong>()</p></li>
</ul>
<p>If the specified number of child tasks return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTParallel will also return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btparallel-property-num-successes-required"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>num_successes_required</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-btparallel-property-num-successes-required"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_num_successes_required</strong>(value: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_num_successes_required</strong>()</p></li>
</ul>
<p>If the specified number of child tasks return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, BTParallel will also return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btparallel-property-repeat"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>repeat</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btparallel-property-repeat"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_repeat</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_repeat</strong>()</p></li>
</ul>
<p>When <code class="docutils literal notranslate"><span class="pre">true</span></code>, the child tasks will be executed again, regardless of whether they previously resulted in a <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>When <code class="docutils literal notranslate"><span class="pre">false</span></code>, if none of the criteria were met, and all child tasks resulted in a <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTParallel will return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btpauseanimation"></span><section id="btpauseanimation">
<span id="class-btpauseanimation"></span><h2>BTPauseAnimation<a class="headerlink" href="#btpauseanimation" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that pauses the playback of an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTPauseAnimation action pauses the playback of an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the action fails to get the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btpauseanimation-property-animation-player"><span class="std std-ref">animation_player</span></a></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btpauseanimation-property-animation-player"><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>animation_player</strong> <a class="reference internal" href="#class-btpauseanimation-property-animation-player"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_player</strong>(value: <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>get_animation_player</strong>()</p></li>
</ul>
<p>Parameter that specifies the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
</section>
</section>
<span id="document-classes/class_btplayanimation"></span><section id="btplayanimation">
<span id="class-btplayanimation"></span><h2>BTPlayAnimation<a class="headerlink" href="#btplayanimation" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that plays an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTPlayAnimation action plays an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node. If the <a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">await_completion</span></a> is greater than <code class="docutils literal notranslate"><span class="pre">0</span></code>, the action will wait for the animation to complete, with the maximum waiting time equal to <a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">await_completion</span></a>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if the animation finishes playing or if the elapsed time exceeds <a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">await_completion</span></a>. When <a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">await_completion</span></a> is set to <code class="docutils literal notranslate"><span class="pre">0</span></code>, BTPlayAnimation doesn’t wait for the animation to finish and immediately returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if the animation is still playing and the elapsed time is less than <a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">await_completion</span></a>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the action fails to play the requested animation.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayanimation-property-animation-name"><span class="std std-ref">animation_name</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btplayanimation-property-animation-player"><span class="std std-ref">animation_player</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">await_completion</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayanimation-property-blend"><span class="std std-ref">blend</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">-1.0</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayanimation-property-from-end"><span class="std std-ref">from_end</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btplayanimation-property-speed"><span class="std std-ref">speed</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btplayanimation-property-animation-name"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>animation_name</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btplayanimation-property-animation-name"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_name</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_animation_name</strong>()</p></li>
</ul>
<p>Animation’s key within the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node. If empty, BTPlayAnimation will resume the last played animation if the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> was previously paused.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayanimation-property-animation-player"><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>animation_player</strong> <a class="reference internal" href="#class-btplayanimation-property-animation-player"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_player</strong>(value: <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>get_animation_player</strong>()</p></li>
</ul>
<p>Parameter that specifies the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayanimation-property-await-completion"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>await_completion</strong> = <code class="docutils literal notranslate"><span class="pre">0.0</span></code> <a class="reference internal" href="#class-btplayanimation-property-await-completion"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_await_completion</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_await_completion</strong>()</p></li>
</ul>
<p>The maximum duration to wait for the animation to complete (in seconds). If the animation doesn’t finish within this time, BTPlayAnimation will stop waiting and return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayanimation-property-blend"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>blend</strong> = <code class="docutils literal notranslate"><span class="pre">-1.0</span></code> <a class="reference internal" href="#class-btplayanimation-property-blend"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_blend</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_blend</strong>()</p></li>
</ul>
<p>Custom blend time (in seconds). See <span class="xref std std-ref">AnimationPlayer.play</span>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayanimation-property-from-end"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>from_end</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btplayanimation-property-from-end"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_from_end</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_from_end</strong>()</p></li>
</ul>
<p>Play animation from the end. Used in combination with negative <a class="reference internal" href="#class-btplayanimation-property-speed"><span class="std std-ref">speed</span></a> to play animation in reverse. See <span class="xref std std-ref">AnimationPlayer.play</span>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btplayanimation-property-speed"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>speed</strong> = <code class="docutils literal notranslate"><span class="pre">1.0</span></code> <a class="reference internal" href="#class-btplayanimation-property-speed"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_speed</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_speed</strong>()</p></li>
</ul>
<p>Custom playback speed scaling ratio. See <span class="xref std std-ref">AnimationPlayer.play</span>.</p>
</section>
</section>
<span id="document-classes/class_btprobability"></span><section id="btprobability">
<span id="class-btprobability"></span><h2>BTProbability<a class="headerlink" href="#btprobability" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that executes its child task with a given probability.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTProbability executes its child task with a given probability defined by <a class="reference internal" href="#class-btprobability-property-run-chance"><span class="std std-ref">run_chance</span></a>.</p>
<p>Returns the result of the child task if it was executed; otherwise, it returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btprobability-property-run-chance"><span class="std std-ref">run_chance</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0.5</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btprobability-property-run-chance"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>run_chance</strong> = <code class="docutils literal notranslate"><span class="pre">0.5</span></code> <a class="reference internal" href="#class-btprobability-property-run-chance"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_run_chance</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_run_chance</strong>()</p></li>
</ul>
<p>Probability that defines how likely the child task will be executed.</p>
</section>
</section>
<span id="document-classes/class_btprobabilityselector"></span><section id="btprobabilityselector">
<span id="class-btprobabilityselector"></span><h2>BTProbabilitySelector<a class="headerlink" href="#btprobabilityselector" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that chooses a child task to execute based on attached probabilities.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTProbabilitySelector chooses a child task to execute based on attached probabilities. It is typically used for decision-making purposes. Probability distribution is calculated based on weights assigned to each child task.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> when a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> when a child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>.</p>
<p>The behavior of BTProbabilitySelector when a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> depends on the <a class="reference internal" href="#class-btprobabilityselector-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a> value:</p>
<ul class="simple">
<li><p>If <a class="reference internal" href="#class-btprobabilityselector-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a> is <code class="docutils literal notranslate"><span class="pre">false</span></code>, when a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTProbabilitySelector will normalize the probability distribution over the remaining children and choose a new child task to be executed. If all child tasks fail, the composite will return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p></li>
<li><p>If <a class="reference internal" href="#class-btprobabilityselector-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, when a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTProbabilitySelector will not choose another child task to be executed and will immediately return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p></li>
</ul>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-method-get-probability"><span class="std std-ref">get_probability</span></a>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-method-get-total-weight"><span class="std std-ref">get_total_weight</span></a>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-method-get-weight"><span class="std std-ref">get_weight</span></a>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-method-has-probability"><span class="std std-ref">has_probability</span></a>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-method-set-probability"><span class="std std-ref">set_probability</span></a>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>, probability: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><abbr title="No return value.">void</abbr></p></td>
<td><p><a class="reference internal" href="#class-btprobabilityselector-method-set-weight"><span class="std std-ref">set_weight</span></a>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>, weight: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btprobabilityselector-property-abort-on-failure"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>abort_on_failure</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btprobabilityselector-property-abort-on-failure"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_abort_on_failure</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_abort_on_failure</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, BTProbabilitySelector will not choose another child to execute and will return <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> when a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-btprobabilityselector-method-get-probability"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_probability</strong>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btprobabilityselector-method-get-probability"><span class="std std-ref">🔗</span></a></p>
<p>Returns the child task’s selection probability.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btprobabilityselector-method-get-total-weight"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_total_weight</strong>() <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btprobabilityselector-method-get-total-weight"><span class="std std-ref">🔗</span></a></p>
<p>Returns the total weight of all child tasks.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btprobabilityselector-method-get-weight"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_weight</strong>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btprobabilityselector-method-get-weight"><span class="std std-ref">🔗</span></a></p>
<p>Returns the child task’s weight within the weighted probability selection algorithm.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btprobabilityselector-method-has-probability"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>has_probability</strong>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-btprobabilityselector-method-has-probability"><span class="std std-ref">🔗</span></a></p>
<p>Returns whether the child task at index <code class="docutils literal notranslate"><span class="pre">child_idx</span></code> participates within the weighted probability selection algorithm and has a probability assigned to it. Returns <code class="docutils literal notranslate"><span class="pre">false</span></code> for <a class="reference internal" href="#document-classes/class_btcomment#class-btcomment"><span class="std std-ref">BTComment</span></a> tasks.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btprobabilityselector-method-set-probability"><abbr title="No return value.">void</abbr> <strong>set_probability</strong>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>, probability: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-btprobabilityselector-method-set-probability"><span class="std std-ref">🔗</span></a></p>
<p>Sets the child task’s weight calculated based on the desired probability.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-btprobabilityselector-method-set-weight"><abbr title="No return value.">void</abbr> <strong>set_weight</strong>(child_idx: <code class="docutils literal notranslate"><span class="pre">int</span></code>, weight: <code class="docutils literal notranslate"><span class="pre">float</span></code>) <a class="reference internal" href="#class-btprobabilityselector-method-set-weight"><span class="std std-ref">🔗</span></a></p>
<p>Sets the child task’s weight for the weighted probability selection algorithm.</p>
</section>
</section>
<span id="document-classes/class_btrandomselector"></span><section id="btrandomselector">
<span id="class-btrandomselector"></span><h2>BTRandomSelector<a class="headerlink" href="#btrandomselector" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that executes tasks in random order until first <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRandomSelector executes its child tasks in a random order until any child returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. If a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTRandomSelector will immediately execute another child task until one of them returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or all of them result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. BTRandomSelector will remember the execution order and the last child task that returned <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, ensuring it resumes from that point in the next tick.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if all child tasks result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btrandomsequence"></span><section id="btrandomsequence">
<span id="class-btrandomsequence"></span><h2>BTRandomSequence<a class="headerlink" href="#btrandomsequence" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that executes tasks in random order as long as they return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRandomSequence executes its child tasks in a random order as long as they return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. If a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, BTRandomSequence will immediately execute the next child task until one of them returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> or all of them result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. BTRandomSequence will remember the execution order and the last child task that returned <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, ensuring it resumes from that point in the next tick.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if all child tasks result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btrandomwait"></span><section id="btrandomwait">
<span id="class-btrandomwait"></span><h2>BTRandomWait<a class="headerlink" href="#btrandomwait" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that waits for a randomized duration to elapse and then returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRandomWait action waits for a randomized duration to elapse and then returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. The duration is randomized within the specified range, defined by <a class="reference internal" href="#class-btrandomwait-property-min-duration"><span class="std std-ref">min_duration</span></a> and <a class="reference internal" href="#class-btrandomwait-property-max-duration"><span class="std std-ref">max_duration</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btrandomwait-property-max-duration"><span class="std std-ref">max_duration</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">2.0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btrandomwait-property-min-duration"><span class="std std-ref">min_duration</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btrandomwait-property-max-duration"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>max_duration</strong> = <code class="docutils literal notranslate"><span class="pre">2.0</span></code> <a class="reference internal" href="#class-btrandomwait-property-max-duration"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_max_duration</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_max_duration</strong>()</p></li>
</ul>
<p>Maximum duration for the wait.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btrandomwait-property-min-duration"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>min_duration</strong> = <code class="docutils literal notranslate"><span class="pre">1.0</span></code> <a class="reference internal" href="#class-btrandomwait-property-min-duration"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_min_duration</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_min_duration</strong>()</p></li>
</ul>
<p>Minimum duration for the wait.</p>
</section>
</section>
<span id="document-classes/class_btrepeat"></span><section id="btrepeat">
<span id="class-btrepeat"></span><h2>BTRepeat<a class="headerlink" href="#btrepeat" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that repeats its child a specified number of <a class="reference internal" href="#class-btrepeat-property-times"><span class="std std-ref">times</span></a>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRepeat iterates its child task a specified number of times, as defined by <a class="reference internal" href="#class-btrepeat-property-times"><span class="std std-ref">times</span></a>. If <a class="reference internal" href="#class-btrepeat-property-forever"><span class="std std-ref">forever</span></a> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, the child’s execution will be repeated indefinitely.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. If <a class="reference internal" href="#class-btrepeat-property-forever"><span class="std std-ref">forever</span></a> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, BTRepeat will always return <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if the specified number of successful executions is reached. If <a class="reference internal" href="#class-btrepeat-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a> is <code class="docutils literal notranslate"><span class="pre">false</span></code>, a <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> status returned by the child is also considered a successful execution.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> when <a class="reference internal" href="#class-btrepeat-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a> is <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btrepeat-property-abort-on-failure"><span class="std std-ref">abort_on_failure</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btrepeat-property-forever"><span class="std std-ref">forever</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-btrepeat-property-times"><span class="std std-ref">times</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btrepeat-property-abort-on-failure"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>abort_on_failure</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btrepeat-property-abort-on-failure"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_abort_on_failure</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_abort_on_failure</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">false</span></code>, <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> status returned by the child task is also considered as a successful execution.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btrepeat-property-forever"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>forever</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btrepeat-property-forever"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_forever</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_forever</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, the child’s execution will be repeated indefinitely, always returning <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btrepeat-property-times"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>times</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-btrepeat-property-times"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_times</strong>(value: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_times</strong>()</p></li>
</ul>
<p>The number of times to repeat execution of the child task.</p>
</section>
</section>
<span id="document-classes/class_btrepeatuntilfailure"></span><section id="btrepeatuntilfailure">
<span id="class-btrepeatuntilfailure"></span><h2>BTRepeatUntilFailure<a class="headerlink" href="#btrepeatuntilfailure" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that repeats its child task until <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRepeatUntilFailure repeats its child task until it results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> or <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btrepeatuntilsuccess"></span><section id="btrepeatuntilsuccess">
<span id="class-btrepeatuntilsuccess"></span><h2>BTRepeatUntilSuccess<a class="headerlink" href="#btrepeatuntilsuccess" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that repeats its child task until <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRepeatUntilSuccess repeats its child task until it results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> or <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if the child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btrunlimit"></span><section id="btrunlimit">
<span id="class-btrunlimit"></span><h2>BTRunLimit<a class="headerlink" href="#btrunlimit" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that restricts the execution of its child a limited number of times.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTRunLimit restricts the execution of the child task to a maximum number of times, defined by <a class="reference internal" href="#class-btrunlimit-property-run-limit"><span class="std std-ref">run_limit</span></a>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the limit on executions is exceeded; otherwise, it returns the status of the child task.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a></p></td>
<td><p><a class="reference internal" href="#class-btrunlimit-property-count-policy"><span class="std std-ref">count_policy</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-btrunlimit-property-run-limit"><span class="std std-ref">run_limit</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="enumerations">
<h3>Enumerations<a class="headerlink" href="#enumerations" title="Link to this heading"></a></h3>
<p class="classref-enumeration" id="enum-btrunlimit-countpolicy">enum <strong>CountPolicy</strong>: <a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-btrunlimit-constant-count-successful"><a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a> <strong>COUNT_SUCCESSFUL</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>Count only successful runs towards the limit.</p>
<p class="classref-enumeration-constant" id="class-btrunlimit-constant-count-failed"><a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a> <strong>COUNT_FAILED</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>Count only failed runs towards the limit.</p>
<p class="classref-enumeration-constant" id="class-btrunlimit-constant-count-all"><a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a> <strong>COUNT_ALL</strong> = <code class="docutils literal notranslate"><span class="pre">2</span></code></p>
<p>Count successful and failed runs towards the limit.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btrunlimit-property-count-policy"><a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a> <strong>count_policy</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-btrunlimit-property-count-policy"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_count_policy</strong>(value: <a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a>)</p></li>
<li><p><a class="reference internal" href="#enum-btrunlimit-countpolicy"><span class="std std-ref">CountPolicy</span></a> <strong>get_count_policy</strong>()</p></li>
</ul>
<p>Which runs should be counted towards the limit: successful, failed, or all?</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btrunlimit-property-run-limit"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>run_limit</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-btrunlimit-property-run-limit"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_run_limit</strong>(value: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_run_limit</strong>()</p></li>
</ul>
<p>The maximum number of times the child is permitted to be executed.</p>
</section>
</section>
<span id="document-classes/class_btselector"></span><section id="btselector">
<span id="class-btselector"></span><h2>BTSelector<a class="headerlink" href="#btselector" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that sequentially executes tasks until first <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTSelector executes its child tasks sequentially, from first to last, until any child returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. If a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>, BTSelector will immediately execute the next child task until one of them returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> or all of them result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>. BTSelector and <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a> are two of the most common building blocks of behavior trees. Essentially, while <a class="reference internal" href="#document-classes/class_btsequence#class-btsequence"><span class="std std-ref">BTSequence</span></a> is similar to a boolean AND operation, BTSelector is similar to a boolean OR operation. Selectors enable the behavior tree to respond to changes in the environment and trigger transitions between various fallback behaviors.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. BTSelector will remember the last child task that returned <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, ensuring it resumes from that point in the next execution tick.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if all child tasks result in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btsequence"></span><section id="btsequence">
<span id="class-btsequence"></span><h2>BTSequence<a class="headerlink" href="#btsequence" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btcomposite#class-btcomposite"><span class="std std-ref">BTComposite</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT composite that sequentially executes tasks as long as they return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTSequence executes its child tasks sequentially, from first to last, as long as they return <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. If a child task results in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>, BTSequence will immediately execute the next child task until one of them returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> or all of them result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. BTSequence and <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a> are two of the most common building blocks of behavior trees. Essentially, while <a class="reference internal" href="#document-classes/class_btselector#class-btselector"><span class="std std-ref">BTSelector</span></a> is similar to a boolean OR operation, BTSequence is similar to a boolean AND operation. Sequences enable the behavior tree to compose complex behaviors from a chain of simpler tasks.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> if any child task results in <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>. BTSequence will remember the last child task that returned <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code>, ensuring it resumes from that point in the next execution tick.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code> if all child tasks result in <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if a child task results in <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code>.</p>
</section>
</section>
<span id="document-classes/class_btsetagentproperty"></span><section id="btsetagentproperty">
<span id="class-btsetagentproperty"></span><h2>BTSetAgentProperty<a class="headerlink" href="#btsetagentproperty" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that assigns a value to the specified agent’s property.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTSetAgentProperty assigns the specified <a class="reference internal" href="#class-btsetagentproperty-property-value"><span class="std std-ref">value</span></a> to the agent’s property identified by the <a class="reference internal" href="#class-btsetagentproperty-property-property"><span class="std std-ref">property</span></a> and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. Optionally, it can perform a specific <a class="reference internal" href="#class-btsetagentproperty-property-operation"><span class="std std-ref">operation</span></a> before assignment.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if it fails to set the property.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a></p></td>
<td><p><a class="reference internal" href="#class-btsetagentproperty-property-operation"><span class="std std-ref">operation</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btsetagentproperty-property-property"><span class="std std-ref">property</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a></p></td>
<td><p><a class="reference internal" href="#class-btsetagentproperty-property-value"><span class="std std-ref">value</span></a></p></td>
<td></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btsetagentproperty-property-operation"><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>operation</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-btsetagentproperty-property-operation"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_operation</strong>(value: <a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>get_operation</strong>()</p></li>
</ul>
<p>Specifies the operation to be performed before assignment. Operation is executed as follows:</p>
<p><code class="docutils literal notranslate"><span class="pre">property</span> <span class="pre">=</span> <span class="pre">property</span> <span class="pre">OPERATION</span> <span class="pre">value</span></code></p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btsetagentproperty-property-property"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>property</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btsetagentproperty-property-property"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_property</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_property</strong>()</p></li>
</ul>
<p>Parameter that specifies the agent’s property name.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btsetagentproperty-property-value"><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>value</strong> <a class="reference internal" href="#class-btsetagentproperty-property-value"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_value</strong>(value: <a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>get_value</strong>()</p></li>
</ul>
<p>Parameter that specifies the value that will be assigned to agent’s property.</p>
</section>
</section>
<span id="document-classes/class_btsetvar"></span><section id="btsetvar">
<span id="class-btsetvar"></span><h2>BTSetVar<a class="headerlink" href="#btsetvar" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that assigns <a class="reference internal" href="#class-btsetvar-property-value"><span class="std std-ref">value</span></a> to the <a class="reference internal" href="#class-btsetvar-property-variable"><span class="std std-ref">variable</span></a> and then returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTSetVar assigns <a class="reference internal" href="#class-btsetvar-property-value"><span class="std std-ref">value</span></a> to the <a class="reference internal" href="#class-btsetvar-property-variable"><span class="std std-ref">variable</span></a> and then returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. Optionally, it can perform a specific <a class="reference internal" href="#class-btsetvar-property-operation"><span class="std std-ref">operation</span></a> before assignment.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if it fails to set the <a class="reference internal" href="#class-btsetvar-property-variable"><span class="std std-ref">variable</span></a>.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a></p></td>
<td><p><a class="reference internal" href="#class-btsetvar-property-operation"><span class="std std-ref">operation</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a></p></td>
<td><p><a class="reference internal" href="#class-btsetvar-property-value"><span class="std std-ref">value</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btsetvar-property-variable"><span class="std std-ref">variable</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btsetvar-property-operation"><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>operation</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code> <a class="reference internal" href="#class-btsetvar-property-operation"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_operation</strong>(value: <a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_limboutility#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>get_operation</strong>()</p></li>
</ul>
<p>Specifies the operation to be performed before assignment. Operation is executed as follows:</p>
<p><code class="docutils literal notranslate"><span class="pre">variable</span> <span class="pre">=</span> <span class="pre">variable</span> <span class="pre">OPERATION</span> <span class="pre">value</span></code></p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btsetvar-property-value"><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>value</strong> <a class="reference internal" href="#class-btsetvar-property-value"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_value</strong>(value: <a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbvariant#class-bbvariant"><span class="std std-ref">BBVariant</span></a> <strong>get_value</strong>()</p></li>
</ul>
<p>Parameter that specifies the value to be assigned to the variable.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btsetvar-property-variable"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>variable</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btsetvar-property-variable"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_variable</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_variable</strong>()</p></li>
</ul>
<p>Name of the variable to which the value will be assigned.</p>
</section>
</section>
<span id="document-classes/class_btstopanimation"></span><section id="btstopanimation">
<span id="class-btstopanimation"></span><h2>BTStopAnimation<a class="headerlink" href="#btstopanimation" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that stops the playback of an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTStopAnimation action stops the playback of an animation on the specified <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node and returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>. If <a class="reference internal" href="#class-btstopanimation-property-animation-name"><span class="std std-ref">animation_name</span></a> is set, it will only stop the playback if the specified animation is currently playing.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the action fails to get the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code></p></td>
<td><p><a class="reference internal" href="#class-btstopanimation-property-animation-name"><span class="std std-ref">animation_name</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a></p></td>
<td><p><a class="reference internal" href="#class-btstopanimation-property-animation-player"><span class="std std-ref">animation_player</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-btstopanimation-property-keep-state"><span class="std std-ref">keep_state</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btstopanimation-property-animation-name"><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>animation_name</strong> = <code class="docutils literal notranslate"><span class="pre">&amp;&quot;&quot;</span></code> <a class="reference internal" href="#class-btstopanimation-property-animation-name"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_name</strong>(value: <code class="docutils literal notranslate"><span class="pre">StringName</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">StringName</span></code> <strong>get_animation_name</strong>()</p></li>
</ul>
<p>Animation’s key within the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node. If not empty, BTStopAnimation will only stop the playback if the specified animation is currently playing.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btstopanimation-property-animation-player"><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>animation_player</strong> <a class="reference internal" href="#class-btstopanimation-property-animation-player"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_animation_player</strong>(value: <a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_bbnode#class-bbnode"><span class="std std-ref">BBNode</span></a> <strong>get_animation_player</strong>()</p></li>
</ul>
<p>Parameter that specifies the <code class="docutils literal notranslate"><span class="pre">AnimationPlayer</span></code> node.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-property" id="class-btstopanimation-property-keep-state"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>keep_state</strong> = <code class="docutils literal notranslate"><span class="pre">false</span></code> <a class="reference internal" href="#class-btstopanimation-property-keep-state"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_keep_state</strong>(value: <code class="docutils literal notranslate"><span class="pre">bool</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>get_keep_state</strong>()</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, the animation state is not updated visually.</p>
</section>
</section>
<span id="document-classes/class_btsubtree"></span><section id="btsubtree">
<span id="class-btsubtree"></span><h2>BTSubtree<a class="headerlink" href="#btsubtree" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btnewscope#class-btnewscope"><span class="std std-ref">BTNewScope</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that instantiates and runs a subtree within the larger tree.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTSubtree instantiates a <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> and includes its root task as a child during initialization, while also creating a new <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> scope.</p>
<p>Returns the status of the subtree’s execution.</p>
<p>Subtree blackboard variables can be mapped to the main tree blackboard plan variables. Check out mapping section in the inspector.</p>
<p>Note: BTSubTree is designed as a simpler loader, and does not support updating <a class="reference internal" href="#class-btsubtree-property-subtree"><span class="std std-ref">subtree</span></a> at runtime. A custom subtree decorator is better suited:</p>
<div class="highlight-gdscript notranslate"><div class="highlight"><pre><span></span><span class="k">extends</span><span class="w"> </span><span class="n">BTDecorator</span>
<span class="c1">## MyCustomBranch</span>
<span class="k">func</span><span class="w"> </span><span class="n">_setup</span><span class="p">()</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="nb nb-Type">void</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">bt</span><span class="p">:</span><span class="w"> </span><span class="n">BehaviorTree</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">load</span><span class="p">(</span><span class="s2">"res://..."</span><span class="p">)</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">my_branch</span><span class="p">:</span><span class="w"> </span><span class="n">BTTask</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">bt</span><span class="o">.</span><span class="n">get_root_task</span><span class="p">()</span><span class="o">.</span><span class="n">clone</span><span class="p">()</span>
<span class="w"> </span><span class="n">my_branch</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="n">agent</span><span class="p">,</span><span class="w"> </span><span class="n">blackboard</span><span class="p">)</span>
<span class="w"> </span><span class="n">add_child</span><span class="p">(</span><span class="n">my_branch</span><span class="p">)</span>
<span class="k">func</span><span class="w"> </span><span class="n">_tick</span><span class="p">(</span><span class="n">delta</span><span class="p">)</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Status</span><span class="p">:</span>
<span class="w"> </span><span class="k">var</span><span class="w"> </span><span class="n">child</span><span class="p">:</span><span class="w"> </span><span class="n">BTTask</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">get_child</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">child</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="n">delta</span><span class="p">)</span>
</pre></div>
</div>
<p>This allows for the <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BehaviorTree</span></a> to load a specific behavior tree from a variable in the blackboard, or from some other location, and use that new behavior tree at runtime.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a></p></td>
<td><p><a class="reference internal" href="#class-btsubtree-property-subtree"><span class="std std-ref">subtree</span></a></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btsubtree-property-subtree"><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>subtree</strong> <a class="reference internal" href="#class-btsubtree-property-subtree"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_subtree</strong>(value: <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a>)</p></li>
<li><p><a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> <strong>get_subtree</strong>()</p></li>
</ul>
<p>A <a class="reference internal" href="#document-classes/class_behaviortree#class-behaviortree"><span class="std std-ref">BehaviorTree</span></a> resource that will be instantiated as a subtree.</p>
</section>
</section>
<span id="document-classes/class_bttimelimit"></span><section id="bttimelimit">
<span id="class-bttimelimit"></span><h2>BTTimeLimit<a class="headerlink" href="#bttimelimit" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btdecorator#class-btdecorator"><span class="std std-ref">BTDecorator</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT decorator that sets a time limit for its child’s execution.</p>
<section class="classref-introduction-group" id="description">
<h3>Description<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>BTTimeLimit allocates a limited time for the child’s execution and aborts it, returning <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the <a class="reference internal" href="#class-bttimelimit-property-time-limit"><span class="std std-ref">time_limit</span></a> is exceeded.</p>
<p>Returns <code class="docutils literal notranslate"><span class="pre">FAILURE</span></code> if the <a class="reference internal" href="#class-bttimelimit-property-time-limit"><span class="std std-ref">time_limit</span></a> is exceeded; otherwise, it returns the status of the child task.</p>
</section>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-bttimelimit-property-time-limit"><span class="std std-ref">time_limit</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">5.0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-bttimelimit-property-time-limit"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>time_limit</strong> = <code class="docutils literal notranslate"><span class="pre">5.0</span></code> <a class="reference internal" href="#class-bttimelimit-property-time-limit"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_time_limit</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_time_limit</strong>()</p></li>
</ul>
<p>Time allocated for the child task’s execution.</p>
</section>
</section>
<span id="document-classes/class_btwait"></span><section id="btwait">
<span id="class-btwait"></span><h2>BTWait<a class="headerlink" href="#btwait" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that waits for a specified <a class="reference internal" href="#class-btwait-property-duration"><span class="std std-ref">duration</span></a> to elapse and then returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p></td>
<td><p><a class="reference internal" href="#class-btwait-property-duration"><span class="std std-ref">duration</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btwait-property-duration"><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>duration</strong> = <code class="docutils literal notranslate"><span class="pre">1.0</span></code> <a class="reference internal" href="#class-btwait-property-duration"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_duration</strong>(value: <code class="docutils literal notranslate"><span class="pre">float</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">float</span></code> <strong>get_duration</strong>()</p></li>
</ul>
<div class="contribute docutils container">
<p>There is currently no description for this property. Please help us by <span class="xref std std-ref">contributing one</span>!</p>
</div>
</section>
</section>
<span id="document-classes/class_btwaitticks"></span><section id="btwaitticks">
<span id="class-btwaitticks"></span><h2>BTWaitTicks<a class="headerlink" href="#btwaitticks" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong> <a class="reference internal" href="#document-classes/class_btaction#class-btaction"><span class="std std-ref">BTAction</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> <strong>&lt;</strong> <a class="reference internal" href="#document-classes/class_bt#class-bt"><span class="std std-ref">BT</span></a></p>
<p>BT action that waits for a specified number of ticks to elapse and then returns <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
<section class="classref-reftable-group" id="properties">
<h3>Properties<a class="headerlink" href="#properties" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p><a class="reference internal" href="#class-btwaitticks-property-num-ticks"><span class="std std-ref">num_ticks</span></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="property-descriptions">
<h3>Property Descriptions<a class="headerlink" href="#property-descriptions" title="Link to this heading"></a></h3>
<p class="classref-property" id="class-btwaitticks-property-num-ticks"><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>num_ticks</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code> <a class="reference internal" href="#class-btwaitticks-property-num-ticks"><span class="std std-ref">🔗</span></a></p>
<ul class="classref-property-setget simple">
<li><p><abbr title="No return value.">void</abbr> <strong>set_num_ticks</strong>(value: <code class="docutils literal notranslate"><span class="pre">int</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> <strong>get_num_ticks</strong>()</p></li>
</ul>
<p>The number of ticks to wait before returning <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code>.</p>
</section>
</section>
<span id="document-classes/class_limboutility"></span><section id="limboutility">
<span id="class-limboutility"></span><h2>LimboUtility<a class="headerlink" href="#limboutility" title="Link to this heading"></a></h2>
<p><strong>Inherits:</strong></p>
<p>Helper functions for LimboAI.</p>
<section class="classref-reftable-group" id="methods">
<h3>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h3>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-decorate-output-var"><span class="std std-ref">decorate_output_var</span></a>(variable: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-decorate-var"><span class="std std-ref">decorate_var</span></a>(variable: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-get-check-operator-string"><span class="std std-ref">get_check_operator_string</span></a>(check: <a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-get-operation-string"><span class="std std-ref">get_operation_string</span></a>(operation: <a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">String</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-get-status-name"><span class="std std-ref">get_status_name</span></a>(status: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Texture2D</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-get-task-icon"><span class="std std-ref">get_task_icon</span></a>(class_or_script_path: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-perform-check"><span class="std std-ref">perform_check</span></a>(check: <a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a>, a: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>, b: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Variant</span></code></p></td>
<td><p><a class="reference internal" href="#class-limboutility-method-perform-operation"><span class="std std-ref">perform_operation</span></a>(operation: <a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a>, a: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>, b: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="enumerations">
<h3>Enumerations<a class="headerlink" href="#enumerations" title="Link to this heading"></a></h3>
<p class="classref-enumeration" id="enum-limboutility-checktype">enum <strong>CheckType</strong>: <a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-check-equal"><a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>CHECK_EQUAL</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>Equality Check.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-check-less-than"><a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>CHECK_LESS_THAN</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>Less Than Check.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-check-less-than-or-equal"><a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>CHECK_LESS_THAN_OR_EQUAL</strong> = <code class="docutils literal notranslate"><span class="pre">2</span></code></p>
<p>Less Than or Equal To Check.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-check-greater-than"><a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>CHECK_GREATER_THAN</strong> = <code class="docutils literal notranslate"><span class="pre">3</span></code></p>
<p>Greater Than Check.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-check-greater-than-or-equal"><a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>CHECK_GREATER_THAN_OR_EQUAL</strong> = <code class="docutils literal notranslate"><span class="pre">4</span></code></p>
<p>Greater Than or Equal To Check</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-check-not-equal"><a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> <strong>CHECK_NOT_EQUAL</strong> = <code class="docutils literal notranslate"><span class="pre">5</span></code></p>
<p>Inequality Check.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-enumeration" id="enum-limboutility-operation">enum <strong>Operation</strong>: <a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">🔗</span></a></p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-none"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_NONE</strong> = <code class="docutils literal notranslate"><span class="pre">0</span></code></p>
<p>No operation.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-addition"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_ADDITION</strong> = <code class="docutils literal notranslate"><span class="pre">1</span></code></p>
<p>Arithmetic addition.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-subtraction"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_SUBTRACTION</strong> = <code class="docutils literal notranslate"><span class="pre">2</span></code></p>
<p>Arithmetic subtraction.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-multiplication"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_MULTIPLICATION</strong> = <code class="docutils literal notranslate"><span class="pre">3</span></code></p>
<p>Arithmetic multiplication.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-division"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_DIVISION</strong> = <code class="docutils literal notranslate"><span class="pre">4</span></code></p>
<p>Arithmetic division.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-modulo"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_MODULO</strong> = <code class="docutils literal notranslate"><span class="pre">5</span></code></p>
<p>Produces the remainder of an integer division.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-power"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_POWER</strong> = <code class="docutils literal notranslate"><span class="pre">6</span></code></p>
<p>Multiply <code class="docutils literal notranslate"><span class="pre">a</span></code> by itself <code class="docutils literal notranslate"><span class="pre">b</span></code> times.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-bit-shift-left"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_BIT_SHIFT_LEFT</strong> = <code class="docutils literal notranslate"><span class="pre">7</span></code></p>
<p>Bitwise left shift.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-bit-shift-right"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_BIT_SHIFT_RIGHT</strong> = <code class="docutils literal notranslate"><span class="pre">8</span></code></p>
<p>Bitwise right shift.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-bit-and"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_BIT_AND</strong> = <code class="docutils literal notranslate"><span class="pre">9</span></code></p>
<p>Bitwise AND.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-bit-or"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_BIT_OR</strong> = <code class="docutils literal notranslate"><span class="pre">10</span></code></p>
<p>Bitwise OR.</p>
<p class="classref-enumeration-constant" id="class-limboutility-constant-operation-bit-xor"><a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> <strong>OPERATION_BIT_XOR</strong> = <code class="docutils literal notranslate"><span class="pre">11</span></code></p>
<p>Bitwise XOR.</p>
</section>
<hr class="classref-section-separator docutils" />
<section class="classref-descriptions-group" id="method-descriptions">
<h3>Method Descriptions<a class="headerlink" href="#method-descriptions" title="Link to this heading"></a></h3>
<p class="classref-method" id="class-limboutility-method-decorate-output-var"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>decorate_output_var</strong>(variable: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limboutility-method-decorate-output-var"><span class="std std-ref">🔗</span></a></p>
<p>Just like <a class="reference internal" href="#class-limboutility-method-decorate-var"><span class="std std-ref">decorate_var</span></a>, produces a string with a <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variable name that is formatted for display, and also adds an additional symbol to indicate that the variable is used as an output.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-decorate-var"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>decorate_var</strong>(variable: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limboutility-method-decorate-var"><span class="std std-ref">🔗</span></a></p>
<p>Produces a string with a <a class="reference internal" href="#document-classes/class_blackboard#class-blackboard"><span class="std std-ref">Blackboard</span></a> variable name that is formatted for display or console output.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-get-check-operator-string"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_check_operator_string</strong>(check: <a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limboutility-method-get-check-operator-string"><span class="std std-ref">🔗</span></a></p>
<p>Returns an operator string for a <a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a> enum value. For example, <a class="reference internal" href="#class-limboutility-constant-check-equal"><span class="std std-ref">CHECK_EQUAL</span></a> returns “==”.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-get-operation-string"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_operation_string</strong>(operation: <a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limboutility-method-get-operation-string"><span class="std std-ref">🔗</span></a></p>
<p>Returns a string representation of an <a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a> enum value.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-get-status-name"><code class="docutils literal notranslate"><span class="pre">String</span></code> <strong>get_status_name</strong>(status: <code class="docutils literal notranslate"><span class="pre">int</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limboutility-method-get-status-name"><span class="std std-ref">🔗</span></a></p>
<p>Returns a name of a <a class="reference internal" href="#document-classes/class_bttask#class-bttask"><span class="std std-ref">BTTask</span></a> status code.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-get-task-icon"><code class="docutils literal notranslate"><span class="pre">Texture2D</span></code> <strong>get_task_icon</strong>(class_or_script_path: <code class="docutils literal notranslate"><span class="pre">String</span></code>) <abbr title="This method has no side effects. It doesn't modify any of the instance's member variables.">const</abbr> <a class="reference internal" href="#class-limboutility-method-get-task-icon"><span class="std std-ref">🔗</span></a></p>
<p>Returns the icon texture associated with a task based on its class name or script resource path.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-perform-check"><code class="docutils literal notranslate"><span class="pre">bool</span></code> <strong>perform_check</strong>(check: <a class="reference internal" href="#enum-limboutility-checktype"><span class="std std-ref">CheckType</span></a>, a: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>, b: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>) <a class="reference internal" href="#class-limboutility-method-perform-check"><span class="std std-ref">🔗</span></a></p>
<p>Performs a <code class="docutils literal notranslate"><span class="pre">check</span></code> on two values, <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, and returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the check passes.</p>
<hr class="classref-item-separator docutils" />
<p class="classref-method" id="class-limboutility-method-perform-operation"><code class="docutils literal notranslate"><span class="pre">Variant</span></code> <strong>perform_operation</strong>(operation: <a class="reference internal" href="#enum-limboutility-operation"><span class="std std-ref">Operation</span></a>, a: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>, b: <code class="docutils literal notranslate"><span class="pre">Variant</span></code>) <a class="reference internal" href="#class-limboutility-method-perform-operation"><span class="std std-ref">🔗</span></a></p>
<p>Performs an <code class="docutils literal notranslate"><span class="pre">operation</span></code> on two values, <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>, and returns the result.</p>
</section>
</section>
</div>
</section>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2023-present Serhii Snitsaruk and the LimboAI contributors.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>