User Tools

Site Tools


dragengine:modules:dragonscript:behavior_actormover

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_actormover [2025/03/12 19:38] – [Optional Behaviors] dragonlorddragengine:modules:dragonscript:behavior_actormover [2025/05/04 13:43] (current) – [actorMover.check] dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorActorMover**+[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorActorMover**
 </WRAP> </WRAP>
  
Line 135: Line 135:
 |direct|Use distance between actor and goal position as test distance.| |direct|Use distance between actor and goal position as test distance.|
 |distance|Distance to test against.| |distance|Distance to test against.|
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== actorMover.set =====
 +
 +Set one or more actor mover parameters.
 +
 +^Parameter^Value^Description^
 +|limit.turnAngle|float|Limit turn angle in degrees|
 +|limit.turnAngle.enabled|''true'', ''false''|Enable limit turn angle|
 +|speed|float|Movement speed in m/s|
 +|paused|''true'', ''false''|Pause moving to goal|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='actorMover.set'>
 +  <parameter name='paused'>true</parameter>
 +</action>
 +</code>
 +
 +===== actorMover.stop =====
 +
 +Stop moving.
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='actorMover.stop'/>
 +</code>
 +
 +===== actorMover.check =====
 +
 +Check one or more actor mover parameters. Action succeeds if all parameter value matches their respective actor mover parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a actor mover parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|goal|''true'', ''false''|Goal is set|
 +|goal.distance.less|float|Distance to goal along path is less than value in meters|
 +|goal.distance.greater|float|Distance to goal along path is greater than value in meters|
 +|limit.turnAngle.enabled|''true'', ''false''|Limit turn angle is enabled|
 +|limit.turnAngle.less|float|Limit turn angle is less than value degrees|
 +|limit.turnAngle.greater|float|Limit turn angle is greater than value degrees|
 +|speed.less|float|Speed is less than value m/s|
 +|speed.greater|float|Speed is greater than value m/s|
 +|paused|''true'', ''false''|Moving is paused|
 +|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='actorMover.check'>
 +    <parameter name='goal'>true</parameter>
 +    <parameter name='goal.distance.less'>3</parameter>
 +  </action>
 +  <!-- actions here run only if actor mover has goal set and actor is less than 3 meters near to it -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== actorMover.check =====
 +
 +Check one or more actor mover parameters. Conditions returns true if all parameter value match their respective actor mover parameter. This condition is typically used to run an action or sequence of actions as long as actor mover conditions are true.
 +
 +^Parameter^Value^Description^
 +|actorMover.goal|''true'', ''false''|Goal is set|
 +|actorMover.goal.distance.less|float|Distance to goal along path is less than value in meters|
 +|actorMover.goal.distance.greater|float|Distance to goal along path is greater than value in meters|
 +|actorMover.limit.turnAngle.enabled|''true'', ''false''|Limit turn angle is enabled|
 +|actorMover.limit.turnAngle.less|float|Limit turn angle is less than value degrees|
 +|actorMover.limit.turnAngle.greater|float|Limit turn angle is greater than value degrees|
 +|actorMover.speed.less|float|Speed is less than value m/s|
 +|actorMover.speed.greater|float|Speed is greater than value m/s|
 +|actorMover.paused|''true'', ''false''|Moving is paused|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='actorMover.goal'>true</parameter>
 +  <parameter name='actorMover.goal.distance.less'>3</parameter>
 +  <condition>actorMover.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.
 +
 +===== actorMover.start =====
 +
 +Actor starts moving towards goal. Path can be null if no path could be found or the actor is already at the goal. In this case ''actorMover.arrived'' and ''actorMover.stop'' is send too.
 +
 +===== actorMover.stop =====
 +
 +Actor stops moving.
 +
 +===== actorMover.arrived =====
 +
 +Actor arrived at goal position. ''actorMover.stop'' will be send before this event.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 145: Line 254:
   * [[behavior_rideon|ECBehaviorRideOn]]   * [[behavior_rideon|ECBehaviorRideOn]]
   * [[behavior_conversationactor|ECBehaviorConversationActor]]: Add conversation commands and conditions.   * [[behavior_conversationactor|ECBehaviorConversationActor]]: Add conversation commands and conditions.
 +  * [[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 208: Line 319:
     <!-- optional: use navigator with id instead of empty string -->     <!-- optional: use navigator with id instead of empty string -->
     <string name='navigator'>second</string>     <string name='navigator'>second</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_actormover.1741808304.txt.gz · Last modified: 2025/03/12 19:38 by dragonlord