User Tools

Site Tools


dragengine:modules:dragonscript:behavior_ridable

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_ridable [2025/03/11 19:56] – [Events] dragonlorddragengine:modules:dragonscript:behavior_ridable [2025/05/04 13:42] (current) – [ridable.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]] >> **ECBehaviorRidable**+[[: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]] >> **ECBehaviorRidable**
 </WRAP> </WRAP>
  
Line 18: Line 18:
 ====== Element Class Properties ====== ====== Element Class Properties ======
 Element class properties have the prefix ''ridable.''. Element class properties have the prefix ''ridable.''.
 +
  
 ====== Events ====== ====== Events ======
  
-This behavior has no events.+===== beginRiding ===== 
 + 
 +Ride on instance begins riding. 
 + 
 +===== stopRiding ===== 
 + 
 +Ride on instance stops riding. 
 + 
 +====== Behavior Tree Actions ====== 
 + 
 +This behavior adds these behavior tree actions if behavior tree is present. 
 + 
 +===== ridable.check ===== 
 + 
 +Check one or more ridable parameters. Action succeeds if all parameter value matches their respective ridable parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a ridable parameter matches (or not). 
 + 
 +^Parameter^Value^Description^ 
 +|count|integer|Count of riding ride on instances equals integer value| 
 +|count.not|integer|Count of riding ride on instances does not equal integer value| 
 +|count.less|integer|Count of riding ride on instances is less than integer value| 
 +|count.greater|integer|Count of riding ride on instances is greater than integer value| 
 +|player|''true'', ''false''|Player is riding| 
 +|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='ridable.check'> 
 +    <parameter name='player'>true</parameter> 
 +  </action> 
 +  <!-- actions here run only if player is riding --> 
 +</sequence> 
 +</code> 
 + 
 +====== Behavior Tree Conditions ====== 
 + 
 +This behavior adds these behavior tree conditions if behavior tree is present. 
 + 
 +===== ridable.check ===== 
 + 
 +Check one or more ridable parameters. Conditions returns true if all parameter value match their respective ridable parameter. This condition is typically used to run an action or sequence of actions as long as ridable conditions are true. 
 + 
 +^Parameter^Value^Description^ 
 +|ridable.count|integer|Count of riding ride on instances equals integer value| 
 +|ridable.count.not|integer|Count of riding ride on instances does not equal integer value| 
 +|ridable.count.less|integer|Count of riding ride on instances is less than integer value| 
 +|ridable.count.greater|integer|Count of riding ride on instances is greater than integer value| 
 +|ridable.player|''true'', ''false''|Player is riding| 
 + 
 +This is an example of using this condition: 
 +<code xml> 
 +<action name='myAction' id='doing something'> 
 +  <parameter name='ridable.player'>true</parameter> 
 +  <condition>ridable.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 ====== 
 + 
 + 
 +===== ridable.beginRiding ===== 
 + 
 +Ride on instance begins riding. 
 + 
 +===== ridable.stopRiding ===== 
 + 
 +Ride on instance stops riding.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
  
-This behavior requires these other behaviors: 
   * [[behavior_collider|ECBehaviorCollider]]   * [[behavior_collider|ECBehaviorCollider]]
  
 ====== 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 73: Line 148:
      
   <behavior type='ECBehaviorRidable'>   <behavior type='ECBehaviorRidable'>
 +    <!-- 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 -->
     <string name='.name'>value</string>     <string name='.name'>value</string>
dragengine/modules/dragonscript/behavior_ridable.1741723010.txt.gz · Last modified: 2025/03/11 19:56 by dragonlord