This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_actoranimated [2025/03/12 19:37] – [Persistency] dragonlord | dragengine:modules:dragonscript:behavior_actoranimated [2025/05/04 13:43] (current) – [actorAnimated.check] dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 55: | Line 55: | ||
Animator changed. Listener has to reacquire AnimatorController. | Animator changed. Listener has to reacquire AnimatorController. | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== actorAnimated.set ===== | ||
+ | |||
+ | Set one or more actor animated parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |animator|string|Set animator by identifier| | ||
+ | |controller.name|string|Name of controller to manipulate| | ||
+ | |controller.value|float|Set current value of controller '' | ||
+ | |controller.value.increment|float|Increment current value of controller '' | ||
+ | |controller.value.decrement|float|Decrement current value of controller '' | ||
+ | |controller.value.relative|float|Set relative current value of controller '' | ||
+ | |controller.value.relative.increment|float|Increment relative current value of controller '' | ||
+ | |controller.value.relative.decrement|float|Decrement relative current value of controller '' | ||
+ | |controller.value.lower|float|Set current value of controller '' | ||
+ | |controller.value.upper|float|Set current value of controller '' | ||
+ | |controller.value.reverse| |Reverse current value of controller '' | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== actorAnimated.check ===== | ||
+ | |||
+ | Check one or more actor animated parameters. Action succeeds if all parameter value matches their respective actor animated parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a actor animated parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |animator|string|Animator identifier matches string value| | ||
+ | |animator.not|string|Animator identifier does not match string value| | ||
+ | |animator.starts|string|Animator identifier start with string value| | ||
+ | |animator.starts.not|string|Animator identifier does not start with string value| | ||
+ | |animator.ends|string|Animator identifier ends with string value| | ||
+ | |animator.ends.not|string|Animator identifier does not end with string value| | ||
+ | |animator.contains|string|Animator identifier contains string value| | ||
+ | |animator.contains.not|string|Animator identifier does not contain string value| | ||
+ | |controller.name|string|Name of controller to evaluate| | ||
+ | |controller.value.less|float|Current value of controller is less than float value| | ||
+ | |controller.value.greater|float|Current value of controller is greater than float value| | ||
+ | |controller.value.relative.less|float|Relative current value of controller is less than float value| | ||
+ | |controller.value.relative.greater|float|Relative current value of controller is greater than float value| | ||
+ | |controller.value.atLower| |Current value of controller is at lower value| | ||
+ | |controller.value.atUpper| |Current value of controller is at upper 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 active animator has identifier "open door" --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== actorAnimated.check ===== | ||
+ | |||
+ | Check one or more actor animated parameters. Conditions returns true if all parameter value match their respective actor animated parameter. This condition is typically used to run an action or sequence of actions as long as actor animated conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |actorAnimated.animator|string|Animator identifier matches string value| | ||
+ | |actorAnimated.animator.not|string|Animator identifier does not match string value| | ||
+ | |actorAnimated.animator.starts|string|Animator identifier start with string value| | ||
+ | |actorAnimated.animator.starts.not|string|Animator identifier does not start with string value| | ||
+ | |actorAnimated.animator.ends|string|Animator identifier ends with string value| | ||
+ | |actorAnimated.animator.ends.not|string|Animator identifier does not end with string value| | ||
+ | |actorAnimated.animator.contains|string|Animator identifier contains string value| | ||
+ | |actorAnimated.animator.contains.not|string|Animator identifier does not contain string value| | ||
+ | |actorAnimated.controller.name|string|Name of controller to evaluate| | ||
+ | |actorAnimated.controller.value.less|float|Current value of controller is less than float value| | ||
+ | |actorAnimated.controller.value.greater|float|Current value of controller is greater than float value| | ||
+ | |actorAnimated.controller.value.relative.less|float|Relative current value of controller is less than float value| | ||
+ | |actorAnimated.controller.value.relative.greater|float|Relative current value of controller is greater than float value| | ||
+ | |actorAnimated.controller.value.atLower| |Current value of controller is at lower value| | ||
+ | |actorAnimated.controller.value.atUpper| |Current value of controller is at upper value| | ||
+ | |||
+ | 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 sends these state machine events. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | This behavior has these events: | ||
+ | |||
+ | ===== actorAnimated.animator ===== | ||
+ | |||
+ | Animator changed. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
Line 63: | Line 174: | ||
* [[behavior_locomotion|ECBehaviorLocomotion]]: | * [[behavior_locomotion|ECBehaviorLocomotion]]: | ||
+ | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 111: | Line 224: | ||
<!-- optional: use component with id instead of empty string --> | <!-- optional: use component with id instead of empty string --> | ||
<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=' | ||
+ | | ||
+ | <!-- | ||
+ | optional: set controller mapping instead of using default mapping. | ||
+ | keys are the controller names and value the LocomotionAttribute constant names. | ||
+ | the listing below is equivalent to the default controller mapping. | ||
+ | --> | ||
+ | <map name=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | <string key=' | ||
+ | </ | ||
| | ||
<!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> |