User Tools

Site Tools


dragengine:modules:dragonscript:behavior_grabber

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_grabber [2025/05/02 13:39] dragonlorddragengine:modules:dragonscript:behavior_grabber [2025/05/13 14:05] (current) dragonlord
Line 77: Line 77:
  
 Grabber enabled changed. Grabber enabled changed.
 +
 ====== Behavior Tree Actions ====== ====== Behavior Tree Actions ======
  
Line 95: Line 96:
 </code> </code>
  
-===== grabber.release =====+===== grabber.update =====
  
-Release grab spot if grabbing one.+Update grabber. 
 + 
 +^Parameter^Value^Description^ 
 +|release| |Release grab spot if grabbing one.
 +|interactElement.assign|string|Assign grab spot element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if no element is grabbed or interact element behavior is absent| 
 +|interact|string|Interact with grab spot. If element is absent action fails. Runs interaction with name value. If interaction with name value is absent fails action. If interaction returns false fails action. Otherwise action succeeds.| 
 +|interact.parameters|string|Optional parameters to use with ''interaction''.|
  
 This is an example of using this action: This is an example of using this action:
 <code xml> <code xml>
-<action name='grabber.release'/>+<action name='grabber.update'> 
 +  <parameter name='release'/
 +</action>
 </code> </code>
  
Line 109: Line 118:
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Grabber is enabled|
 |grabbing|''true'', ''false''|Grabber is grabbing a grab spot| |grabbing|''true'', ''false''|Grabber is grabbing a grab spot|
 +|interact.name|string|Name of interaction|
 +|interact.has|''true'', ''false''|Has grab spot and interaction with name ''interaction.name'' is present|
 +|interact.query|''true'', ''false''|Interact with grab spot and test result. Condition is true if grab spot is present, interaction with name ''interaction.name'' is present and interaction returns true. It is recommended to use here only interactions without side effects (hence query interactions).|
 +|interact.parameters|string|Optional parameters to use with ''interaction.query''.|
 +|wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled|
  
 This is an example of using this action: This is an example of using this action:
Line 130: Line 145:
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 +|grabber.enabled|''true'', ''false''|Grabber is enabled|
 |grabber.grabbing|''true'', ''false''|Grabber is grabbing a grab spot| |grabber.grabbing|''true'', ''false''|Grabber is grabbing a grab spot|
 +|grabber.interact.name|string|Name of interaction|
 +|grabber.interact.has|''true'', ''false''|Has grab spot and interaction with name ''interaction.name'' is present|
 +|grabber.interact.query|''true'', ''false''|Interact with grab spot and test result. Condition is true if grab spot is present, interaction with name ''interaction.name'' is present and interaction returns true. It is recommended to use here only interactions without side effects (hence query interactions).|
 +|grabber.interact.parameters|string|Optional parameters to use with ''interaction.query''.|
  
 This is an example of using this condition: This is an example of using this condition:
Line 139: Line 159:
 </action> </action>
 </code> </code>
 +
 +====== State Machine Actions ======
 +
 +Same as [[#behavior_tree_actions|Behavior Tree Actions]].
 +
 +====== State Machine Conditions ======
 +
 +Same as [[#behavior_tree_conditions|Behavior Tree Conditions]].
 +
 +====== State Machine Events ======
 +
 +This behavior sends these state machine events. If behavior has non-empty identifier replace ''grabber'' with ''grabber(id)''.
 +
 +===== grabber.enabled =====
 +
 +Grabber has been enabled.
 +
 +===== grabber.disabled =====
 +
 +Grabber has been disabled.
 +
 +===== grabber.grabbed =====
 +
 +Grabber grabbed grab spot.
 +
 +===== grabber.released =====
 +
 +Grabber released grab spot.
 +
 +===== grabber.touch =====
 +
 +Start touching grab spot.
 +
 +===== grabber.untouch =====
 +
 +Stop touching grab spot.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 149: Line 205:
   * [[behavior_vrhand|ECBehaviorVRHand]]: If used attaches grab spot touch collider to VR hand collider   * [[behavior_vrhand|ECBehaviorVRHand]]: If used attaches grab spot touch collider to VR hand collider
   * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.   * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.
 +  * [[behavior_statemachine|ECBehaviorStateMachine]]: Add actions and conditions for state machine to use and events to send to the state machine.
  
 ====== Persistency ====== ====== Persistency ======
Line 214: Line 271:
                    are a list of bits to set. -->                    are a list of bits to set. -->
     <string name='collisionFilter'>4:1 2</string>     <string name='collisionFilter'>4:1 2</string>
 +    
 +    <!-- optional: use behavior tree with id instead of empty string -->
 +    <string name='behaviorTree'>second</string>
 +    
 +    <!-- optional: use state machine with id instead of empty string -->
 +    <string name='stateMachine'>second</string>
          
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
dragengine/modules/dragonscript/behavior_grabber.1746193172.txt.gz · Last modified: 2025/05/02 13:39 by dragonlord