User Tools

Site Tools


dragengine:modules:dragonscript:behavior_stepaside

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_stepaside [2020/11/24 09:58] – [ECBehaviorStepAside] dragonlorddragengine:modules:dragonscript:behavior_stepaside [2025/05/05 13:37] (current) – [State Machine Events] 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]] >> **ECBehaviorStepAside**+[[: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]] >> **ECBehaviorStepAside**
 </WRAP> </WRAP>
  
Line 8: Line 8:
  
 ====== ECBehaviorStepAside ====== ====== ECBehaviorStepAside ======
 +
 +<WRAP center 100%>
 +<WRAP center box 450px>
 +{{youtube>BbP-lMrr0tQ?medium}}
 +<WRAP centeralign>Behavior in action</WRAP>
 +</WRAP>
 +</WRAP>
  
 Behavior adding support to actors to step aside if told. Behavior adding support to actors to step aside if told.
Line 16: Line 23:
  
 This behavior can be disabled temporarily to prevent actors from stepping aside. This behavior can be disabled temporarily to prevent actors from stepping aside.
- 
-<WRAP center 100%> 
-<WRAP center box 450px> 
-{{youtube>BbP-lMrr0tQ?medium}} 
-<WRAP centeralign>Behavior in action</WRAP> 
-</WRAP> 
-</WRAP> 
  
 ====== Instance Counts ====== ====== Instance Counts ======
Line 28: Line 28:
  
 ====== Element Class Properties ====== ====== Element Class Properties ======
-Element class properties have the prefix **stepAside.**.+Element class properties have the prefix ''stepAside.'' .
  
 ===== enabled ===== ===== enabled =====
 Determines if the behavior is initially enabled. Determines if the behavior is initially enabled.
-  * Full name: "stepAside.enabled"+  * Full name: ''stepAside.enabled''
   * Type: boolean   * Type: boolean
-  * Default Value: true+  * Default Value: ''true''
   * Example (*.deeclass) <code xml><boolean name='stepAside.enabled'>false</boolean></code>   * Example (*.deeclass) <code xml><boolean name='stepAside.enabled'>false</boolean></code>
  
 ===== radius ===== ===== radius =====
 Avoid radius. Actor tries to move to a position with this distance away from the moving lane of the actor requesting to step aside. Avoid radius. Actor tries to move to a position with this distance away from the moving lane of the actor requesting to step aside.
-  * Full name: "stepAside.radius"+  * Full name: ''stepAside.radius''
   * Type: floating point   * Type: floating point
   * Minimum Value: 0   * Minimum Value: 0
   * Default value: 0.4   * Default value: 0.4
   * Example (*.deeclass) <code xml><float name='stepAside.radius'>0.5</float></code>   * Example (*.deeclass) <code xml><float name='stepAside.radius'>0.5</float></code>
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== stepAside.set =====
 +
 +Set one or more step aside parameters.
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Enable step aside|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='stepAside.set'>
 +  <parameter name='enabled'>true</parameter>
 +</action>
 +</code>
 +
 +===== stepAside.check =====
 +
 +Check one or more step aside parameters. Action succeeds if all parameter value matches their respective step aside parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a step aside parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Step aside is enabled or not|
 +|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='stepAside.check'>
 +    <parameter name='enabled'>true</parameter>
 +  </action>
 +  <!-- actions here run only if step aside is enabled -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== stepAside.check =====
 +
 +Check one or more step aside parameters. Conditions returns true if all parameter value match their respective step aside parameter. This condition is typically used to run an action or sequence of actions as long as step aside conditions are true.
 +
 +^Parameter^Value^Description^
 +|stepAside.enabled|''true'', ''false''|Step aside is enabled or not|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='stepAside.enabled'>true</parameter>
 +  <condition>stepAside.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.
 +
 +===== stepAside.stepAside =====
 +
 +Step aside.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 49: Line 120:
  
 ====== 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 55: Line 128:
  
 ====== API Documentation ====== ====== API Documentation ======
-[[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1ECBehaviorStepAside.html|ECBehaviorStepAside]].+#@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorStepAside.html,ECBehaviorStepAside~@#.
  
-Since DragonScript Module Version **1.4**+Since DragonScript Module Version ''1.4''
  
 ====== Use Cases ====== ====== Use Cases ======
Line 90: Line 163:
 end end
 </code> </code>
 +
 +====== Behavior Factory ======
 +
 +Using element class supporting adding behaviors the behavior can be added like this:
 +<code xml>
 +<?xml version='1.0' encoding='UTF-8'?>
 +<elementClass name='MyClass' class='GenericBehaviorElement'>
 +  <behavior type='ECBehaviorComponent'/>
 +  <behavior type='ECBehaviorCollider'/>
 +  <behavior type='ECBehaviorColliderAI'/>
 +  <behavior type='ECBehaviorLocomotion'/>
 +  <behavior type='ECBehaviorNavigator'/>
 +  <behavior type='ECBehaviorActorMover'/>
 +  
 +  <behavior type='ECBehaviorStepAside'>
 +    <!-- 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 -->
 +    <float name='.radius'>0.5</float>
 +  </behavior>
 +</elementClass>
 +</code>
 +
 +====== Live Examples ======
 +
 +  * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]
 +
dragengine/modules/dragonscript/behavior_stepaside.1606211902.txt.gz · Last modified: 2020/11/24 09:58 by dragonlord