User Tools

Site Tools


dragengine:modules:dragonscript:behavior_projecttoground

Differences

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

Link to this comparison view

Next revision
Previous revision
dragengine:modules:dragonscript:behavior_projecttoground [2025/03/12 14:08] – created dragonlorddragengine:modules:dragonscript:behavior_projecttoground [2025/05/04 13:44] (current) – [projectToGround.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]] >> **ECBehaviorProjectToGround**+[[: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]] >> **ECBehaviorProjectToGround**
 </WRAP> </WRAP>
  
Line 39: Line 39:
  
 Actor switched between touching ground and not touching ground. Actor switched between touching ground and not touching ground.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== projectToGround.check =====
 +
 +Check one or more project to ground parameters. Action succeeds if all parameter value matches their respective project to ground parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a project to ground parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|enabled|''true'', ''false''|Project to ground is enabled|
 +|ground|''true'', ''false''|Touching ground|
 +|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='projectToGround.check'>
 +    <parameter name='ground'>true</parameter>
 +  </action>
 +  <!-- actions here run only if touching ground -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== projectToGround.check =====
 +
 +Check one or more project to ground parameters. Conditions returns true if all parameter value match their respective project to ground parameter. This condition is typically used to run an action or sequence of actions as long as project to ground conditions are true.
 +
 +^Parameter^Value^Description^
 +|projectToGround.enabled|''true'', ''false''|Project to ground is enabled|
 +|projectToGround.ground|''true'', ''false''|Touching ground|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='projectToGround.enabled'>true</parameter>
 +  <condition>projectToGround.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.
 +
 +===== projectToGround.enabled =====
 +
 +Project to ground has been enabled.
 +
 +===== projectToGround.disabled =====
 +
 +Project to ground has been disabled.
 +
 +===== projectToGround.touch =====
 +
 +Element is touching ground while previously has not been touching ground.
 +
 +===== projectToGround.noTouch =====
 +
 +Element is not touching ground while previously has been touching ground.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
  
-This behavior requires these other behaviors: 
    * [[behavior_colliderai|ECBehaviorColliderAI]] or [[behavior_collider|ECBehaviorCollider]]    * [[behavior_colliderai|ECBehaviorColliderAI]] or [[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 93: Line 164:
      
   <behavior type='ECBehaviorProjectToGround'>   <behavior type='ECBehaviorProjectToGround'>
 +    <!-- 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 -->
     <boolean name='.applyToActor'>false</boolean>     <boolean name='.applyToActor'>false</boolean>
dragengine/modules/dragonscript/behavior_projecttoground.1741788500.txt.gz · Last modified: 2025/03/12 14:08 by dragonlord