This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dragengine:modules:dragonscript:bahevior_playerinputmove [2025/03/13 12:01] – created dragonlord | dragengine:modules:dragonscript:bahevior_playerinputmove [2025/05/12 15:39] (current) – dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
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, '' | ||
+ | |locomotion.type|'' | ||
+ | ^Type^Description^ | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | </ | ||
+ | |forward|'' | ||
+ | |forward.toggle| |Toggle move forward key pressed| | ||
+ | |backward|'' | ||
+ | |backward.toggle| |Toggle move backward key pressed| | ||
+ | |left|'' | ||
+ | |left.toggle| |Toggle move left key pressed| | ||
+ | |right|'' | ||
+ | |right.toggle| |Toggle move right key pressed| | ||
+ | |analog.forwardBackward|float, | ||
+ | |analog.forwardBackward.sticky|float, | ||
+ | |analog.leftRight|float, | ||
+ | |analog.leftRight.sticky|float, | ||
+ | |canMove|'' | ||
+ | |canMove.toggle| |Toggle can move| | ||
+ | |run|'' | ||
+ | |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.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.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|'' | ||
+ | |locomotion.type.not|'' | ||
+ | |forward|'' | ||
+ | |backward|'' | ||
+ | |left|'' | ||
+ | |right|'' | ||
+ | |analog.forwardBackward.less|float|Analog move forward/ | ||
+ | |analog.forwardBackward.greater|float|Analog move forward/ | ||
+ | |analog.forwardBackward.sticky.less|float|Sticky analog move forward/ | ||
+ | |analog.forwardBackward.sticky.greater|float|Sticky analog move forward/ | ||
+ | |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|'' | ||
+ | |moving|'' | ||
+ | |run|'' | ||
+ | |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|float|Difference between '' | ||
+ | |moving.direction.greater|float|Difference between '' | ||
+ | |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> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | <!-- actions here run only if moving left key is pressed --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== 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|'' | ||
+ | |playerInputMove.locomotion.type.not|'' | ||
+ | |playerInputMove.forward|'' | ||
+ | |playerInputMove.backward|'' | ||
+ | |playerInputMove.left|'' | ||
+ | |playerInputMove.right|'' | ||
+ | |playerInputMove.analog.forwardBackward.less|float|Analog move forward/ | ||
+ | |playerInputMove.analog.forwardBackward.greater|float|Analog move forward/ | ||
+ | |playerInputMove.analog.forwardBackward.sticky.less|float|Sticky analog move forward/ | ||
+ | |playerInputMove.analog.forwardBackward.sticky.greater|float|Sticky analog move forward/ | ||
+ | |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|'' | ||
+ | |playerInputMove.moving|'' | ||
+ | |playerInputMove.run|'' | ||
+ | |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 '' | ||
+ | |playerInputMove.moving.direction.less|float|Difference between '' | ||
+ | |playerInputMove.moving.direction.greater|float|Difference between '' | ||
+ | |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=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== State Machine Actions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Conditions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Events ====== | ||
+ | |||
+ | This behavior send no events to state machine. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
Line 134: | Line 331: | ||
* [[behavior_locomotion|ECBehaviorLocomotion]]: | * [[behavior_locomotion|ECBehaviorLocomotion]]: | ||
+ | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 182: | Line 381: | ||
to freely look around. --> | to freely look around. --> | ||
<string name=' | <string name=' | ||
+ | | ||
+ | <!-- optional: use behavior tree with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- optional: use state machine with id instead of empty string --> | ||
+ | <string name=' | ||
| | ||
<!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> |