User Tools

Site Tools


dragengine:modules:dragonscript:behavior_playerinputcrouch

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_playerinputcrouch [2025/05/07 14:28] dragonlorddragengine:modules:dragonscript:behavior_playerinputcrouch [2025/05/07 15:40] (current) dragonlord
Line 24: Line 24:
  
 This behavior has no events. This behavior has no events.
 +
 +====== Behavior Tree Actions ======
 +
 +This behavior adds these behavior tree actions if behavior tree is present.
 +
 +===== playerInputCrouch.set =====
 +
 +Set one or more player input crouch parameters.
 +
 +^Parameter^Value^Description^
 +|reset| |Reset player input crouch|
 +|crouch|''true'', ''false''|Crouch key pressed|
 +|crouch.toggle| |Toggle crouch key pressed|
 +|canCrouch|''true'', ''false''|Can crouch|
 +|canCrouch.toggle| |Toggle can crouch|
 +|stance|float|Stance value in the range from 0 to 1|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='playerInputCrouch.set'>
 +  <parameter name='crouch'>true</parameter>
 +</action>
 +</code>
 +
 +===== playerInputCrouch.check =====
 +
 +Check one or more player input crouch parameters. Action succeeds if all parameter value matches their respective player input crouch parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a player input crouch parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|crouch|''true'', ''false''|Crouch key pressed|
 +|canCrouch|''true'', ''false''|Can crouch|
 +|stance.less|float|Stance is less than float value|
 +|stance.greater|float|Stance is greater than float value|
 +|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='playerInputCrouch.check'>
 +    <parameter name='crouch'>true</parameter>
 +  </action>
 +  <!-- actions here run only if crouch key is pressed -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== playerInputCrouch.check =====
 +
 +Check one or more player input crouch parameters. Conditions returns true if all parameter value match their respective player input crouch parameter. This condition is typically used to run an action or sequence of actions as long as player input crouch conditions are true.
 +
 +^Parameter^Value^Description^
 +|crouch|''true'', ''false''|Crouch key pressed|
 +|canCrouch|''true'', ''false''|Can crouch|
 +|stance.less|float|Stance is less than float value|
 +|stance.greater|float|Stance is greater than float value|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='playerInputCrouch.crouch'>true</parameter>
 +  <condition>playerInputCrouch.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 send no events to state machine.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
dragengine/modules/dragonscript/behavior_playerinputcrouch.txt · Last modified: 2025/05/07 15:40 by dragonlord