Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ECBehaviorConversationActor Class Reference

Behavior adding conversation actor support to actors. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorConversationActor:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

interface  Listener
 Listener for behavior instance events. More...
 

Additional Inherited Members

- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
void dispose ()
 Dispose of behavior. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Behavior adding conversation actor support to actors.

Provides ConversationActor with basic properties set depending on what behaviors are present before this behavior. In addition supports for other behaviors to modify and extend the ConversationActor namely adding game and condition commands or modify sub title boxes using listener support.

To use this class add these behaviors to the actor:

Supports these behaviors if present:

Basic ConversationActor is set up like this:

This behavior does not update itself automatically during thinking because locomotion handling in actors needs a specific order to work correctly:

  • ECBehaviorConversationActor.updateLocomotion(elapsed)
  • update locomotion using actor action, player input and other means
  • ECBehaviorConversationActor.updateAnimator(elapsed, actor.getAnimatorInstance())
  • apply actor animator instance to component
  • ECBehaviorConversationActor.applyAnimations()

ECBehaviorConversationActor.updateLocomotion() has to be called before calling Locomotion.update() since the HeadLookAtPlayback modifies the locomotion goal parameters.

ECBehaviorConversationActor.updateAnimator() has to be called before applying animations since playback instances use the base animator instance controllers as input.

It is possible to use this behavior on non-actor elements. In this case add first a behavior providing animator support and assign it to the behavior. Then this behavior will register and update in the right time. Supported are these behaviors:

Version 1.5 Additions

Behavior supports re-mapping bone names in response to ConversationActor.getMatrix() and ConversationActor.getInverseMatrix() . Define bone mappings using setBoneMapping(). The mappings are persistent until changed. Bone mappings are useful for various situations including the following ones:

  • Use element with mismatching bone names. Using bone mapping the required conversation bone names are mapped to the actual rig bone name without needing to change the conversation scripts.
  • Dynamically change the meaning of a target bone. This can be used to refer to either the left or right hand of an actor by using a virtual bone name. Script code can change the mapping for the bone at any time to make conversation scripts always refer to the right actor hand.
Version 1.19 Additions

ECBehaviorBehaviorTree behaviors can be added to the behavior using addBehaviorTree(ECBehaviorBehaviorTree). This will add behavior tree actions and conditions to all added behavior tree contexts. The following actions and conditions are added.

Condition "conversationActor.inConversation"

Determines if conversation actor is in a conversation.

This is an example of an action that can only run if the actor is in a conversation:

<action name='myAction' id='doing something'>
<condition>conversationActor.inConversation</condition>
</action>

Condition "conversationActor.notInConversation"

Determines if conversation actor is not in a conversation.

This is an example of an action that can only run if the actor is not in a conversation:

<action name='myAction' id='doing something'>
<condition>conversationActor.notInConversation</condition>
</action>

The documentation for this class was generated from the following file: