[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KRBCGX94VV95HDARM2CM75":3,"skill-same:01M6KRBCGX94VV95HDARM2CM75":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M6KRBCGX94VV95HDARM2CM75","limboai",null,"Use when using the LimboAI addon — behavior trees and hierarchical state machines (C++ GDExtension) with a visual editor, BTTask subclassing, and a blackboard","jame581\u002FGodotPrompter","jame581","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21112138?v=4","01M6KR3KEQ9Z30WVJRR2E2ZVXE","Jan Mesarč","01M6KR3KJVRMPDSMASQPBCBVK3",964,"MIT","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Flimboai\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29],"trees","c++","gdextension","use","visual","with","state","state machines","editor","behavior","when","2026-11-10 10:12:30",false,"---\nname: limboai\ndescription: Use when using the LimboAI addon — behavior trees and hierarchical state machines (C++ GDExtension) with a visual editor, BTTask subclassing, and a blackboard\n---\n\n# LimboAI\n\n> **Related skills:** **ai-navigation** for movement the tasks drive, **state-machine** for core-engine FSM (when you don't need an addon), **godot-brainstorming** for choosing an AI approach.\n\n> **Addon:** LimboAI · version `v1.8.1` · Godot 4.6+ (GDExtension) · MIT · source: https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai · written in C++ (GDExtension; engine-module build also available). GDExtension exposes GDScript; **C# requires the module build** (not GDExtension in v1.8.1), and the v1.8.1 module build targets **Godot 4.7** (4.7.2-stable builds).\n\n> **Godot 4.8:** not yet confirmed by the addon. Issue [#477](https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai\u002Fissues\u002F477) (open) reports that v1.8 does not work with 4.8's new dock system and leaves the editor unusable; the open draft PR [#474](https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai\u002Fpull\u002F474) \"Support Godot 4.8\" targets it. Keep LimboAI projects on 4.7 until a release states 4.8 support (checked 2026-11-12).\n\n---\n\n## 1. When to use LimboAI\n\n| Approach | Best for |\n|---|---|\n| Core-engine FSM (`state-machine` skill) | Simple agents, \u003C 5 states, no addon |\n| **Beehave** (GDScript addon) | Lightweight BT, GDScript-only projects |\n| **LimboAI** | BT **and** HSM together, visual editor, C++ performance, C# support (module build) |\n\nChoose LimboAI when you need a behavior tree with a polished visual debugger, want to combine it with a hierarchical state machine (`BTState` bridges them), or need C++ task execution speed. Note: LimboAI v1.8.x requires **Godot 4.6+**. On 4.4–4.5 the matching lines are 1.4.x–1.6.x, and on 4.3 it is 1.2.0–1.3.x; this skill covers neither. For a simpler GDScript-only behavior tree, Beehave is a lighter alternative. For plain state machines without a BT, use the built-in `state-machine` skill instead.\n\n---\n\n## 2. Install & setup\n\n### GDExtension (recommended — no custom engine)\n\n1. **Godot AssetLib** → search \"LimboAI\" → Download → Reload project.  \n   Or download from GitHub Releases and place `addons\u002Flimboai\u002F` in `res:\u002F\u002Faddons\u002Flimboai\u002F`.\n2. No plugin toggle: there is no `plugin.cfg` — the extension registers its editor plugin itself once the project reloads.\n3. The `.gdextension` manifest ships at `res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002F`:\n\n```ini\n[configuration]\nentry_symbol = \"limboai_init\"\ncompatibility_minimum = \"4.2\"\n\n[libraries]\nwindows.debug.x86_64   = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.windows.editor.x86_64.dll\"\nwindows.release.x86_64 = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.windows.template_release.x86_64.dll\"\nlinux.debug.x86_64     = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.linux.editor.x86_64.so\"\nlinux.release.x86_64   = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.linux.template_release.x86_64.so\"\nmacos.debug            = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.macos.editor.framework\"\nmacos.release          = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.macos.template_release.framework\"\n# ... (additional platform entries for linux arm64\u002Frv64, android, iOS, web)\n```\n\n**GDExtension limitations:** the LimboAI task palette shows no documentation tooltips (module-only in v1.8.1). The `BBParam` property editor was ported to GDExtension in 2025, although the docs still list it as missing. C# needs the module build (below).\n\n### Module version (C# or full editor integration)\n\nDownload pre-compiled editor + export templates from [GitHub Releases](https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai\u002Freleases). Requires the custom engine for export. v1.8.1 module builds are based on **Godot 4.7** (4.7.2-stable) (GDExtension supports 4.6+). The module build ships a NuGet package for C#:\n\n```ini\n# Add local NuGet source to your project:\n# dotnet nuget add source path\u002Fto\u002Fnupkgs --name LimboNugetSource\n```\n\n---\n\n## 3. Behavior trees\n\nA `BehaviorTree` resource holds the task tree. `BTPlayer` runs it each physics frame (or idle\u002Fmanual). Add `BTPlayer` as a child of the agent node and assign a `BehaviorTree` resource.\n\n### GDScript\n\n```gdscript\n# EnemyAI.gd — assign behavior_tree in the Inspector or here\nextends CharacterBody2D\n\n@onready var bt_player: BTPlayer = $BTPlayer\n\nfunc _ready() -> void:\n    # BTPlayer starts executing automatically (active = true by default).\n    # updated(status) fires after every update, not only when the tree finishes.\n    bt_player.updated.connect(_on_bt_updated)\n\nfunc _on_bt_updated(status: int) -> void:\n    if status == BT.SUCCESS:\n        # A tree that returned SUCCESS\u002FFAILURE re-enters from the root on the next\n        # update, so it loops on its own; stopping it here makes it run once.\n        # (restart() is for aborting a tree that is still running.)\n        bt_player.active = false\n```\n\n### C#\n\n```csharp\n\u002F\u002F EnemyAI.cs\nusing Godot;\n\npublic partial class EnemyAI : CharacterBody2D\n{\n    [Export] private BTPlayer _btPlayer;\n\n    public override void _Ready()\n    {\n        _btPlayer.Updated += OnBtUpdated;\n    }\n\n    private void OnBtUpdated(long status) \u002F\u002F int signal args are long in C#\n    {\n        if (status == (long)BT.Status.Success)\n            _btPlayer.Active = false; \u002F\u002F without this the finished tree loops on its own; Restart() aborts a running one\n    }\n}\n```\n\n`BTPlayer.UpdateMode` controls when the tree ticks: `IDLE` (every `_process`), `PHYSICS` (every `_physics_process`, default), or `MANUAL` (call `bt_player.update(delta)` yourself).\n\n---\n\n## 4. Custom tasks\n\nSubclass `BTAction` (multi-tick work) or `BTCondition` (immediate check). Annotate with `@tool` so `_generate_name()` and `_get_configuration_warnings()` work in the editor. Place scripts under `res:\u002F\u002Fai\u002Ftasks\u002F`; subfolders become task categories.\n\n### GDScript\n\n```gdscript\n@tool\nextends BTAction\n## Moves the agent toward a blackboard position each tick.\n\n@export var target_pos_var: StringName = &\"target_pos\"\n@export var speed: float = 200.0\n\nfunc _generate_name() -> String:\n    return \"MoveToward %s\" % LimboUtility.decorate_var(target_pos_var)\n\nfunc _setup() -> void:\n    pass  # one-time init; agent and blackboard are available here\n\nfunc _enter() -> void:\n    pass  # called when task transitions from non-RUNNING → RUNNING\n\nfunc _tick(delta: float) -> Status:\n    var target: Vector2 = blackboard.get_var(target_pos_var, Vector2.ZERO)\n    if agent.global_position.distance_to(target) \u003C 5.0:\n        return SUCCESS\n    agent.velocity = agent.global_position.direction_to(target) * speed\n    agent.move_and_slide()\n    return RUNNING\n\nfunc _exit() -> void:\n    pass  # cleanup after SUCCESS or FAILURE\n```\n\n```gdscript\n@tool\nextends BTCondition\n## Returns SUCCESS if the agent is within range of a target node.\n\n@export var target_var: StringName = &\"target\"\n@export var distance_max: float = 150.0\n\nvar _max_sq: float\n\nfunc _setup() -> void:\n    _max_sq = distance_max * distance_max\n\nfunc _tick(_delta: float) -> Status:\n    var target = blackboard.get_var(target_var, null)  # untyped: see §5\n    if not is_instance_valid(target):\n        return FAILURE\n    var in_range: bool = agent.global_position.distance_squared_to(\n        target.global_position) \u003C= _max_sq\n    return SUCCESS if in_range else FAILURE\n```\n\n### C#\n\n```csharp\n\u002F\u002F MoveTowardTask.cs — place in res:\u002F\u002Fai\u002Ftasks\u002F\nusing Godot;\n\n[Tool]\npublic partial class MoveTowardTask : BTAction\n{\n    [Export] public StringName TargetPosVar { get; set; } = \"target_pos\";\n    [Export] public float Speed { get; set; } = 200f;\n\n    public override string _GenerateName() =>\n        $\"MoveToward {LimboUtility.DecorateVar(TargetPosVar)}\";\n\n    public override void _Setup() { }\n\n    public override void _Enter() { }\n\n    public override Status _Tick(double delta)\n    {\n        var target = (Vector2)Blackboard.GetVar(TargetPosVar, Vector2.Zero);\n        var body = (CharacterBody2D)Agent;\n        if (body.GlobalPosition.DistanceTo(target) \u003C 5f)\n            return Status.Success;\n        body.Velocity = body.GlobalPosition.DirectionTo(target) * Speed;\n        body.MoveAndSlide();\n        return Status.Running;\n    }\n\n    public override void _Exit() { }\n}\n```\n\n```csharp\n\u002F\u002F InRangeCondition.cs\nusing Godot;\n\n[Tool]\npublic partial class InRangeCondition : BTCondition\n{\n    [Export] public StringName TargetVar { get; set; } = \"target\";\n    [Export] public float DistanceMax { get; set; } = 150f;\n\n    private float _maxSq;\n\n    public override void _Setup() => _maxSq = DistanceMax * DistanceMax;\n\n    public override Status _Tick(double delta)\n    {\n        var target = Blackboard.GetVar(TargetVar, default(Variant)).As\u003CNode2D>();\n        if (!GodotObject.IsInstanceValid(target))\n            return Status.Failure;\n        var agent2D = (Node2D)Agent;\n        bool inRange = agent2D.GlobalPosition.DistanceSquaredTo(\n            target.GlobalPosition) \u003C= _maxSq;\n        return inRange ? Status.Success : Status.Failure;\n    }\n}\n```\n\nTask lifecycle: `_setup()` once before first tick → `_enter()` when status transitions from non-RUNNING → `_tick(delta)` every execution → `_exit()` after SUCCESS or FAILURE.\n\n---\n\n## 5. Blackboard\n\nThe `Blackboard` is a `RefCounted` key\u002Fvalue store shared by all tasks in a tree. Use `StringName` keys (`&\"key\"`) and export them as task properties so the inspector shows a picker.\n\n### GDScript\n\n```gdscript\n@tool\nextends BTAction\n\n@export var speed_var: StringName = &\"speed\"\n@export var target_var: StringName = &\"target\"\n\nfunc _tick(delta: float) -> Status:\n    # Read with a default; use no type annotation for object vars\n    # to avoid errors if the stored instance was freed.\n    var speed: float = blackboard.get_var(speed_var, 100.0)\n    var obj = blackboard.get_var(target_var, null)\n    if not is_instance_valid(obj):\n        return FAILURE\n\n    # Write back\n    blackboard.set_var(speed_var, speed * 1.1)\n    return RUNNING\n```\n\n### C#\n\n```csharp\n\u002F\u002F C# has no generic GetVar\u003CT> — cast the returned Variant.\nusing Godot;\n\n[Tool]\npublic partial class SampleTask : BTAction\n{\n    [Export] public StringName SpeedVar { get; set; } = \"speed\";\n    [Export] public StringName TargetVar { get; set; } = \"target\";\n\n    public override Status _Tick(double delta)\n    {\n        float speed = (float)Blackboard.GetVar(SpeedVar, 100f);\n        var obj = Blackboard.GetVar(TargetVar, default(Variant)).As\u003CGodotObject>();\n        if (!GodotObject.IsInstanceValid(obj))\n            return Status.Failure;\n\n        Blackboard.SetVar(SpeedVar, speed * 1.1f);\n        return Status.Running;\n    }\n}\n```\n\nUseful `Blackboard` methods: `has_var(name)`, `erase_var(name)`, `list_vars()`, `get_vars_as_dict()`, `bind_var_to_property(name, obj, prop)`, `link_var(name, target_bb, target_name)`, `print_state()` (debug).\n\n`BlackboardPlan` defines the variable schema (types, defaults, hints) and is edited in the Inspector on `BTPlayer` or `LimboHSM`. Call `blackboard_plan.create_blackboard(scene_root)` to create a scoped `Blackboard` at runtime.\n\n---\n\n## 6. Hierarchical state machine (LimboHSM)\n\n`LimboHSM` is a `LimboState` node that manages child `LimboState` nodes. Transitions fire when a state calls `dispatch(event)`. See [references\u002Fhsm.md](references\u002Fhsm.md) for advanced patterns (any-state transitions, `BTState`, nested HSMs, guards).\n\n### GDScript — scene-tree setup\n\n```gdscript\n# Character.gd — scene tree: Character → LimboHSM → IdleState, MoveState\nextends CharacterBody2D\n\n@onready var hsm: LimboHSM = $LimboHSM\n@onready var idle: LimboState = $LimboHSM\u002FIdleState\n@onready var move: LimboState = $LimboHSM\u002FMoveState\n\nfunc _ready() -> void:\n    hsm.add_transition(idle, move, idle.EVENT_FINISHED)\n    hsm.add_transition(move, idle, move.EVENT_FINISHED)\n    hsm.initialize(self)\n    hsm.set_active(true)\n```\n\n### C# — scene-tree setup\n\n```csharp\n\u002F\u002F Character.cs\nusing Godot;\n\npublic partial class Character : CharacterBody2D\n{\n    [Export] private LimboHsm _hsm; \u002F\u002F C# name of LimboHSM\n    [Export] private LimboState _idle;\n    [Export] private LimboState _move;\n\n    public override void _Ready()\n    {\n        _hsm.AddTransition(_idle, _move, _idle.EVENTFINISHED);\n        _hsm.AddTransition(_move, _idle, _move.EVENTFINISHED);\n        _hsm.Initialize(this);\n        _hsm.SetActive(true);\n    }\n}\n```\n\n### GDScript — state script\n\n```gdscript\n# IdleState.gd\nextends LimboState\n\nfunc _setup() -> void:\n    pass  # agent and blackboard available; runs once during hsm.initialize()\n\nfunc _enter() -> void:\n    agent.get_node(\"AnimationPlayer\").play(\"idle\")\n\nfunc _exit() -> void:\n    pass\n\nfunc _update(delta: float) -> void:\n    if Input.get_vector(&\"ui_left\", &\"ui_right\", &\"ui_up\", &\"ui_down\").length() > 0.1:\n        dispatch(EVENT_FINISHED)\n```\n\n### C# — state script\n\n```csharp\n\u002F\u002F IdleState.cs\nusing Godot;\n\npublic partial class IdleState : LimboState\n{\n    public override void _Setup() { }\n\n    public override void _Enter()\n    {\n        Agent.GetNode\u003CAnimationPlayer>(\"AnimationPlayer\").Play(\"idle\");\n    }\n\n    public override void _Exit() { }\n\n    public override void _Update(double delta)\n    {\n        if (Input.GetVector(\"ui_left\", \"ui_right\", \"ui_up\", \"ui_down\").Length() > 0.1f)\n            Dispatch(EVENTFINISHED);\n    }\n}\n```\n\n---\n\n## Implementation checklist\n\n- [ ] `BTPlayer` added as a child of the agent; `behavior_tree` resource assigned\n- [ ] Custom tasks annotated with `@tool` (GDScript) or `[Tool]` (C#) for editor display\n- [ ] Every `_tick` returns `SUCCESS`, `FAILURE`, or `RUNNING` — never `void`\u002F`null`\n- [ ] Blackboard keys documented as exported `StringName` properties (suffix `_var`)\n- [ ] C# Blackboard reads cast the `Variant` explicitly (`(float)Blackboard.GetVar(...)`)\n- [ ] C# uses module build (not GDExtension) for C# support\n- [ ] `BTPlayer.updated` signal used (not deprecated `behavior_tree_finished`)\n- [ ] HSM: all `LimboState` nodes wired with `add_transition` before `initialize()`\n- [ ] HSM: `set_active(true)` called after `initialize()`\n- [ ] HSM transitions are exhaustive — every reachable state has an exit path\n","# LimboAI\n\n> **Related skills:** **ai-navigation** for movement the tasks drive, **state-machine** for core-engine FSM (when you don't need an addon), **godot-brainstorming** for choosing an AI approach.\n\n> **Addon:** LimboAI · version `v1.8.1` · Godot 4.6+ (GDExtension) · MIT · source: https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai · written in C++ (GDExtension; engine-module build also available). GDExtension exposes GDScript; **C# requires the module build** (not GDExtension in v1.8.1), and the v1.8.1 module build targets **Godot 4.7** (4.7.2-stable builds).\n\n> **Godot 4.8:** not yet confirmed by the addon. Issue [#477](https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai\u002Fissues\u002F477) (open) reports that v1.8 does not work with 4.8's new dock system and leaves the editor unusable; the open draft PR [#474](https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai\u002Fpull\u002F474) \"Support Godot 4.8\" targets it. Keep LimboAI projects on 4.7 until a release states 4.8 support (checked 2026-11-12).\n\n---\n\n## 1. When to use LimboAI\n\n| Approach | Best for |\n|---|---|\n| Core-engine FSM (`state-machine` skill) | Simple agents, \u003C 5 states, no addon |\n| **Beehave** (GDScript addon) | Lightweight BT, GDScript-only projects |\n| **LimboAI** | BT **and** HSM together, visual editor, C++ performance, C# support (module build) |\n\nChoose LimboAI when you need a behavior tree with a polished visual debugger, want to combine it with a hierarchical state machine (`BTState` bridges them), or need C++ task execution speed. Note: LimboAI v1.8.x requires **Godot 4.6+**. On 4.4–4.5 the matching lines are 1.4.x–1.6.x, and on 4.3 it is 1.2.0–1.3.x; this skill covers neither. For a simpler GDScript-only behavior tree, Beehave is a lighter alternative. For plain state machines without a BT, use the built-in `state-machine` skill instead.\n\n---\n\n## 2. Install & setup\n\n### GDExtension (recommended — no custom engine)\n\n1. **Godot AssetLib** → search \"LimboAI\" → Download → Reload project.  \n   Or download from GitHub Releases and place `addons\u002Flimboai\u002F` in `res:\u002F\u002Faddons\u002Flimboai\u002F`.\n2. No plugin toggle: there is no `plugin.cfg` — the extension registers its editor plugin itself once the project reloads.\n3. The `.gdextension` manifest ships at `res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002F`:\n\n```ini\n[configuration]\nentry_symbol = \"limboai_init\"\ncompatibility_minimum = \"4.2\"\n\n[libraries]\nwindows.debug.x86_64   = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.windows.editor.x86_64.dll\"\nwindows.release.x86_64 = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.windows.template_release.x86_64.dll\"\nlinux.debug.x86_64     = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.linux.editor.x86_64.so\"\nlinux.release.x86_64   = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.linux.template_release.x86_64.so\"\nmacos.debug            = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.macos.editor.framework\"\nmacos.release          = \"res:\u002F\u002Faddons\u002Flimboai\u002Fbin\u002Fliblimboai.macos.template_release.framework\"\n# ... (additional platform entries for linux arm64\u002Frv64, android, iOS, web)\n```\n\n**GDExtension limitations:** the LimboAI task palette shows no documentation tooltips (module-only in v1.8.1). The `BBParam` property editor was ported to GDExtension in 2025, although the docs still list it as missing. C# needs the module build (below).\n\n### Module version (C# or full editor integration)\n\nDownload pre-compiled editor + export templates from [GitHub Releases](https:\u002F\u002Fgithub.com\u002Flimbonaut\u002Flimboai\u002Freleases). Requires the custom engine for export. v1.8.1 module builds are based on **Godot 4.7** (4.7.2-stable) (GDExtension supports 4.6+). The module build ships a NuGet package for C#:\n\n```ini\n# Add local NuGet source to your project:\n# dotnet nuget add source path\u002Fto\u002Fnupkgs --name LimboNugetSource\n```\n\n---\n\n## 3. Behavior trees\n\nA `BehaviorTree` resource holds the task tree. `BTPlayer` runs it each physics frame (or idle\u002Fmanual). Add `BTPlayer` as a child of the agent node and assign a `BehaviorTree` resource.\n\n### GDScript\n\n```gdscript\n# EnemyAI.gd — assign behavior_tree in the Inspector or here\nextends CharacterBody2D\n\n@onready var bt_player: BTPlayer = $BTPlayer\n\nfunc _ready() -> void:\n    # BTPlayer starts executing automatically (active = true by default).\n    # updated(status) fires after every update, not only when the tree finishes.\n    bt_player.updated.connect(_on_bt_updated)\n\nfunc _on_bt_updated(status: int) -> void:\n    if status == BT.SUCCESS:\n        # A tree that returned SUCCESS\u002FFAILURE re-enters from the root on the next\n        # update, so it loops on its own; stopping it here makes it run once.\n        # (restart() is for aborting a tree that is still running.)\n        bt_player.active = false\n```\n\n### C#\n\n```csharp\n\u002F\u002F EnemyAI.cs\nusing Godot;\n\npublic partial class EnemyAI : CharacterBody2D\n{\n    [Export] private BTPlayer _btPlayer;\n\n    public override void _Ready()\n    {\n        _btPlayer.Updated += OnBtUpdated;\n    }\n\n    private void OnBtUpdated(long status) \u002F\u002F int signal args are long in C#\n    {\n        if (status == (long)BT.Status.Success)\n            _btPlayer.Active = false; \u002F\u002F without this the finished tree loops on its own; Restart() aborts a running one\n    }\n}\n```\n\n`BTPlayer.UpdateMode` controls when the tree ticks: `IDLE` (every `_process`), `PHYSICS` (every `_physics_process`, default), or `MANUAL` (call `bt_player.update(delta)` yourself).\n\n---\n\n## 4. Custom tasks\n\nSubclass `BTAction` (multi-tick work) or `BTCondition` (immediate check). Annotate with `@tool` so `_generate_name()` and `_get_configuration_warnings()` work in the editor. Place scripts under `res:\u002F\u002Fai\u002Ftasks\u002F`; subfolders become task categories.\n\n### GDScript\n\n```gdscript\n@tool\nextends BTAction\n## Moves the agent toward a blackboard position each tick.\n\n@export var target_pos_var: StringName = &\"target_pos\"\n@export var speed: float = 200.0\n\nfunc _generate_name() -> String:\n    return \"MoveToward %s\" % LimboUtility.decorate_var(target_pos_var)\n\nfunc _setup() -> void:\n    pass  # one-time init; agent and blackboard are available here\n\nfunc _enter() -> void:\n    pass  # called when task transitions from non-RUNNING → RUNNING\n\nfunc _tick(delta: float) -> Status:\n    var target: Vector2 = blackboard.get_var(target_pos_var, Vector2.ZERO)\n    if agent.global_position.distance_to(target) \u003C 5.0:\n        return SUCCESS\n    agent.velocity = agent.global_position.direction_to(target) * speed\n    agent.move_and_slide()\n    return RUNNING\n\nfunc _exit() -> void:\n    pass  # cleanup after SUCCESS or FAILURE\n```\n\n```gdscript\n@tool\nextends BTCondition\n## Returns SUCCESS if the agent is within range of a target node.\n\n@export var target_var: StringName = &\"target\"\n@export var distance_max: float = 150.0\n\nvar _max_sq: float\n\nfunc _setup() -> void:\n    _max_sq = distance_max * distance_max\n\nfunc _tick(_delta: float) -> Status:\n    var target = blackboard.get_var(target_var, null)  # untyped: see §5\n    if not is_instance_valid(target):\n        return FAILURE\n    var in_range: bool = agent.global_position.distance_squared_to(\n        target.global_position) \u003C= _max_sq\n    return SUCCESS if in_range else FAILURE\n```\n\n### C#\n\n```csharp\n\u002F\u002F MoveTowardTask.cs — place in res:\u002F\u002Fai\u002Ftasks\u002F\nusing Godot;\n\n[Tool]\npublic partial class MoveTowardTask : BTAction\n{\n    [Export] public StringName TargetPosVar { get; set; } = \"target_pos\";\n    [Export] public float Speed { get; set; } = 200f;\n\n    public override string _GenerateName() =>\n        $\"MoveToward {LimboUtility.DecorateVar(TargetPosVar)}\";\n\n    public override void _Setup() { }\n\n    public override void _Enter() { }\n\n    public override Status _Tick(double delta)\n    {\n        var target = (Vector2)Blackboard.GetVar(TargetPosVar, Vector2.Zero);\n        var body = (CharacterBody2D)Agent;\n        if (body.GlobalPosition.DistanceTo(target) \u003C 5f)\n            return Status.Success;\n        body.Velocity = body.GlobalPosition.DirectionTo(target) * Speed;\n        body.MoveAndSlide();\n        return Status.Running;\n    }\n\n    public override void _Exit() { }\n}\n```\n\n```csharp\n\u002F\u002F InRangeCondition.cs\nusing Godot;\n\n[Tool]\npublic partial class InRangeCondition : BTCondition\n{\n    [Export] public StringName TargetVar { get; set; } = \"target\";\n    [Export] public float DistanceMax { get; set; } = 150f;\n\n    private float _maxSq;\n\n    public override void _Setup() => _maxSq = DistanceMax * DistanceMax;\n\n    public override Status _Tick(double delta)\n    {\n        var target = Blackboard.GetVar(TargetVar, default(Variant)).As\u003CNode2D>();\n        if (!GodotObject.IsInstanceValid(target))\n            return Status.Failure;\n        var agent2D = (Node2D)Agent;\n        bool inRange = agent2D.GlobalPosition.DistanceSquaredTo(\n            target.GlobalPosition) \u003C= _maxSq;\n        return inRange ? Status.Success : Status.Failure;\n    }\n}\n```\n\nTask lifecycle: `_setup()` once before first tick → `_enter()` when status transitions from non-RUNNING → `_tick(delta)` every execution → `_exit()` after SUCCESS or FAILURE.\n\n---\n\n## 5. Blackboard\n\nThe `Blackboard` is a `RefCounted` key\u002Fvalue store shared by all tasks in a tree. Use `StringName` keys (`&\"key\"`) and export them as task properties so the inspector shows a picker.\n\n### GDScript\n\n```gdscript\n@tool\nextends BTAction\n\n@export var speed_var: StringName = &\"speed\"\n@export var target_var: StringName = &\"target\"\n\nfunc _tick(delta: float) -> Status:\n    # Read with a default; use no type annotation for object vars\n    # to avoid errors if the stored instance was freed.\n    var speed: float = blackboard.get_var(speed_var, 100.0)\n    var obj = blackboard.get_var(target_var, null)\n    if not is_instance_valid(obj):\n        return FAILURE\n\n    # Write back\n    blackboard.set_var(speed_var, speed * 1.1)\n    return RUNNING\n```\n\n### C#\n\n```csharp\n\u002F\u002F C# has no generic GetVar\u003CT> — cast the returned Variant.\nusing Godot;\n\n[Tool]\npublic partial class SampleTask : BTAction\n{\n    [Export] public StringName SpeedVar { get; set; } = \"speed\";\n    [Export] public StringName TargetVar { get; set; } = \"target\";\n\n    public override Status _Tick(double delta)\n    {\n        float speed = (float)Blackboard.GetVar(SpeedVar, 100f);\n        var obj = Blackboard.GetVar(TargetVar, default(Variant)).As\u003CGodotObject>();\n        if (!GodotObject.IsInstanceValid(obj))\n            return Status.Failure;\n\n        Blackboard.SetVar(SpeedVar, speed * 1.1f);\n        return Status.Running;\n    }\n}\n```\n\nUseful `Blackboard` methods: `has_var(name)`, `erase_var(name)`, `list_vars()`, `get_vars_as_dict()`, `bind_var_to_property(name, obj, prop)`, `link_var(name, target_bb, target_name)`, `print_state()` (debug).\n\n`BlackboardPlan` defines the variable schema (types, defaults, hints) and is edited in the Inspector on `BTPlayer` or `LimboHSM`. Call `blackboard_plan.create_blackboard(scene_root)` to create a scoped `Blackboard` at runtime.\n\n---\n\n## 6. Hierarchical state machine (LimboHSM)\n\n`LimboHSM` is a `LimboState` node that manages child `LimboState` nodes. Transitions fire when a state calls `dispatch(event)`. See [references\u002Fhsm.md](references\u002Fhsm.md) for advanced patterns (any-state transitions, `BTState`, nested HSMs, guards).\n\n### GDScript — scene-tree setup\n\n```gdscript\n# Character.gd — scene tree: Character → LimboHSM → IdleState, MoveState\nextends CharacterBody2D\n\n@onready var hsm: LimboHSM = $LimboHSM\n@onready var idle: LimboState = $LimboHSM\u002FIdleState\n@onready var move: LimboState = $LimboHSM\u002FMoveState\n\nfunc _ready() -> void:\n    hsm.add_transition(idle, move, idle.EVENT_FINISHED)\n    hsm.add_transition(move, idle, move.EVENT_FINISHED)\n    hsm.initialize(self)\n    hsm.set_active(true)\n```\n\n### C# — scene-tree setup\n\n```csharp\n\u002F\u002F Character.cs\nusing Godot;\n\npublic partial class Character : CharacterBody2D\n{\n    [Export] private LimboHsm _hsm; \u002F\u002F C# name of LimboHSM\n    [Export] private LimboState _idle;\n    [Export] private LimboState _move;\n\n    public override void _Ready()\n    {\n        _hsm.AddTransition(_idle, _move, _idle.EVENTFINISHED);\n        _hsm.AddTransition(_move, _idle, _move.EVENTFINISHED);\n        _hsm.Initialize(this);\n        _hsm.SetActive(true);\n    }\n}\n```\n\n### GDScript — state script\n\n```gdscript\n# IdleState.gd\nextends LimboState\n\nfunc _setup() -> void:\n    pass  # agent and blackboard available; runs once during hsm.initialize()\n\nfunc _enter() -> void:\n    agent.get_node(\"AnimationPlayer\").play(\"idle\")\n\nfunc _exit() -> void:\n    pass\n\nfunc _update(delta: float) -> void:\n    if Input.get_vector(&\"ui_left\", &\"ui_right\", &\"ui_up\", &\"ui_down\").length() > 0.1:\n        dispatch(EVENT_FINISHED)\n```\n\n### C# — state script\n\n```csharp\n\u002F\u002F IdleState.cs\nusing Godot;\n\npublic partial class IdleState : LimboState\n{\n    public override void _Setup() { }\n\n    public override void _Enter()\n    {\n        Agent.GetNode\u003CAnimationPlayer>(\"AnimationPlayer\").Play(\"idle\");\n    }\n\n    public override void _Exit() { }\n\n    public override void _Update(double delta)\n    {\n        if (Input.GetVector(\"ui_left\", \"ui_right\", \"ui_up\", \"ui_down\").Length() > 0.1f)\n            Dispatch(EVENTFINISHED);\n    }\n}\n```\n\n---\n\n## Implementation checklist\n\n- [ ] `BTPlayer` added as a child of the agent; `behavior_tree` resource assigned\n- [ ] Custom tasks annotated with `@tool` (GDScript) or `[Tool]` (C#) for editor display\n- [ ] Every `_tick` returns `SUCCESS`, `FAILURE`, or `RUNNING` — never `void`\u002F`null`\n- [ ] Blackboard keys documented as exported `StringName` properties (suffix `_var`)\n- [ ] C# Blackboard reads cast the `Variant` explicitly (`(float)Blackboard.GetVar(...)`)\n- [ ] C# uses module build (not GDExtension) for C# support\n- [ ] `BTPlayer.updated` signal used (not deprecated `behavior_tree_finished`)\n- [ ] HSM: all `LimboState` nodes wired with `add_transition` before `initialize()`\n- [ ] HSM: `set_active(true)` called after `initialize()`\n- [ ] HSM transitions are exhaustive — every reachable state has an exit path\n",{"name":5,"description":7},"master","60c28fdc40706a24576731e9fb3508b9c95258ad","skills\u002Flimboai",63,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter","https:\u002F\u002Fgithub.com\u002Fjame581","https:\u002F\u002Fjanmesarc.online\u002F","Software engineer. My biggest passion is game development.","2026-11-14 20:45:49",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add jame581\u002FGodotPrompter --skill limboai",{"tool":50,"command":51},"bunx","bunx skills add jame581\u002FGodotPrompter --skill limboai",{"tool":53,"command":54},"pnpm","pnpm dlx skills add jame581\u002FGodotPrompter --skill limboai","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Flimboai\u002FSKILL.md",true,[58],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fhsm.md","REFERENCE","参考文档",6152,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Flimboai\u002Freferences\u002Fhsm.md",[65,85,106,136,159,177],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":30},"01M6KRFE5BR2PSD08ZKDAS66R7","xr-development","Use when building VR\u002FAR\u002FXR applications — OpenXR setup, XROrigin3D, hand tracking, controllers, passthrough, and Meta Quest deployment in Godot 4.3+","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fxr-development\u002FSKILL.md",[],[72,73,29,74,75,76,77,78,79,80,81,22,82,83,84],"xr development","development","deployment","godot","vr","setup","tracking","godot 4","ar","hand","Meta","applications","quest",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":30},"01M6KRF8GZTG1TAS506MFBSGFC","web-services","Use when a Godot game calls a web server — HTTPRequest, downloads, REST\u002FJSON APIs, auth headers, WebSocketPeer clients, TLS, retries, and keeping secrets out of the build. Not for game networking\u002FRPCs (multiplayer-basics) or browser export (web-export)","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-services\u002FSKILL.md",[],[92,93,94,95,96,97,98,99,22,29,75,100,101,102,103,104,105],"web services","web","services","tls","retries","calling","auth","downloads","clients","headers","secrets","json","build","REST",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":117,"publishedAt":30},"01M6KRF38Q4WSKAYFS56PG87T0","web-export","Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",[112],{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[93,118,119,120,121,122,123,124,101,125,126,29,127,128,129,130,131,132,22,133,134,135],"export","web export","threads","limits","shipping","size","options","hosting","input","Coop","preset","browser","game","io","load","pwa","Audio","server",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":150,"publishedAt":30},"01M6KREYFETEBH62ZTN6EZH2X3","using-godot-prompter","Bootstrap skill — establishes how to find and use GodotPrompter skills, with platform-specific tool mapping","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fusing-godot-prompter\u002FSKILL.md",[142,145],{"categoryNo":143,"categoryName":144,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":146,"categoryName":147,"taxonomyType":148,"taxonomyTypeDesc":149},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[75,151,152,24,153,22,154,155,156,157,158],"using godot prompter","find","bootstrap","tool","platform","mapping","how","how to",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":30},"01M6KRER5G7EQWKGAFN8QJKQ69","tween-animation","Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI\u002Fgameplay motion recipes","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Ftween-animation\u002FSKILL.md",[],[166,167,22,168,169,170,171,172,173,174,175,29,176],"tween animation","Animation","motion","parallel","gameplay","chaining","ui","recipes","common","implementing","sequences",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":30},"01M6KREKGCQMVDV8WX7HWX8BZG","state-machine","Use when building a state machine or refactoring logic into one — enum, node, and resource-based FSM patterns with trade-offs. Not for adding states to an existing one","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[25,184,185,75,29,186,187,188,26,189,24,22,175,190],"state machine","machine","patterns","node","fsm","trade","trade-offs"]