This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_playerinputlook [2025/03/13 17:15] – dragonlord | dragengine: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|'' | ||
+ | |left.toggle| |Toggle look left key pressed| | ||
+ | |right|'' | ||
+ | |right.toggle| |Toggle look right key pressed| | ||
+ | |up|'' | ||
+ | |up.toggle| |Toggle look up key pressed| | ||
+ | |down|'' | ||
+ | |down.toggle| |Toggle look down key pressed| | ||
+ | |speed.horizontal|float|Horizontal looking speed in m/s| | ||
+ | |analog.horizontal|float, | ||
+ | |analog.horizontal.factor|float|Analog horizontal looking multiplicator| | ||
+ | |analog.horizontal.sticky|float, | ||
+ | |speed.vertical|float|Vertical looking speed in m/s| | ||
+ | |analog.vertical|float, | ||
+ | |analog.vertical.factor|float|Analog vertical looking multiplicator| | ||
+ | |analog.vertical.sticky|float, | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 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.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|'' | ||
+ | |right|'' | ||
+ | |up|'' | ||
+ | |down|'' | ||
+ | |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> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | <!-- actions here run only if look left key is pressed --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== 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|'' | ||
+ | |playerInputLook.right|'' | ||
+ | |playerInputLook.up|'' | ||
+ | |playerInputLook.down|'' | ||
+ | |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=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== 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 86: | Line 214: | ||
* [[behavior_locomotion|ECBehaviorLocomotion]]: | * [[behavior_locomotion|ECBehaviorLocomotion]]: | ||
+ | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 121: | Line 251: | ||
< | < | ||
< | < | ||
+ | <!-- 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 --> | ||
<string name=' | <string name=' |