This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dragengine:modules:dragonscript:behavior_behaviortree [2025/05/16 14:34] – dragonlord | dragengine:modules:dragonscript:behavior_behaviortree [2026/10/11 15:05] (current) – dragonlord | ||
|---|---|---|---|
| Line 71: | Line 71: | ||
| ===== behaviorTreeRestarted ===== | ===== behaviorTreeRestarted ===== | ||
| Behavior tree has been restarted. | Behavior tree has been restarted. | ||
| + | |||
| + | |||
| + | ====== Behavior Tree Actions ====== | ||
| + | |||
| + | This behavior adds these behavior tree actions. | ||
| + | |||
| + | ===== element.set ===== | ||
| + | |||
| + | Set owner element parameters. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |visible|true, | ||
| + | |touchable|true, | ||
| + | |||
| + | This is an example of using this action to fully hide the owner element: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== element.update ===== | ||
| + | |||
| + | Update owner element. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |dispose| |Dispose of owner element. Make sure this is the last action run in a transition or state. Running actions afterwards can lead to problems.| | ||
| + | |log|string|Print a log message using Element.log() function.| | ||
| + | |||
| + | This is an example of using this action to dispose element: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== gameWorld ===== | ||
| + | |||
| + | Runs action from game world behavior [[gwbehavior_btsm|GWBehaviorBTSM]]. Game world behaviors can add behavior tree actions to GWBehaviorBTSM similar to how element class behaviors can add behavior tree actions to this behavior. This allows behavior trees to access actions specific to a game world. The action is run as if it has been added to this behavior. All parameters defined in the action are passed to the game world actionndition with the addition of the parameter '' | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |action|string|Name of action to run.| | ||
| + | |||
| + | This is an example of using this action to spawn a new element: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ====== Behavior Tree Conditions ====== | ||
| + | |||
| + | This behavior adds these behavior tree conditions. | ||
| + | |||
| + | ===== element.check ===== | ||
| + | |||
| + | Evaluate owner element parameters. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |element.visible|true, | ||
| + | |element.touchable|true, | ||
| + | |element.inGameWorld|true, | ||
| + | |element.hasParent|true, | ||
| + | |||
| + | This is an example of using this condition to check if the element is visible, touchable, in a game world and not parented to another element: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== gameWorld ===== | ||
| + | |||
| + | Evaluate condition from game world behavior [[gwbehavior_btsm|GWBehaviorBTSM]]. Game world behaviors can add behavior tree conditions to GWBehaviorBTSM similar to how element class behaviors can add behavior tree conditions to this behavior. This allows behavior trees to access conditions specific to a game world. The condition is evaluated as if it has been added to this behavior. All parameters defined in the condition are passed to the game world condition with the addition of the parameter '' | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |gameWorld.condition|string|Name of condition to evaluate.| | ||
| + | |||
| + | This is an example of using this condition to evaluate a game state: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| ====== Required Behaviors ====== | ====== Required Behaviors ====== | ||