repair_behavior_tree
Repair a corrupted UE5 Behavior Tree asset so it opens in the BT editor. Use non-destructive GUID rescue first to fix invalid NodeGuids, or a destructive rebuild as a last resort.
Instructions
Repair a corrupted Behavior Tree asset so it can be opened in the UE5 BT editor.
Two modes:
• fix_guids_only=True — non-destructive GUID rescue (try this FIRST). Walks every graph node and sub-node, assigning a fresh NodeGuid to any with an invalid (all-zero) one. Tree structure, classes, pins, decorators, services, and runtime properties are all preserved. This is the right choice for BT assets written by pre-BUG-043 plugin builds (their graph nodes have all-zero NodeGuids, which cause the BT editor to crash at 0x68 on open because its internal widget lookups key on NodeGuid).
• fix_guids_only=False (default) — destructive rebuild. Wipes all non-Root graph nodes and saves an empty Root-only BT. Use this ONLY if fix_guids_only=True did not resolve the crash — you will then need build_behavior_tree to repopulate the tree.
Args: behavior_tree_name: Name of the BT asset to repair (e.g. "BT_Enemy_Infantry") fix_guids_only: If True, only fill in missing NodeGuids (non-destructive). Default False (destructive).
Returns: Dict with 'success', 'behavior_tree', 'mode', plus • fix_guids_only: 'guids_fixed', 'guids_already_valid', 'node_count' • destructive: 'node_count_after_repair'
KB: see knowledge_base/04_AI_SYSTEMS.md#overview Example: repair_behavior_tree(behavior_tree_name="ExampleName")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fix_guids_only | No | ||
| behavior_tree_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |