User Tools

Site Tools


dragengine:modules:dragonscript:behavior_playerinputlook

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_playerinputlook [2025/05/07 14:28] dragonlorddragengine:modules:dragonscript:behavior_playerinputlook [2025/05/12 15:37] (current) dragonlord
Line 78: Line 78:
  
 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.
 +
 +===== playerInputLook.set =====
 +
 +Set one or more player input look parameters.
 +
 +^Parameter^Value^Description^
 +|reset| |Reset player input look|
 +|left|''true'', ''false''|Look left key pressed|
 +|left.toggle| |Toggle look left key pressed|
 +|right|''true'', ''false''|Look right key pressed|
 +|right.toggle| |Toggle look right key pressed|
 +|up|''true'', ''false''|Look up key pressed|
 +|up.toggle| |Toggle look up key pressed|
 +|down|''true'', ''false''|Look down key pressed|
 +|down.toggle| |Toggle look down key pressed|
 +|speed.horizontal|float|Horizontal looking speed in m/s|
 +|analog.horizontal|float, ''eventParam'', ''-eventParam''|Add analog horizontal looking in the range from -180 to 180 degrees|
 +|analog.horizontal.factor|float|Analog horizontal looking multiplicator|
 +|analog.horizontal.sticky|float, ''eventParam'', ''-eventParam''|Set sticky analog horizontal looking in the range from -180 to 180 degrees|
 +|speed.vertical|float|Vertical looking speed in m/s|
 +|analog.vertical|float, ''eventParam'', ''-eventParam''|Add analog vertical looking in the range from -180 to 180 degrees|
 +|analog.vertical.factor|float|Analog vertical looking multiplicator|
 +|analog.vertical.sticky|float, ''eventParam'', ''-eventParam''|Set sticky analog vertical looking in the range from -180 to 180 degrees|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='playerInputLook.set'>
 +  <parameter name='left'>true</parameter>
 +</action>
 +</code>
 +
 +===== playerInputLook.update =====
 +
 +Update player input look.
 +
 +^Parameter^Value^Description^
 +|locomotion| |Update locomotion applying calculateLookHorizontal() and calculateLookVertical() to [[behavior_locomotion|ECBehaviorLocomotion]].applyLookAround()|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='playerInputLook.update'>
 +  <parameter name='locomotion'/>
 +</action>
 +</code>
 +
 +===== playerInputLook.check =====
 +
 +Check one or more player input look parameters. Action succeeds if all parameter value matches their respective player input look parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a player input look parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|left|''true'', ''false''|Look left key pressed|
 +|right|''true'', ''false''|Look right key pressed|
 +|up|''true'', ''false''|Look up key pressed|
 +|down|''true'', ''false''|Look down key pressed|
 +|speed.horizontal.less|float|Horizontal speed is less than float value m/s|
 +|speed.horizontal.greater|float|Horizontal speed is greater than float value m/s|
 +|analog.horizontal.less|float|Analog horizontal value is less than value|
 +|analog.horizontal.greater|float|Analog horizontal value is greater than value|
 +|analog.horizontal.sticky.less|float|Sticky analog horizontal value is less than value|
 +|analog.horizontal.sticky.greater|float|Sticky analog horizontal value is greater than value|
 +|speed.vertical.less|float|Vertical speed is less than float value m/s|
 +|speed.vertical.greater|float|Vertical speed is greater than float value m/s|
 +|analog.vertical.less|float|Analog vertical value is less than value|
 +|analog.vertical.greater|float|Analog vertical value is greater than value|
 +|analog.vertical.sticky.less|float|Sticky analog vertical value is less than value|
 +|analog.vertical.sticky.greater|float|Sticky analog vertical value is greater than 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='playerInputLook.check'>
 +    <parameter name='left'>true</parameter>
 +  </action>
 +  <!-- actions here run only if look left key is pressed -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== playerInputLook.check =====
 +
 +Check one or more player input look parameters. Conditions returns true if all parameter value match their respective player input look parameter. This condition is typically used to run an action or sequence of actions as long as player input look conditions are true.
 +
 +^Parameter^Value^Description^
 +|playerInputLook.left|''true'', ''false''|Look left key pressed|
 +|playerInputLook.right|''true'', ''false''|Look right key pressed|
 +|playerInputLook.up|''true'', ''false''|Look up key pressed|
 +|playerInputLook.down|''true'', ''false''|Look down key pressed|
 +|playerInputLook.speed.horizontal.less|float|Horizontal speed is less than float value m/s|
 +|playerInputLook.speed.horizontal.greater|float|Horizontal speed is greater than float value m/s|
 +|playerInputLook.analog.horizontal.less|float|Analog horizontal value is less than value|
 +|playerInputLook.analog.horizontal.greater|float|Analog horizontal value is greater than value|
 +|playerInputLook.analog.horizontal.sticky.less|float|Sticky analog horizontal value is less than value|
 +|playerInputLook.analog.horizontal.sticky.greater|float|Sticky analog horizontal value is greater than value|
 +|playerInputLook.speed.vertical.less|float|Vertical speed is less than float value m/s|
 +|playerInputLook.speed.vertical.greater|float|Vertical speed is greater than float value m/s|
 +|playerInputLook.analog.vertical.less|float|Analog vertical value is less than value|
 +|playerInputLook.analog.vertical.greater|float|Analog vertical value is greater than value|
 +|playerInputLook.analog.vertical.sticky.less|float|Sticky analog vertical value is less than value|
 +|playerInputLook.analog.vertical.sticky.greater|float|Sticky analog vertical value is greater than value|
 +|playerInputLook.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 condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='playerInputLook.left'>true</parameter>
 +  <condition>playerInputLook.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_playerinputlook.1746628093.txt.gz · Last modified: 2025/05/07 14:28 by dragonlord