User Tools

Site Tools


dragengine:modules:dragonscript:behavior_colliderai

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_colliderai [2025/03/13 17:09] dragonlorddragengine:modules:dragonscript:behavior_colliderai [2025/05/11 13:17] (current) – [colliderAI.update] dragonlord
Line 40: Line 40:
  
 Collider changed. Collider changed.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== colliderAI.set =====
 +
 +Set one or more collider ai parameters.
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Enable collider|
 +|gravity|vector3|Set gravity|
 +|shape|''humanoid''|Set collider shape. Requires additional parameters|
 +|shape.radius|float|Set radius in meters of humanoid shape|
 +|shape.height|float|Set height in meters of humanoid shape|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='colliderAI.set'>
 +  <parameter name='shape'>humanoid</parameter>
 +  <parameter name='shape.radius'>0.3</parameter>
 +  <parameter name='shape.height'>1.8</parameter>
 +</action>
 +</code>
 +
 +===== colliderAI.update =====
 +
 +Update collider ai.
 +
 +^Parameter^Value^Description^
 +|gravity.apply| |Apply gravity to linear velocity of collider|
 +|geometryFromCollider| |Set element position and orientation from collider|
 +|stop.turning| |Clear angular velocity of collider|
 +|stop.moving| |Clear linear velocity of collider|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='colliderAI.set'>
 +  <parameter name='gravity.apply'/>
 +</action>
 +</code>
 +
 +===== colliderAI.collision =====
 +
 +Handle collisions.
 +
 +^Parameter^Value^Description^
 +|stop| |Stop collider from moving. Prevents any further collision in this frame update.|
 +|sliding| |Applies sliding collision response|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='colliderAI.collision'>
 +  <parameter name='sliding'/>
 +</action>
 +</code>
 +
 +===== colliderAI.check =====
 +
 +Check one or more collider ai parameters. Action succeeds if all parameter value matches their respective collider ai parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a collider ai parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Collider is enabled|
 +|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='colliderAI.check'>
 +    <parameter name='enabled'>true</parameter>
 +  </action>
 +  <!-- actions here run only if collider ai is enabled -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== colliderAI.check =====
 +
 +Check one or more collider ai parameters. Conditions returns true if all parameter value match their respective collider ai parameter. This condition is typically used to run an action or sequence of actions as long as collider ai conditions are true.
 +
 +^Parameter^Value^Description^
 +|colliderAI.enabled|''true'', ''false''|Collider is enabled|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='colliderAI.enabled'>true</parameter>
 +  <condition>colliderAI.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 no state machine events.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 47: Line 152:
 ====== 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 100: Line 206:
                    are a list of bits to set. -->                    are a list of bits to set. -->
     <string name='collisionFilter'>3:0 1 2 3 4</string>     <string name='collisionFilter'>3:0 1 2 3 4</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_colliderai.1741885760.txt.gz · Last modified: 2025/03/13 17:09 by dragonlord