Start Page » DragonScript Scripting Language » Abstraction Layers: How you want to build your Game » Behavior Elements » ECBehaviorLocomotion
Behavior element behavior adding locomotion support for actors.
Adds Locomotion. Actors use Locomotion to move their AI colliders across the game world. Locomotion also provides values for AnimatorController to provide animation to actors matching their movement.
Uses collider of ECBehaviorColliderAI or ECBehaviorCollider depending which one is present. If both are present ECBehaviorColliderAI is preferred.
By default creates instance of Locomotion. This class provides all the basic behavior to do locomotion for different type of actors. Supports organic locomotion of 2-legged and 4-legged characters with natural and FPS type movement patterns as well as mechanical locomotion like vehicles.
Locomotion parameters have to be set on runtime. The behavior itself does not support initializing locomotion parameters. This is the case since locomotion parameters change a lot depending on what game situation an actor is located in. Use ECBehaviorActorAIAction, ECBehaviorStateMachine or ECBehaviorBehaviorTree for this task.
The ECBehaviorLocomotion provides access to the locomotion class to modify at runtime.
See also:
This behavior can be used only once on an element.
Element class properties have the prefix locomotion.
.
This behavior has no events.
This behavior adds these behavior tree actions if behavior tree is present.
Set one or more locomotion parameters.
Parameter | Value | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
preset | human , vehicle | Initialize locomotion with common parameters.
|
|||||||||
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 | Tilt mode
|
|||||||||
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:
<action name='locomotion.set'> <parameter name='preset'>human</parameter> </action>
Update locomotion.
Parameter | Value | Description |
---|---|---|
cancel.input | Cancel input. Resets these parameters:
Stance: set goal to value |
|
cancel.movement |
Cancel Movement. Includes
|
|
cancel.motion |
Cancel motion. Includes
|
|
cancel.turn.inplace | Cancel turning in-place. Resets these parameters:
|
|
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 | 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:
|
|
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:
<sequence> <action name='locomotion.check'> <parameter name='enabled'>true</parameter> </action> <!-- actions here run only if locomotion is enabled --> </sequence>
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:
<sequence> <action name='locomotion.check'> <parameter name='enabled'>true</parameter> </action> <!-- actions here run only if locomotion is enabled --> </sequence>
This behavior adds these behavior tree conditions if behavior tree is present.
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:
<action name='myAction' id='doing something'> <parameter name='locomotion.enabled'>true</parameter> <condition>locomotion.check</condition> </action>
Same as Behavior Tree Actions.
Same as Behavior Tree Conditions.
This behavior sends no state machine events.
This behavior does support element class to be persistable (setPersistable). Saves locomotion state.
Since DragonScript Module Version 1.0
This example defines an element which supports locomotion for actors. For vehicles omit ECBehaviorColliderAI and use ECBehaviorCollider instead.
class MyElement extends BehaviorElementClass public var ECBehaviorComponent component public var ECBehaviorCollider collider public var ECBehaviorColliderAI colliderAI public var ECBehaviorLocomotion locomotion func new() component = ECBehaviorComponent.new(this, null) collider = ECBehaviorCollider.new(this, component) colliderAI = ECBehaviorColliderAI.new(this, collider) locomotion = ECBehaviorLocomotion.new(this, colliderAI) end end
Using element class supporting adding behaviors the behavior can be added like this:
<?xml version='1.0' encoding='UTF-8'?> <elementClass name='MyClass' class='GenericBehaviorElement'> <behavior type='ECBehaviorComponent'/> <behavior type='ECBehaviorCollider'/> <!-- for vehicles omit this line to use ECBehaviorCollider instead --> <behavior type='ECBehaviorColliderAI'/> <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 --> <string name='.name'>value</string> </behavior> </elementClass>