User Tools

Site Tools


dragengine:modules:dragonscript:behavior_actoranimated

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_actoranimated [2025/05/08 18:21] – dragonlorddragengine:modules:dragonscript:behavior_actoranimated [2026/09/26 22:31] (current) – [controllerMapping (behavior factor)] dragonlord
Line 40: Line 40:
 </code></WRAP> </code></WRAP>
  
 +===== controllerMapping (behavior factor) =====
 +
 +Sets the animator controller mappings. These mappings are assigned to [[behavior_locomotion|ECBehaviorLocomotion]] if present in the class. This allows to easily apply certain actor input parameters to animators using controllers of the matching names. This is a behavior factory only parameter (see section [[#behavior_factory|Behavior Factory]]). The value is a dictionary mapping animator controller names to locomotion attributes. These are the default mappings:
 +  * "idle": LocomotionAttribute.elapsedTime
 +  * "look.vertical": LocomotionAttribute.lookVertical
 +  * "look.horizontal": LocomotionAttribute.lookHorizontal
 +  * "turn.inPlace": LocomotionAttribute.timeTurnIP
 +  * "turn.velocity": LocomotionAttribute.turningSpeed
 +  * "stance": LocomotionAttribute.stance
 +  * "move.walk": LocomotionAttribute.displacement
 +  * "move.run": LocomotionAttribute.displacement
 +  * "move.velocity": LocomotionAttribute.relativeMovingSpeed
 +  * "move.speed": LocomotionAttribute.movingSpeed
 +  * "move.direction": LocomotionAttribute.movingDirection
 +  * "tilt.vertical": LocomotionAttribute.tiltVertical
 +  * "tilt.horizontal": LocomotionAttribute.tiltHorizontal
 +  * "tilt.offset": LocomotionAttribute.tiltOffset
 +  * "interaction": LocomotionAttribute.elapsedTime
 +
 +Hence if you want an animator to react to the movement speed add a controller named ''move.velocity'' with the respective range. By changing the mapping you can use names appropriate for your animators. Keep in mind all animators used with this behavior have to use the same names. If you want to change the mappings mid-game you have to use script code or behavior tree actions to change the mapping whenever you change the animator.
 ====== Events ====== ====== Events ======
  
Line 76: Line 96:
 |controller.value.upper|float|Set current value of controller ''controller.name'' to upper value| |controller.value.upper|float|Set current value of controller ''controller.name'' to upper value|
 |controller.value.reverse| |Reverse current value of controller ''controller.name''. Hence upper becomes lower and vice versa| |controller.value.reverse| |Reverse current value of controller ''controller.name''. Hence upper becomes lower and vice versa|
-|apply| |Apply animator. This starts the asynchronous process of applying the animator without waiting until it is finished. Waiting is done automatically whenever actions require the result.| 
  
 This is an example of using this action: This is an example of using this action:
Line 82: Line 101:
 <action name='actorAnimated.set'> <action name='actorAnimated.set'>
   <parameter name='animator'>open door</parameter>   <parameter name='animator'>open door</parameter>
 +</action>
 +</code>
 +
 +===== actorAnimated.update =====
 +
 +Update actor animated.
 +
 +^Parameter^Value^Description^
 +|notifyControllersChanged| |Notify all listeners controllers changed.|
 +|apply| |Apply animator. This starts the asynchronous process of applying the animator without waiting until it is finished. Waiting is done automatically whenever actions require the result.|
 +
 +This is an example of using this action:
 +<code xml>
 +<action name='actorAnimated.update'>
 +  <parameter name='apply'/>
 </action> </action>
 </code> </code>
dragengine/modules/dragonscript/behavior_actoranimated.1746728519.txt.gz · Last modified: by dragonlord