User Tools

Site Tools


dragengine:modules:dragonscript:behavior_interactionspot

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_interactionspot [2025/03/13 17:13] dragonlorddragengine:modules:dragonscript:behavior_interactionspot [2025/05/04 13:47] (current) – [interactionSpot.check] dragonlord
Line 60: Line 60:
  
 ===== spotReleased ===== ===== spotReleased =====
 +
 +Occupier has release spot.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace ''interactionSpot'' with ''interactionSpot(id)''.
 +
 +===== interactionSpot.release =====
 +
 +Release occupied if one interaction spot is not empty.
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='interactionSpot.release'/>
 +</code>
 +
 +===== interactionSpot.check =====
 +
 +Check one or more interaction spot parameters. Action succeeds if all parameter value matches their respective interaction spot parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a interaction spot parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|empty|''true'', ''false''|Interaction spot is empty, hence not occupied by an occupier|
 +|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:
 +<code xml>
 +<sequence>
 +  <action name='interactionSpot.check'>
 +    <parameter name='empty'>true</parameter>
 +  </action>
 +  <!-- actions here run only if interaction spot is empty, hence not occupied by an occupier -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace ''interactionSpot'' with ''interactionSpot(id)''.
 +
 +===== interactionSpot.check =====
 +
 +Check one or more interaction spot parameters. Conditions returns true if all parameter value match their respective interaction spot parameter. This condition is typically used to run an action or sequence of actions as long as interaction spot conditions are true.
 +
 +^Parameter^Value^Description^
 +|interactionSpot.empty|''true'', ''false''|Interaction spot is empty, hence not occupied by an occupier|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='interactionSpot.empty'>true</parameter>
 +  <condition>interactionSpot.check</condition>
 +</action>
 +</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 ''interactionSpot'' with ''interactionSpot(id)''.
 +
 +===== interactionSpot.claimed =====
 +
 +Occupier has claimed spot.
 +
 +===== interactionSpot.released =====
  
 Occupier has release spot. Occupier has release spot.
Line 69: Line 139:
 ====== Optional Behaviors ====== ====== Optional Behaviors ======
  
-This behavior does not support optional behaviors.+  * [[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 76: Line 147:
  
 ====== API Documentation ====== ====== API Documentation ======
 +
 #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorInteractionSpot.html,ECBehaviorInteractionSpot~@#. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorInteractionSpot.html,ECBehaviorInteractionSpot~@#.
  
Line 126: Line 198:
      
   <behavior type='ECBehaviorInteractionSpot'>   <behavior type='ECBehaviorInteractionSpot'>
 +    <!-- 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 -->
     <vector name='.lookAt' x='0' y='0.2' z='0.5'/>     <vector name='.lookAt' x='0' y='0.2' z='0.5'/>
dragengine/modules/dragonscript/behavior_interactionspot.1741886014.txt.gz · Last modified: 2025/03/13 17:13 by dragonlord