User Tools

Site Tools


dragengine:modules:dragonscript:behavior_alignactor

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_alignactor [2025/03/13 17:08] dragonlorddragengine:modules:dragonscript:behavior_alignactor [2025/05/12 21:26] (current) dragonlord
Line 35: Line 35:
  
 ===== finishedAligning ===== ===== finishedAligning =====
 +Actor finished aligning.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== alignActor.update =====
 +
 +Update align actor.
 +
 +^Parameter^Value^Description^
 +|clear| |Clear target|
 +|initLocomotionPlayer| |Init locomotion for player actor use|
 +|cancel| |Cancel aligning if running|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='alignActor.set'>
 +  <parameter name='enabled'>true</parameter>
 +</action>
 +</code>
 +
 +===== alignActor.check =====
 +
 +Check one or more align actor parameters. Action succeeds if all parameter value matches their respective align actor parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a align actor parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|arrived|''true'', ''false''|Actor arrived at target but might still be turning|
 +|finished|''true'', ''false''|Actor arrived at target and finished turning|
 +|succeeded|''true'', ''false''|Actor could arrive at target and turn to the desired orientation|
 +|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='alignActor.check'>
 +    <parameter name='finished'>true</parameter>
 +  </action>
 +  <!-- actions here run only if align actor finished -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== alignActor.check =====
 +
 +Check one or more align actor parameters. Conditions returns true if all parameter value match their respective align actor parameter. This condition is typically used to run an action or sequence of actions as long as align actor conditions are true.
 +
 +^Parameter^Value^Description^
 +|alignActor.arrived|''true'', ''false''|Actor arrived at target but might still be turning|
 +|alignActor.finished|''true'', ''false''|Actor arrived at target and finished turning|
 +|alignActor.succeeded|''true'', ''false''|Actor could arrive at target and turn to the desired orientation|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='alignActor.finished'>true</parameter>
 +  <condition>alignActor.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.
 +
 +===== alignActor.start =====
 +
 +Actor begins aligning.
 +
 +===== alignActor.stop =====
 +
 Actor finished aligning. Actor finished aligning.
  
Line 44: Line 125:
  
   * [[behavior_conversationactor|ECBehaviorConversationActor]]: Restore aligning after leaving conversation.   * [[behavior_conversationactor|ECBehaviorConversationActor]]: Restore aligning after leaving conversation.
 +  * [[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 96: Line 179:
      
   <behavior type='ECBehaviorAlignActor'>   <behavior type='ECBehaviorAlignActor'>
 +    <!-- optional: add behavior trees. default adds all behavior trees. -->
 +    <list name='behaviorTrees'>
 +      <string/> <!-- add behavior with empty identifier -->
 +      <string>default</string> <!-- add behavior with 'default' identifier -->
 +    </list>
 +    
 +    <!-- optional: add state machines. default adds all state machines. -->
 +    <list name='stateMachines'>
 +      <string/> <!-- add behavior with empty identifier -->
 +      <string>default</string> <!-- add behavior with 'default' identifier -->
 +    </list>
 +    
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
     <float name='.speed'>2</float>     <float name='.speed'>2</float>
dragengine/modules/dragonscript/behavior_alignactor.txt · Last modified: 2025/05/12 21:26 by dragonlord