User Tools

Site Tools


dragengine:modules:dragonscript:behavior_clearpath

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
dragengine:modules:dragonscript:behavior_clearpath [2025/03/13 17:09] dragonlorddragengine:modules:dragonscript:behavior_clearpath [2025/05/05 13:25] (current) dragonlord
Line 64: Line 64:
   * Restriction: At least 0   * Restriction: At least 0
   * Example (*.deeclass) <code xml><float name='clearPath.clearPathTime'>1.5</float></code>   * Example (*.deeclass) <code xml><float name='clearPath.clearPathTime'>1.5</float></code>
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== clearPath.set =====
 +
 +Set one or more clear path parameters.
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Enable clear path|
 +|check.interval|float|Check interval in seconds|
 +|check.timer|float|Check timer in seconds. Typically 0 to reset timer|
 +|clearPath.time|float|Clear path time in seconds indicating how far ahead the actors clear path|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='clearPath.set'>
 +  <parameter name='enabled'>true</parameter>
 +</action>
 +</code>
 +
 +===== clearPath.check =====
 +
 +Check one or more clear path parameters. Action succeeds if all parameter value matches their respective clear path parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a clear path parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Clear path is enabled or not|
 +|check.interval.less|float|Check interval is less then value seconds|
 +|check.interval.greater|float|Check interval is greater then value seconds|
 +|check.timer.less|float|Check timer is less then value seconds|
 +|check.timer.greater|float|Check timer is greater then value seconds|
 +|clearPath.time.less|float|Clear path time is less then value seconds|
 +|clearPath.time.greater|float|Clear path time is greater then value seconds|
 +|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='clearPath.check'>
 +    <parameter name='enabled'>true</parameter>
 +  </action>
 +  <!-- actions here run only if clear path is enabled -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== clearPath.check =====
 +
 +Check one or more clear path parameters. Conditions returns true if all parameter value match their respective clear path parameter. This condition is typically used to run an action or sequence of actions as long as clear path conditions are true.
 +
 +^Parameter^Value^Description^
 +|clearPath.enabled|''true'', ''false''|Clear path is enabled or not|
 +|clearPath.check.interval.less|float|Check interval is less then value seconds|
 +|clearPath.check.interval.greater|float|Check interval is greater then value seconds|
 +|clearPath.check.timer.less|float|Check timer is less then value seconds|
 +|clearPath.check.timer.greater|float|Check timer is greater then value seconds|
 +|clearPath.clearPath.time.less|float|Clear path time is less then value seconds|
 +|clearPath.clearPath.time.greater|float|Clear path time is greater then value seconds|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='clearPath.enabled'>true</parameter>
 +  <condition>clearPath.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 69: Line 151:
  
 ====== 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 116: Line 200:
      
   <behavior type='ECBehaviorClearPath'>   <behavior type='ECBehaviorClearPath'>
 +    <!-- 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 -->
     <float name='.checkInterval'>1.5</float>     <float name='.checkInterval'>1.5</float>
dragengine/modules/dragonscript/behavior_clearpath.txt · Last modified: 2025/05/05 13:25 by dragonlord