User Tools

Site Tools


dragengine:modules:dragonscript:bahevior_playerinputmove

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:bahevior_playerinputmove [2025/05/07 14:28] dragonlorddragengine:modules:dragonscript:bahevior_playerinputmove [2025/05/12 15:39] (current) dragonlord
Line 126: Line 126:
  
 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.
 +
 +===== playerInputMove.set =====
 +
 +Set one or more player input move parameters.
 +
 +^Parameter^Value^Description^
 +|reset|empty string, ''analog''|Reset player input move. If ''analog'' is set only resets analog values|
 +|locomotion.type|''natural'', ''fps'', ''vehicle''|<WRAP>Locomotion type:
 +^Type^Description^
 +|''natural''|Default locomotion working best for actors moving in a natural way. The actor moves into the direction it is looking. The body is oriented into the walking direction if the actor is moving. Interferes with ECBehaviorPlayerInputTurn since both behaviors modify the locomotion turning value.|
 +|''fps''|Configuration useful for FPS type games where the actor is always oriented into the direction the player is looking. This configuration typically uses an 8-direction animator representing the actor moving into any direction relative to the looking direction. Interferes with ECBehaviorPlayerInputTurn since both behaviors modify the locomotion turning value.|
 +|''vehicle''|Configuration useful for vehicle type actors like tanks which move into the direction their body is oriented while allowing to freely look around. Does not interfere with ECBehaviorPlayerInputTurn since this behavior does not modify the locomotion turning value.|
 +</WRAP>|
 +|forward|''true'', ''false''|Move forward key pressed|
 +|forward.toggle| |Toggle move forward key pressed|
 +|backward|''true'', ''false''|Move backward key pressed|
 +|backward.toggle| |Toggle move backward key pressed|
 +|left|''true'', ''false''|Move left key pressed|
 +|left.toggle| |Toggle move left key pressed|
 +|right|''true'', ''false''|Move right key pressed|
 +|right.toggle| |Toggle move right key pressed|
 +|analog.forwardBackward|float, ''eventParam'', ''-eventParam''|Add analog move forward/backward value|
 +|analog.forwardBackward.sticky|float, ''eventParam'', ''-eventParam''|Set sticky analog move forward/backward value|
 +|analog.leftRight|float, ''eventParam'', ''-eventParam''|Add analog move left/right value|
 +|analog.leftRight.sticky|float, ''eventParam'', ''-eventParam''|Set sticky analog move left/right value|
 +|canMove|''true'', ''false''|Can move|
 +|canMove.toggle| |Toggle can move|
 +|run|''true'', ''false''|Run key pressed|
 +|run.toggle| |Toggle run key pressed|
 +|speed.walk|float|Walk speed in m/s|
 +|speed.walk.forward|float|Walk forward speed multiplicator|
 +|speed.walk.backward|float|Walk backward speed multiplicator|
 +|speed.walk.left|float|Walk left speed multiplicator|
 +|speed.walk.right|float|Walk right speed multiplicator|
 +|speed.run|float|Run speed in m/s|
 +|speed.run.forward|float|Run forward speed multiplicator|
 +|speed.run.backward|float|Run backward speed multiplicator|
 +|speed.run.left|float|Run left speed multiplicator|
 +|speed.run.right|float|Run right speed multiplicator|
 +|moving.direction|float|Moving direction in the range from -180 to 180 degrees|
 +|moving.speed|float|Moving speed in m/s|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='playerInputMove.set'>
 +  <parameter name='forward'>true</parameter>
 +</action>
 +</code>
 +
 +===== playerInputMove.update =====
 +
 +Update player input move.
 +
 +^Parameter^Value^Description^
 +|locomotion| |Update locomotion using stored states.|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='playerInputMove.update'>
 +  <parameter name='locomotion'/>
 +</action>
 +</code>
 +
 +===== playerInputMove.check =====
 +
 +Check one or more player input move parameters. Action succeeds if all parameter value matches their respective player input move parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a player input move parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|locomotion.type|''natural'', ''fps'', ''vehicle''|Locomtion type matches value|
 +|locomotion.type.not|''natural'', ''fps'', ''vehicle''|Locomtion type does not match value|
 +|forward|''true'', ''false''|Move forward key pressed|
 +|backward|''true'', ''false''|Move backward key pressed|
 +|left|''true'', ''false''|Move left key pressed|
 +|right|''true'', ''false''|Move right key pressed|
 +|analog.forwardBackward.less|float|Analog move forward/backward value is less than value|
 +|analog.forwardBackward.greater|float|Analog move forward/backward value is greater than value|
 +|analog.forwardBackward.sticky.less|float|Sticky analog move forward/backward value is less than value|
 +|analog.forwardBackward.sticky.greater|float|Sticky analog move forward/backward value is greater than value|
 +|analog.leftRight.less|float|Analog move left/right value is less than value|
 +|analog.leftRight.greater|float|Analog move left/right value is greater than value|
 +|analog.leftRight.sticky.less|float|Sticky analog move left/right value is less than value|
 +|analog.leftRight.sticky.greater|float|Sticky analog move left/right value is greater than value|
 +|canMove|''true'', ''false''|Can move|
 +|moving|''true'', ''false''|Player is moving meaning ''canMove'' is true and at least one movement key is pressed|
 +|run|''true'', ''false''|Run key pressed|
 +|speed.walk.less|float|Walk speed is less than float value m/s|
 +|speed.walk.greater|float|Walk speed is greater than float value m/s|
 +|speed.walk.forward.less|float|Walk forward multiplicator is less than float value m/s|
 +|speed.walk.forward.greater|float|Walk forward multiplicator is greater than float value m/s|
 +|speed.walk.backward.less|float|Walk backward multiplicator is less than float value m/s|
 +|speed.walk.backward.greater|float|Walk backward multiplicator is greater than float value m/s|
 +|speed.walk.left.less|float|Walk left multiplicator is less than float value m/s|
 +|speed.walk.left.greater|float|Walk left multiplicator is greater than float value m/s|
 +|speed.walk.right.less|float|Walk right multiplicator is less than float value m/s|
 +|speed.run.right.greater|float|Run right multiplicator is greater than float value m/s|
 +|speed.run.less|float|Run speed is less than float value m/s|
 +|speed.run.greater|float|Run speed is greater than float value m/s|
 +|speed.run.forward.less|float|Run forward multiplicator is less than float value m/s|
 +|speed.run.forward.greater|float|Run forward multiplicator is greater than float value m/s|
 +|speed.run.backward.less|float|Run backward multiplicator is less than float value m/s|
 +|speed.run.backward.greater|float|Run backward multiplicator is greater than float value m/s|
 +|speed.run.left.less|float|Run left multiplicator is less than float value m/s|
 +|speed.run.left.greater|float|Run left multiplicator is greater than float value m/s|
 +|speed.run.right.less|float|Run right multiplicator is less than float value m/s|
 +|speed.run.right.greater|float|Run right multiplicator is greater than float value m/s|
 +|moving.direction|float|Moving direction in the range from -180 to 180 degrees. Requires ''moving.direction.less'' or ''moving.direction.greater'' to be set|
 +|moving.direction.less|float|Difference between ''moving.direction'' and moving direction is less than degree value|
 +|moving.direction.greater|float|Difference between ''moving.direction'' and moving direction is greater than degree value|
 +|moving.speed.less|float|Moving speed is less than float value m/s|
 +|moving.speed.greater|float|Moving speed is greater than float value m/s|
 +|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='playerInputMove.check'>
 +    <parameter name='left'>true</parameter>
 +  </action>
 +  <!-- actions here run only if moving left key is pressed -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== playerInputMove.check =====
 +
 +Check one or more player input move parameters. Conditions returns true if all parameter value match their respective player input move parameter. This condition is typically used to run an action or sequence of actions as long as player input move conditions are true.
 +
 +^Parameter^Value^Description^
 +|playerInputMove.locomotion.type|''natural'', ''fps'', ''vehicle''|Locomtion type matches value|
 +|playerInputMove.locomotion.type.not|''natural'', ''fps'', ''vehicle''|Locomtion type does not match value|
 +|playerInputMove.forward|''true'', ''false''|Move forward key pressed|
 +|playerInputMove.backward|''true'', ''false''|Move backward key pressed|
 +|playerInputMove.left|''true'', ''false''|Move left key pressed|
 +|playerInputMove.right|''true'', ''false''|Move right key pressed|
 +|playerInputMove.analog.forwardBackward.less|float|Analog move forward/backward value is less than value|
 +|playerInputMove.analog.forwardBackward.greater|float|Analog move forward/backward value is greater than value|
 +|playerInputMove.analog.forwardBackward.sticky.less|float|Sticky analog move forward/backward value is less than value|
 +|playerInputMove.analog.forwardBackward.sticky.greater|float|Sticky analog move forward/backward value is greater than value|
 +|playerInputMove.analog.leftRight.less|float|Analog move left/right value is less than value|
 +|playerInputMove.analog.leftRight.greater|float|Analog move left/right value is greater than value|
 +|playerInputMove.analog.leftRight.sticky.less|float|Sticky analog move left/right value is less than value|
 +|playerInputMove.analog.leftRight.sticky.greater|float|Sticky analog move left/right value is greater than value|
 +|playerInputMove.canMove|''true'', ''false''|Can move|
 +|playerInputMove.moving|''true'', ''false''|Player is moving meaning ''canMove'' is true and at least one movement key is pressed|
 +|playerInputMove.run|''true'', ''false''|Run key pressed|
 +|playerInputMove.speed.walk.less|float|Walk speed is less than float value m/s|
 +|playerInputMove.speed.walk.greater|float|Walk speed is greater than float value m/s|
 +|playerInputMove.speed.walk.forward.less|float|Walk forward multiplicator is less than float value m/s|
 +|playerInputMove.speed.walk.forward.greater|float|Walk forward multiplicator is greater than float value m/s|
 +|playerInputMove.speed.walk.backward.less|float|Walk backward multiplicator is less than float value m/s|
 +|playerInputMove.speed.walk.backward.greater|float|Walk backward multiplicator is greater than float value m/s|
 +|playerInputMove.speed.walk.left.less|float|Walk left multiplicator is less than float value m/s|
 +|playerInputMove.speed.walk.left.greater|float|Walk left multiplicator is greater than float value m/s|
 +|playerInputMove.speed.walk.right.less|float|Walk right multiplicator is less than float value m/s|
 +|playerInputMove.speed.run.right.greater|float|Run right multiplicator is greater than float value m/s|
 +|playerInputMove.speed.run.less|float|Run speed is less than float value m/s|
 +|playerInputMove.speed.run.greater|float|Run speed is greater than float value m/s|
 +|playerInputMove.speed.run.forward.less|float|Run forward multiplicator is less than float value m/s|
 +|playerInputMove.speed.run.forward.greater|float|Run forward multiplicator is greater than float value m/s|
 +|playerInputMove.speed.run.backward.less|float|Run backward multiplicator is less than float value m/s|
 +|playerInputMove.speed.run.backward.greater|float|Run backward multiplicator is greater than float value m/s|
 +|playerInputMove.speed.run.left.less|float|Run left multiplicator is less than float value m/s|
 +|playerInputMove.speed.run.left.greater|float|Run left multiplicator is greater than float value m/s|
 +|playerInputMove.speed.run.right.less|float|Run right multiplicator is less than float value m/s|
 +|playerInputMove.speed.run.right.greater|float|Run right multiplicator is greater than float value m/s|
 +|playerInputMove.moving.direction|float|Moving direction in the range from -180 to 180 degrees. Requires ''moving.direction.less'' or ''moving.direction.greater'' to be set|
 +|playerInputMove.moving.direction.less|float|Difference between ''moving.direction'' and moving direction is less than degree value|
 +|playerInputMove.moving.direction.greater|float|Difference between ''moving.direction'' and moving direction is greater than degree value|
 +|playerInputMove.moving.speed.less|float|Moving speed is less than float value m/s|
 +|playerInputMove.moving.speed.greater|float|Moving speed is greater than float value m/s|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='playerInputMove.left'>true</parameter>
 +  <condition>playerInputMove.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/bahevior_playerinputmove.1746628099.txt.gz · Last modified: 2025/05/07 14:28 by dragonlord