User Tools

Site Tools


dragengine:modules:dragonscript:behavior_locomotion

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_locomotion [2025/03/13 17:09] dragonlorddragengine:modules:dragonscript:behavior_locomotion [2025/05/14 14:12] (current) dragonlord
Line 33: Line 33:
  
 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.
 +
 +===== locomotion.set =====
 +
 +Set one or more locomotion parameters.
 +
 +^Parameter^Value^Description^
 +|preset|''human'', ''vehicle''|<WRAP>Initialize locomotion with common parameters.
 +|human|<WRAP>Initialize locomotion with common human actor parameters. Sets these parameters:
 +  * Can turn: yes
 +  * Can turn in-place: yes
 +  * Linear velocity adjust range: Actor element class run speed
 +  * Linear velocity adjust time: 1
 +  * Moving left right adjust time: 0
 +  * Looking limits: -80..80 (up-down) and -90..90 (left-right)
 +  * Looking adjust times: 1
 +  * Orientation adjust time: 1
 +  * Turn adjust look left-right: yes
 +  * Turn in-place limit: -70..70
 +  * Turn in-place adjust time: 1
 +</WRAP>|
 +|vehicle|<WRAP>Initialize locomotion with common vehicle parameters. Sets these initial parameters:
 +  * Can turn: yes
 +  * Can turn in-place: no
 +  * Linear velocity adjust range: Actor element class run speed
 +  * Linear velocity adjust time: 0.5
 +  * Moving left right adjust time: 0
 +  * Looking limits: -80..80 (up-down) and -90..90 (left-right)
 +  * Looking adjust times: 0
 +  * Orientation adjust time: 1
 +  * Turn adjust look left-right: no
 +  * Turn in-place limit: -70..70
 +  * Turn in-place adjust time: 1
 +
 +These values are suitable for player controlled actors. For non-player controlled actors it might be useful to set these additional parameters:
 +  * Looking adjust time: 1
 +  * Linear velocity adjust time: 1
 +</WRAP>|
 +</WRAP>|
 +|can.turn|''true'', ''false''|Actor can turn|
 +|alwaysLimitLeftRight|''true'', ''false''|Look left/right is always limited|
 +|limit.look.up|float|Looking up limit angle in degrees|
 +|limit.look.down|float|Looking down limit angle in degrees|
 +|adjust.vertical.time|float|Look up-down adjustment time in seconds|
 +|adjust.vertical.range|float|Look up-down adjustment range|
 +|look.vertical.goal|float|Looking up-down goal|
 +|look.vertical|float|Looking up-down value|
 +|limit.look.left|float|Looking left limit in degrees|
 +|limit.look.right|float|Looking right limit in degrees|
 +|adjust.horizontal.time|float|Look left-right adjustment time in seconds|
 +|adjust.horizontal.range|float|Look left-right adjustment range|
 +|look.horizontal.goal|float|Look left-right goal|
 +|look.horizontal|float|Look left-right value|
 +|analog.vertical|float|Analog looking up-down|
 +|turn.horizontal|float|Turn left-right value|
 +|adjust.orientation.time|float|Orientation adjustment time in seconds|
 +|orientation|float|Actor orientation in world space|
 +|turn.speed|float|Turning speed in meters per second|
 +|is.turning.inplace|''true'', ''false''|Actor is turning in place|
 +|adjust.turn.inplace.time|float|Adjustment time in seconds for turning in-place|
 +|turn.inplace|float|Turn in place value|
 +|reset.time.turn.inplace|''true'', ''false''|Turn in place time linked controllers have to be reset|
 +|reverse.time.turn.inplace|''true'', ''false''|Turn in place time linked controllers have to be reversed|
 +|can.turn.inplace|''true'', ''false''|Actor can turn in-place if looking beyond limits|
 +|limit.turn.inplace.left|float|Looking left limit in degrees before turning in-place|
 +|limit.turn.inplace.right|float|Looking right limit in degrees before turning in-place|
 +|adjust.analog.move.horizontal.time|float|Analog looking left-right adjustment time in seconds|
 +|adjust.analog.move.horizontal.range|float|Analog looking left-right adjustment range|
 +|analog.move.horizontal.goal|float|Analog looking left-right goal|
 +|analog.move.horizontal|float|Analog looking left-right|
 +|analog.move.speed|float|Analog moving speed|
 +|is.moving|''true'', ''false''|Actor is moving direct or analog|
 +|move.speed|float|For Non-FPS locomotion type this is negative for moving backward|
 +|adjust.linearVelocity.time|float|Linear velocity adjustment time in seconds|
 +|adjust.linearVelocity.range|float|Linear velocity adjustment range in meters per second|
 +|move.orientation|float|Movement orientation in world space|
 +|move.direction|float|Movement direction relative to view orientation|
 +|reset.time.walk|''true'', ''false''|Walk/run time linked controllers have to be reset|
 +|adjust.stance.time|float|Adjustment time for stance in seconds|
 +|adjust.stance.range|float|Adjustment range for stance|
 +|stance|float|Stance value|
 +|stance.goal|float|Stance goal value|
 +|can.tilt|''true'', ''false''|Actor can tilt the body|
 +|tilt.mode|''none'', ''single'', ''weighted''|<WRAP>Tilt mode
 +|none|No tilt calculation.|
 +|single|Calculate tilt from the hit normal of a a single ground test. The single test is cast down at the center of the actor. The hit normal is used to calculate the tilt in both directions relative to the actor coordinate system. This test mode is the fastest and suitable for simple bipedal actors in simple shaped worlds.|
 +|weighted|Calculate tilt from 4 weighted ground tests in a box shape. 4 samples arranged in a box around front and back feet are cast down and weighted. This test mode improves the quality over dedsLocomotion::etmSingle but is more expensive to calculate. It is suited for all kinds of actors or complex worlds.|
 +</WRAP>|
 +|limit.tilt.up|float|Tilt up limit in degrees|
 +|limit.tilt.down|float|Tilt down limit in degrees|
 +|tilt.vertical|float|Current tilt up/down angle in degrees|
 +|tilt.vertical.goal|float|Goal tilt up/down angle in degrees|
 +|adjust.tilt.vertical.time|float|Tilt up/down adjust time in seconds|
 +|adjust.tilt.vertical.range|float|Tilt up/down adjust range|
 +|limit.tilt.left|float|Tilt left limit in degrees|
 +|limit.tilt.right|float|Tilt right limit in degrees|
 +|tilt.horizontal|float|Current tilt left/right angle in degrees|
 +|tilt.horizontal.goal|float|Goal tilt left/right angle in degrees|
 +|adjust.tilt.horizontal.time|float|Tilt left/right adjust time in seconds|
 +|adjust.tilt.horizontal.range|float|Tilt left/right adjust range|
 +|tilt.offset|float|Tilt offset in meters|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='locomotion.set'>
 +  <parameter name='preset'>human</parameter>
 +</action>
 +</code>
 +
 +===== locomotion.update =====
 +
 +Update locomotion.
 +
 +^Parameter^Value^Description^
 +|cancel.input| |<WRAP>Cancel input. Resets these parameters:
 +  * Analog moving left-right: set value and goal to 0
 +  * Analog moving speed: set to 0
 +  * Turn left right: set to 0
 +  * Look left-right: set goal to value
 +  * Look up-down: set goal to value
 +Stance: set goal to value
 +</WRAP>|
 +|cancel.movement| |<WRAP>Cancel Movement. Includes ''cancel.input''. Resets these parameters:
 +  * Linear velocity: set goal and value to 0
 +  * Moving speed: set to 0
 +  * Moving orientation: set to 0
 +  * Moving direction: set to 0
 +</WRAP>|
 +|cancel.motion| |<WRAP>Cancel motion. Includes ''cancel.movement'' and ''cancel.turn.inplace''. Resets these parameters:
 +  * Turning speed: set to 0
 +  * Turn in-place: set to 0
 +  * Tilt left-right: set goal to value
 +  * Tilt up-down: set goal to value
 +</WRAP>|
 +|cancel.turn.inplace| |<WRAP>Cancel turning in-place. Resets these parameters:
 +  * Turn in-place: set to 0
 +  * Is Turning: set to false
 +</WRAP>|
 +|forceBodyAdjustment| |Force body adjustment|
 +|stopMoving| |Clear all movement to ensure actor is not unintentially moving|
 +|resetLooking| |Reset looking vertically and horizontally to 0|
 +|looking| |Update looking|
 +|locomotion| |Update locomotion|
 +|isMoving| |Update is moving|
 +|orientation| |Update orientation|
 +|linearVelocity| |Update linear velocity|
 +|stance| |Update stance|
 +|postLocomotion| |Update locomotion after physics calculations|
 +|tilt| |Update body tilting|
 +|animator| |Update animator instance controllers if set with locomotion parameters|
 +|aiCollider| |Update AI collider linear and angular velocity|
 +|adjustOrientation| |<WRAP>Adjusts various orientation parameters to rotate by a given angle ensuring all relationships between the various parameters are still correct. Use this method if you want to manually rotate an actor while keeping the looking and movement direction intact. In particular this method adjust the following parameters without taking limitations into account:
 +  * Orientation
 +  * Look horizontal
 +  * Look horizontal goal
 +  * Analog move horizontal
 +  * Turn horizontal
 +</WRAP>|
 +|applyStates| |Apply states without interpolation or smoothing|
 +|colliderFromLocomotion.orientation| |Set collider AI orientation from locomotion orientation|
 +|colliderFromLocomotion.linearVelocity| |Set collider AI linear velocity from locomotion linear velocity|
 +|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='locomotion.check'>
 +    <parameter name='enabled'>true</parameter>
 +  </action>
 +  <!-- actions here run only if locomotion is enabled -->
 +</sequence>
 +</code>
 +
 +===== locomotion.check =====
 +
 +Check one or more locomotion parameters. Action succeeds if all parameter value matches their respective locomotion parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a locomotion parameter matches (or not).
 +
 +^Parameter^Value^Description^
 +|can.turn|''true'', ''false''|Actor can turn matches value|
 +|alwaysLimitLeftRight|''true'', ''false''|Look left/right is always limited matches value|
 +|limit.look.up.less|float|Looking up limit angle is less than value in degrees|
 +|limit.look.up.greater|float|Looking up limit angle is greater than value in degrees|
 +|limit.look.down.less|float|Looking down limit angle is less than value in degrees|
 +|limit.look.down.greater|float|Looking down limit angle is greater than value in degrees|
 +|adjust.vertical.time.less|float|Look up-down adjustment time is less than value in seconds|
 +|adjust.vertical.time.greater|float|Look up-down adjustment time is greater than value in seconds|
 +|adjust.vertical.range.less|float|Look up-down adjustment range is less than value|
 +|adjust.vertical.range.greater|float|Look up-down adjustment range is greater than value|
 +|look.vertical.goal.less|float|Looking up-down goal is less than value|
 +|look.vertical.goal.greater|float|Looking up-down goal is greater than value|
 +|look.vertical.less|float|Looking up-down value is less than value|
 +|look.vertical.greater|float|Looking up-down value is greater than value|
 +|limit.look.left.less|float|Looking left limit is less than value in degrees|
 +|limit.look.left.greater|float|Looking left limit is greater than value in degrees|
 +|limit.look.right.less|float|Looking right limit is less than value in degrees|
 +|limit.look.right.greater|float|Looking right limit is greater than value in degrees|
 +|adjust.horizontal.time.less|float|Look left-right adjustment time is less than in seconds|
 +|adjust.horizontal.time.greater|float|Look left-right adjustment time is greater than in seconds|
 +|adjust.horizontal.range.less|float|Look left-right adjustment range is less than value|
 +|adjust.horizontal.range.greater|float|Look left-right adjustment range is greater than value|
 +|look.horizontal.goal.less|float|Look left-right goal is less than value|
 +|look.horizontal.goal.greater|float|Look left-right goal is greater than value|
 +|look.horizontal.less|float|Look left-right value is less than value|
 +|look.horizontal.greater|float|Look left-right value is greater than value|
 +|analog.vertical.less|float|Analog looking up-down is less than value|
 +|analog.vertical.greater|float|Analog looking up-down is greater than value|
 +|turn.horizontal.less|float|Turn left-right value is less than value|
 +|turn.horizontal.greater|float|Turn left-right value is greater than value|
 +|adjust.orientation.time.less|float|Orientation adjustment time is less than value in seconds|
 +|adjust.orientation.time.greater|float|Orientation adjustment time is greater than value in seconds|
 +|orientation|float|Actor orientation to check|
 +|orientation.less|float|Difference between ''orientation'' and actor orientation normalized to the range between -180..180 is less than value|
 +|orientation.greater|float|Difference between ''orientation'' and actor orientation normalized to the range between -180..180 is greaterless than value|
 +|turn.speed.less|float|Turning speed is less than value in meters per second|
 +|turn.speed.greater|float|Turning speed is greater than value in meters per second|
 +|is.turning.inplace|''true'', ''false''|Actor is turning in place matches value|
 +|adjust.turn.inplace.time.less|float|Adjustment time is less than value in seconds for turning in-place|
 +|adjust.turn.inplace.time.greater|float|Adjustment time is greater than value in seconds for turning in-place|
 +|turn.inplace.less|float|Turn in place value is less than value|
 +|turn.inplace.greater|float|Turn in place value is greater than value|
 +|reset.time.turn.inplace|''true'', ''false''|Turn in place time linked controllers have to be reset matches value|
 +|reverse.time.turn.inplace|''true'', ''false''|Turn in place time linked controllers have to be reversed matches value|
 +|can.turn.inplace|''true'', ''false''|Actor can turn in-place if looking beyond limits matches value|
 +|limit.turn.inplace.left.less|float|Looking left limit in degrees before turning in-place is less than value|
 +|limit.turn.inplace.left.greater|float|Looking left limit in degrees before turning in-place is greater than value|
 +|limit.turn.inplace.right.less|float|Looking right limit in degrees before turning in-place is less than value|
 +|limit.turn.inplace.right.greater|float|Looking right limit in degrees before turning in-place is greater than value|
 +|adjust.analog.move.horizontal.time.less|float|Analog looking left-right adjustment time is less than value in seconds|
 +|adjust.analog.move.horizontal.time.greater|float|Analog looking left-right adjustment time is greater than value in seconds|
 +|adjust.analog.move.horizontal.range.less|float|Analog looking left-right adjustment range is less than value|
 +|adjust.analog.move.horizontal.range.greater|float|Analog looking left-right adjustment range is greater than value|
 +|analog.move.horizontal.goal|float|Analog looking left-right value goal to check|
 +|analog.move.horizontal.goal.less|float|Difference between ''analog.move.horizontal.goal'' and analog looking left-right goal normalized to the range between -180..180 is less than value|
 +|analog.move.horizontal.goal.greater|float|Difference between ''analog.move.horizontal.goal'' and analog looking left-right goal normalized to the range between -180..180 is greater than value|
 +|analog.move.horizontal|float|Analog looking left-right value to check|
 +|analog.move.horizontal.less|float|Difference between ''analog.move.horizontal'' and analog looking left-right goal normalized to the range between -180..180 is less than value|
 +|analog.move.horizontal.less|float|Difference between ''analog.move.horizontal'' and analog looking left-right goal normalized to the range between -180..180 is greater than value|
 +|analog.move.speed.less|float|Analog moving speed is less than value|
 +|analog.move.speed.greater|float|Analog moving speed is greater than value|
 +|is.moving|''true'', ''false''|Actor is moving direct or analog matches value|
 +|move.speed.less|float|Moving speed is less than value in meters per second|
 +|move.speed.greater|float|Moving speed is greater than value in meters per second|
 +|move.speed.absolute.less|float|Absolute moving speed is less than value in meters per second|
 +|move.speed.absolute.greater|float|Absolute moving speed is greater than value in meters per second|
 +|adjust.linearVelocity.time.less|float|Linear velocity adjustment time is less than value in seconds|
 +|adjust.linearVelocity.time.greater|float|Linear velocity adjustment time is greater than value in seconds|
 +|adjust.linearVelocity.range.less|float|Linear velocity adjustment range is less than value in meters per second|
 +|adjust.linearVelocity.range.greater|float|Linear velocity adjustment range is greater than value in meters per second|
 +|move.orientation|float|Movement orientation in world space to check|
 +|move.orientation.less|float|Difference between ''move.orientation'' and movement orientation in world space normalized to the range between -180..180 is less than value|
 +|move.orientation.greater|float|Difference between ''move.orientation'' and movement orientation in world space normalized to the range between -180..180 is greaterless than value|
 +|move.direction.less|float|Movement direction relative to view orientation is less than value in degrees|
 +|move.direction.greater|float|Movement direction relative to view orientation is greater than value in degrees|
 +|reset.time.walk|''true'', ''false''|Walk/run time linked controllers have to be reset matches value|
 +|adjust.stance.time.less|float|Adjustment time for stance is less than value in seconds|
 +|adjust.stance.time.greater|float|Adjustment time for stance is greater than value in seconds|
 +|adjust.stance.range.less|float|Adjustment range for stance is less than value|
 +|adjust.stance.range.greater|float|Adjustment range for stance is greater than value|
 +|stance.less|float|Stance value is less than value|
 +|stance.greater|float|Stance value is greater than value|
 +|stance.goal.less|float|Stance goal value is less than value|
 +|stance.goal.greater|float|Stance goal value is greater than value|
 +|can.tilt|''true'', ''false''|Actor can tilt the body matches value|
 +|tilt.mode|''none'', ''single'', ''weighted''|Tilt mode matches value|
 +|tilt.mode.not|''none'', ''single'', ''weighted''|Tilt mode does not match value|
 +|limit.tilt.up.less|float|Tilt up limit is less than value in degrees|
 +|limit.tilt.up.greater|float|Tilt up limit is greater than value in degrees|
 +|limit.tilt.down.less|float|Tilt down limit is less than value in degrees|
 +|limit.tilt.down.greater|float|Tilt down limit is greater than value in degrees|
 +|tilt.vertical.less|float|Current tilt up/down angle is less than value in degrees|
 +|tilt.vertical.greater|float|Current tilt up/down angle is greater than value in degrees|
 +|tilt.vertical.goal.less|float|Goal tilt up/down angle is less than value in degrees|
 +|tilt.vertical.goal.greater|float|Goal tilt up/down angle is greater than value in degrees|
 +|adjust.tilt.vertical.time.less|float|Tilt up/down adjust time is less than value in seconds|
 +|adjust.tilt.vertical.time.greater|float|Tilt up/down adjust time is greater than value in seconds|
 +|adjust.tilt.vertical.range.less|float|Tilt up/down adjust range is less than value|
 +|adjust.tilt.vertical.range.greater|float|Tilt up/down adjust range is greater than value|
 +|limit.tilt.left.less|float|Tilt left limit is less than value in degrees|
 +|limit.tilt.left.greater|float|Tilt left limit is greater than value in degrees|
 +|limit.tilt.right.less|float|Tilt right limit is less than value in degrees|
 +|limit.tilt.right.greater|float|Tilt right limit is greater than value in degrees|
 +|tilt.horizontal.less|float|Current tilt left/right angle less than value in degrees|
 +|tilt.horizontal.greater|float|Current tilt left/right angle greater than value in degrees|
 +|tilt.horizontal.goal.less|float|Goal tilt left/right angle is less than value in degrees|
 +|tilt.horizontal.goal.greater|float|Goal tilt left/right angle is greater than value in degrees|
 +|adjust.tilt.horizontal.time.less|float|Tilt left/right adjust time is less than value in seconds|
 +|adjust.tilt.horizontal.time.greater|float|Tilt left/right adjust time is greater than value in seconds|
 +|adjust.tilt.horizontal.range.less|float|Tilt left/right adjust range is less than value|
 +|adjust.tilt.horizontal.range.greater|float|Tilt left/right adjust range is greater than value|
 +|tilt.offset.less|float|Tilt offset is less than value in meters|
 +|tilt.offset.greater|float|Tilt offset is greater than value in meters|
 +|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='locomotion.check'>
 +    <parameter name='enabled'>true</parameter>
 +  </action>
 +  <!-- actions here run only if locomotion is enabled -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +This behavior adds these behavior tree conditions if behavior tree is present.
 +
 +===== locomotion.check =====
 +
 +Check one or more locomotion parameters. Conditions returns true if all parameter value match their respective locomotion parameter. This condition is typically used to run an action or sequence of actions as long as locomotion conditions are true.
 +
 +^Parameter^Value^Description^
 +|locomotion.can.turn|''true'', ''false''|Actor can turn matches value|
 +|locomotion.alwaysLimitLeftRight|''true'', ''false''|Look left/right is always limited matches value|
 +|locomotion.limit.look.up.less|float|Looking up limit angle is less than value in degrees|
 +|locomotion.limit.look.up.greater|float|Looking up limit angle is greater than value in degrees|
 +|locomotion.limit.look.down.less|float|Looking down limit angle is less than value in degrees|
 +|locomotion.limit.look.down.greater|float|Looking down limit angle is greater than value in degrees|
 +|locomotion.adjust.vertical.time.less|float|Look up-down adjustment time is less than value in seconds|
 +|locomotion.adjust.vertical.time.greater|float|Look up-down adjustment time is greater than value in seconds|
 +|locomotion.adjust.vertical.range.less|float|Look up-down adjustment range is less than value|
 +|locomotion.adjust.vertical.range.greater|float|Look up-down adjustment range is greater than value|
 +|locomotion.look.vertical.goal.less|float|Looking up-down goal is less than value|
 +|locomotion.look.vertical.goal.greater|float|Looking up-down goal is greater than value|
 +|locomotion.look.vertical.less|float|Looking up-down value is less than value|
 +|locomotion.look.vertical.greater|float|Looking up-down value is greater than value|
 +|locomotion.limit.look.left.less|float|Looking left limit is less than value in degrees|
 +|locomotion.limit.look.left.greater|float|Looking left limit is greater than value in degrees|
 +|locomotion.limit.look.right.less|float|Looking right limit is less than value in degrees|
 +|locomotion.limit.look.right.greater|float|Looking right limit is greater than value in degrees|
 +|locomotion.adjust.horizontal.time.less|float|Look left-right adjustment time is less than in seconds|
 +|locomotion.adjust.horizontal.time.greater|float|Look left-right adjustment time is greater than in seconds|
 +|locomotion.adjust.horizontal.range.less|float|Look left-right adjustment range is less than value|
 +|locomotion.adjust.horizontal.range.greater|float|Look left-right adjustment range is greater than value|
 +|locomotion.look.horizontal.goal.less|float|Look left-right goal is less than value|
 +|locomotion.look.horizontal.goal.greater|float|Look left-right goal is greater than value|
 +|locomotion.look.horizontal.less|float|Look left-right value is less than value|
 +|locomotion.look.horizontal.greater|float|Look left-right value is greater than value|
 +|locomotion.analog.vertical.less|float|Analog looking up-down is less than value|
 +|locomotion.analog.vertical.greater|float|Analog looking up-down is greater than value|
 +|locomotion.turn.horizontal.less|float|Turn left-right value is less than value|
 +|locomotion.turn.horizontal.greater|float|Turn left-right value is greater than value|
 +|locomotion.adjust.orientation.time.less|float|Orientation adjustment time is less than value in seconds|
 +|locomotion.adjust.orientation.time.greater|float|Orientation adjustment time is greater than value in seconds|
 +|locomotion.orientation|float|Actor orientation to check|
 +|locomotion.orientation.less|float|Difference between ''orientation'' and actor orientation normalized to the range between -180..180 is less than value|
 +|locomotion.orientation.greater|float|Difference between ''orientation'' and actor orientation normalized to the range between -180..180 is greaterless than value|
 +|locomotion.turn.speed.less|float|Turning speed is less than value in meters per second|
 +|locomotion.turn.speed.greater|float|Turning speed is greater than value in meters per second|
 +|locomotion.is.turning.inplace|''true'', ''false''|Actor is turning in place matches value|
 +|locomotion.adjust.turn.inplace.time.less|float|Adjustment time is less than value in seconds for turning in-place|
 +|locomotion.adjust.turn.inplace.time.greater|float|Adjustment time is greater than value in seconds for turning in-place|
 +|locomotion.turn.inplace.less|float|Turn in place value is less than value|
 +|locomotion.turn.inplace.greater|float|Turn in place value is greater than value|
 +|locomotion.reset.time.turn.inplace|''true'', ''false''|Turn in place time linked controllers have to be reset matches value|
 +|locomotion.reverse.time.turn.inplace|''true'', ''false''|Turn in place time linked controllers have to be reversed matches value|
 +|locomotion.can.turn.inplace|''true'', ''false''|Actor can turn in-place if looking beyond limits matches value|
 +|locomotion.limit.turn.inplace.left.less|float|Looking left limit in degrees before turning in-place is less than value|
 +|locomotion.limit.turn.inplace.left.greater|float|Looking left limit in degrees before turning in-place is greater than value|
 +|locomotion.limit.turn.inplace.right.less|float|Looking right limit in degrees before turning in-place is less than value|
 +|locomotion.limit.turn.inplace.right.greater|float|Looking right limit in degrees before turning in-place is greater than value|
 +|locomotion.adjust.analog.move.horizontal.time.less|float|Analog looking left-right adjustment time is less than value in seconds|
 +|locomotion.adjust.analog.move.horizontal.time.greater|float|Analog looking left-right adjustment time is greater than value in seconds|
 +|locomotion.adjust.analog.move.horizontal.range.less|float|Analog looking left-right adjustment range is less than value|
 +|locomotion.adjust.analog.move.horizontal.range.greater|float|Analog looking left-right adjustment range is greater than value|
 +|locomotion.analog.move.horizontal.goal|float|Analog looking left-right value goal to check|
 +|locomotion.analog.move.horizontal.goal.less|float|Difference between ''analog.move.horizontal.goal'' and analog looking left-right goal normalized to the range between -180..180 is less than value|
 +|locomotion.analog.move.horizontal.goal.greater|float|Difference between ''analog.move.horizontal.goal'' and analog looking left-right goal normalized to the range between -180..180 is greater than value|
 +|locomotion.analog.move.horizontal|float|Analog looking left-right value to check|
 +|locomotion.analog.move.horizontal.less|float|Difference between ''analog.move.horizontal'' and analog looking left-right goal normalized to the range between -180..180 is less than value|
 +|locomotion.analog.move.horizontal.less|float|Difference between ''analog.move.horizontal'' and analog looking left-right goal normalized to the range between -180..180 is greater than value|
 +|locomotion.analog.move.speed.less|float|Analog moving speed is less than value|
 +|locomotion.analog.move.speed.greater|float|Analog moving speed is greater than value|
 +|locomotion.is.moving|''true'', ''false''|Actor is moving direct or analog matches value|
 +|locomotion.move.speed.less|float|Moving speed is less than value in meters per second|
 +|locomotion.move.speed.greater|float|Moving speed is greater than value in meters per second|
 +|locomotion.move.speed.absolute.less|float|Absolute moving speed is less than value in meters per second|
 +|locomotion.move.speed.absolute.greater|float|Absolute moving speed is greater than value in meters per second|
 +|locomotion.adjust.linearVelocity.time.less|float|Linear velocity adjustment time is less than value in seconds|
 +|locomotion.adjust.linearVelocity.time.greater|float|Linear velocity adjustment time is greater than value in seconds|
 +|locomotion.adjust.linearVelocity.range.less|float|Linear velocity adjustment range is less than value in meters per second|
 +|locomotion.adjust.linearVelocity.range.greater|float|Linear velocity adjustment range is greater than value in meters per second|
 +|locomotion.move.orientation|float|Movement orientation in world space to check|
 +|locomotion.move.orientation.less|float|Difference between ''move.orientation'' and movement orientation in world space normalized to the range between -180..180 is less than value|
 +|locomotion.move.orientation.greater|float|Difference between ''move.orientation'' and movement orientation in world space normalized to the range between -180..180 is greaterless than value|
 +|locomotion.move.direction.less|float|Movement direction relative to view orientation is less than value in degrees|
 +|locomotion.move.direction.greater|float|Movement direction relative to view orientation is greater than value in degrees|
 +|locomotion.reset.time.walk|''true'', ''false''|Walk/run time linked controllers have to be reset matches value|
 +|locomotion.adjust.stance.time.less|float|Adjustment time for stance is less than value in seconds|
 +|locomotion.adjust.stance.time.greater|float|Adjustment time for stance is greater than value in seconds|
 +|locomotion.adjust.stance.range.less|float|Adjustment range for stance is less than value|
 +|locomotion.adjust.stance.range.greater|float|Adjustment range for stance is greater than value|
 +|locomotion.stance.less|float|Stance value is less than value|
 +|locomotion.stance.greater|float|Stance value is greater than value|
 +|locomotion.stance.goal.less|float|Stance goal value is less than value|
 +|locomotion.stance.goal.greater|float|Stance goal value is greater than value|
 +|locomotion.can.tilt|''true'', ''false''|Actor can tilt the body matches value|
 +|locomotion.tilt.mode|''none'', ''single'', ''weighted''|Tilt mode matches value|
 +|locomotion.tilt.mode.not|''none'', ''single'', ''weighted''|Tilt mode does not match value|
 +|locomotion.limit.tilt.up.less|float|Tilt up limit is less than value in degrees|
 +|locomotion.limit.tilt.up.greater|float|Tilt up limit is greater than value in degrees|
 +|locomotion.limit.tilt.down.less|float|Tilt down limit is less than value in degrees|
 +|locomotion.limit.tilt.down.greater|float|Tilt down limit is greater than value in degrees|
 +|locomotion.tilt.vertical.less|float|Current tilt up/down angle is less than value in degrees|
 +|locomotion.tilt.vertical.greater|float|Current tilt up/down angle is greater than value in degrees|
 +|locomotion.tilt.vertical.goal.less|float|Goal tilt up/down angle is less than value in degrees|
 +|locomotion.tilt.vertical.goal.greater|float|Goal tilt up/down angle is greater than value in degrees|
 +|locomotion.adjust.tilt.vertical.time.less|float|Tilt up/down adjust time is less than value in seconds|
 +|locomotion.adjust.tilt.vertical.time.greater|float|Tilt up/down adjust time is greater than value in seconds|
 +|locomotion.adjust.tilt.vertical.range.less|float|Tilt up/down adjust range is less than value|
 +|locomotion.adjust.tilt.vertical.range.greater|float|Tilt up/down adjust range is greater than value|
 +|locomotion.limit.tilt.left.less|float|Tilt left limit is less than value in degrees|
 +|locomotion.limit.tilt.left.greater|float|Tilt left limit is greater than value in degrees|
 +|locomotion.limit.tilt.right.less|float|Tilt right limit is less than value in degrees|
 +|locomotion.limit.tilt.right.greater|float|Tilt right limit is greater than value in degrees|
 +|locomotion.tilt.horizontal.less|float|Current tilt left/right angle less than value in degrees|
 +|locomotion.tilt.horizontal.greater|float|Current tilt left/right angle greater than value in degrees|
 +|locomotion.tilt.horizontal.goal.less|float|Goal tilt left/right angle is less than value in degrees|
 +|locomotion.tilt.horizontal.goal.greater|float|Goal tilt left/right angle is greater than value in degrees|
 +|locomotion.adjust.tilt.horizontal.time.less|float|Tilt left/right adjust time is less than value in seconds|
 +|locomotion.adjust.tilt.horizontal.time.greater|float|Tilt left/right adjust time is greater than value in seconds|
 +|locomotion.adjust.tilt.horizontal.range.less|float|Tilt left/right adjust range is less than value|
 +|locomotion.adjust.tilt.horizontal.range.greater|float|Tilt left/right adjust range is greater than value|
 +|locomotion.tilt.offset.less|float|Tilt offset is less than value in meters|
 +|locomotion.tilt.offset.greater|float|Tilt offset is greater than value in meters|
 +
 +This is an example of using this condition:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='locomotion.enabled'>true</parameter>
 +  <condition>locomotion.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 sends no state machine events.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 40: Line 488:
 ====== Optional Behaviors ====== ====== Optional Behaviors ======
  
-This behavior does not support optional behaviors.+  * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use. 
 +  * [[behavior_statemachine|ECBehaviorStateMachine]]: Add actions and conditions for state machine to use and events to send to the state machine.
  
 ====== Persistency ====== ====== Persistency ======
Line 89: Line 538:
      
   <behavior type='ECBehaviorLocomotion'>   <behavior type='ECBehaviorLocomotion'>
 +    <!-- optional: add behavior trees. default adds all behavior trees. -->
 +    <list name='behaviorTrees'>
 +      <string/> <!-- add behavior with empty identifier -->
 +      <string>default</string> <!-- add behavior with 'default' identifier -->
 +    </list>
 +    
 +    <!-- optional: add state machines. default adds all state machines. -->
 +    <list name='stateMachines'>
 +      <string/> <!-- add behavior with empty identifier -->
 +      <string>default</string> <!-- add behavior with 'default' identifier -->
 +    </list>
 +    
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
     <string name='.name'>value</string>     <string name='.name'>value</string>
dragengine/modules/dragonscript/behavior_locomotion.txt · Last modified: 2025/05/14 14:12 by dragonlord