User Tools

Site Tools


dragengine:modules:dragonscript:behavior_behaviortree

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_behaviortree [2026/10/11 01:34] – dragonlorddragengine:modules:dragonscript:behavior_behaviortree [2026/10/11 15:05] (current) – dragonlord
Line 76: Line 76:
  
 This behavior adds these behavior tree actions. This behavior adds these behavior tree actions.
 +
 +===== element.set =====
 +
 +Set owner element parameters.
 +
 +^Parameter^Value^Description^
 +|visible|true,false|Set if element is visible.|
 +|touchable|true,false|Set if element is touchable.|
 +
 +This is an example of using this action to fully hide the owner element:
 +<code xml>
 +<action name='element.set'>
 +  <parameter name='visible'>false</parameter>
 +  <parameter name='touchable'>false</parameter>
 +</action>
 +</code>
 +
 +
 +===== 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='element.set'>
 +  <parameter name='dispose'/>
 +</action>
 +</code>
  
 ===== gameWorld ===== ===== 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 ''behaviorElement'' set to the behavior element owning the state machine. If the element owning this behavior is not in a game world or the action can not be found, nothing is done.+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 ''element'' set to the behavior element owning the state machine. If the element owning this behavior is not in a game world or the action can not be found, nothing is done.
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
Line 97: Line 129:
  
 This behavior adds these behavior tree conditions. This behavior adds these behavior tree conditions.
 +
 +===== element.check =====
 +
 +Evaluate owner element parameters.
 +
 +^Parameter^Value^Description^
 +|element.visible|true,false|Element is visible or not.|
 +|element.touchable|true,false|Element is touchable or not.|
 +|element.inGameWorld|true,false|Element is located in game world or not.|
 +|element.hasParent|true,false|Element is parented to another element or not.|
 +
 +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='myAction' id='doing something'>
 +  <condition>element.check</condition>
 +  <parameter name='element.visible'>true</parameter>
 +  <parameter name='element.touchable'>true</parameter>
 +  <parameter name='element.inGameWorld'>true</parameter>
 +  <parameter name='element.hasParent'>false</parameter>
 +</action>
 +</code>
  
 ===== gameWorld ===== ===== 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 ''behaviorElement'' set to the behavior element owning the state machine. If the element owning this behavior is not in a game world or the condition can not be found, false is returned.+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 ''element'' set to the behavior element owning the state machine. If the element owning this behavior is not in a game world or the condition can not be found, false is returned.
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
dragengine/modules/dragonscript/behavior_behaviortree.1791682445.txt.gz · Last modified: by dragonlord