|
Drag[en]gine Script Module DragonScript 1.35
|
Behavior element behavior adding conversation support. More...
Classes | |
| class | Factory |
| Behavior factory. More... | |
| class | Instance |
| Behavior instance. More... | |
Public Member Functions | |
| void | dispose () |
| Dispose of behavior. | |
| ECPStringID | getAddPlayer () |
| Add player to conversation with identifier or null otherwise. | |
| ECBehaviorBehaviorTree | getBehaviorTree () |
| Behavior tree or null. | |
| ECPConversation | getConversation () |
| Conversation. | |
| ECBehaviorConversationActor | getConversationActor () |
| Conversation actor behavior or null if not used. | |
| ECPBoolean | getDirectCamera () |
| Conversation directs camera. | |
| ECBehaviorPlayerControllable.Tracker | getPlayerControlledActor () |
| Player controlled actor or null. | |
| String | getPrefix () |
| Prefix. | |
| ECPSimpleConversation | getSimpleConversation () |
| Simple conversation. | |
| SimpleConversationConverter | getSimpleConversationConverter () |
| Simple conversation converter. | |
| ECPStringID | getTopic () |
| Topic to use for conversation. | |
| ECPStringID | getTopicGroup () |
| Topic group to use for conversation. | |
| ECBehaviorTriggered | getTriggered () |
| Trigger conversation. | |
| Instance | instance (BehaviorElement element) |
| Get instance in element from owner element class. | |
| ECBehaviorConversation | new (BehaviorElementClass eclass) |
| Create behavior element class. | |
| ECBehaviorConversation | new (BehaviorElementClass eclass, Loaders loaders, TSTriggerTable triggerTable, ECBehaviorPlayerControllable.Tracker playerControlledActor) |
| Create behavior element class. | |
| ECBehaviorConversation | new (BehaviorElementClass eclass, Loaders loaders, TSTriggerTable triggerTable, ECBehaviorPlayerControllable.Tracker playerControlledActor, String id) |
| Create behavior element class. | |
| ECBehaviorConversation | new (BehaviorElementClass eclass, Loaders loaders, TSTriggerTable triggerTable, ECBehaviorPlayerControllable.Tracker playerControlledActor, String id, String subID) |
| ECBehaviorConversation | new (BehaviorElementClass eclass, Loaders loaders, TSTriggerTable triggerTable, ECBehaviorPlayerControllable.Tracker playerControlledActor, String id, String subID, String prefix) |
| ECBehaviorConversation | new (BehaviorElementClass eclass, String id) |
| Create behavior element class. | |
| ECBehaviorConversation | new (BehaviorElementClass eclass, String id, String prefix) |
| Create behavior element class. | |
| void | setBehaviorTree (ECBehaviorBehaviorTree behaviorTree) |
| Set behavior tree or null. | |
| void | setConversationActor (ECBehaviorConversationActor conversationActor) |
| Set conversation actor behavior or null if not used. | |
| void | setPlayerControlledActor (ECBehaviorPlayerControllable.Tracker playerControlledActor) |
| Set player controllable tracker or null. | |
| void | setSimpleConversationConverter (SimpleConversationConverter converter) |
| Set smple conversation converter. | |
| Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| void | assignInstanceIndex (int instanceIndex) |
| Assign instance index. | |
| String | getBehaviorID () |
| Unique identifier of behavior. | |
| String | getID () |
| Identifier. | |
| int | getInstanceIndex () |
| Instance index. | |
| void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
| Load instance data of another behavior. | |
| bool | supportsBehaviorID (String identifier) |
| Behavior supports loading instance data of another behavior. | |
| Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
| ECBehaviorInstance | createInstance (BehaviorElement element) |
| Create Behavior instance. | |
Static Public Member Functions | |
| static ECBehaviorConversation | getBehaviorIn (BehaviorElementClass eclass) |
| Get behavior in element class or null if absent. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| void | setBehaviorID (String identifier) |
| Set behavior identifier. | |
| void | useClassNameAsBehaviorID () |
| Set behavior identifier to "<class-name>:<identifier>". | |
| void | useFullyQualifiedClassNameAsBehaviorID () |
| Set behavior identifier to "<fully-qualified-class-name>:<identifier>". | |
Behavior element behavior adding conversation support.
Loads a conversation resource file and allows to start a conversation using a user defined topic. Conversations are loaded once so multiple behaviors can load the same conversation file without doing the actual loading multiple times.
By default the conversation is started without adding any actors.
If the "addPlayer" stub property is not empty string the BaseGameApp.getPlayerControlledActor() actor is added to the conversation as first actor using the property value as its alias id. If the actor does not have a BaseActorConversation assigned an exception is thrown. The default element class property sets AddPlayer to "player".
If ECBehaviorConversationActor is present and has a conversation actor it is added as second actor to the conversation using the property valus as id. Additional actors can be added using conversation actions.
If the "directCamera" stub property is true the conversation does direct the camera using ConversationCameraDirector instance. The default element class property sets DirectCamera to true. Set this property to false to keep the camera unchanged which is required to do first person camera animations.
Starting the conversation can be done by calling startConversation(). This can be done by other behaviors or a subclass. Care has to be taken when starting conversation if another conversation is running. Actors are not allowed to be involved in more than one conversation but any number of conversation can be running at the same time as long as this rule is fulfilled.
To protect against this situation the method canStartConversation() is provided. It checks if the player and this behavior element have a ConversationActor and are both not involved in a conversation (given they are used for the conversation).
A typical use pattern is to start a conversation with a suitable element if the player "uses" said element. The code example below shows how this can be done in a simple way.
It checks if a behavior element has the ECBehaviorConversation behavior present. If this is the case it checks if the conversation can be started and starts it.
Another way to start a conversation is using the triggerConversation. If this trigger expression is not empty it will be used to start the conversation if the trigger expression evaluates to true. The method canStartConversation() is used to not check if the conversation is possible. If the check fails an exception is thrown to not silently not start a conversation.
This method is typically used to trigger conversation if the player enters a TriggerTouch or he finished a sequence of actions ending in firing a trigger.
This element behavior can be present only once in a BehaviorElement. Trying to add more than one instance results in an exception thrown.
Element class properties have the prefix "conversation.".
This behavior does require the element class to be persistable (setPersistable).
| void Dragengine.Scenery.ECBehaviorConversation.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
References getTopic(), pTopic, and pTopicGroup.
Referenced by getBehaviorIn().
| ECPStringID Dragengine.Scenery.ECBehaviorConversation.getAddPlayer | ( | ) |
Add player to conversation with identifier or null otherwise.
Referenced by getBehaviorIn().
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorConversation.
References Dragengine.Scenery.ECBehavior.createInstance(), dispose(), getAddPlayer(), getBehaviorIn(), getBehaviorTree(), getConversation(), getConversationActor(), getDirectCamera(), getPlayerControlledActor(), getPrefix(), getSimpleConversation(), getSimpleConversationConverter(), getTopic(), getTopicGroup(), getTriggered(), instance(), new(), pAddPlayer, pBehaviorTree, pConversation, pConversationActor, pDirectCamera, pPlayerControlledActor, pPrefix, pSimpleConversation, pSimpleConversationConverter, pTopic, pTopicGroup, pTriggered, setBehaviorTree(), setConversationActor(), setPlayerControlledActor(), and setSimpleConversationConverter().
Referenced by getBehaviorIn().
| ECBehaviorBehaviorTree Dragengine.Scenery.ECBehaviorConversation.getBehaviorTree | ( | ) |
Behavior tree or null.
References pAddPlayer.
Referenced by getBehaviorIn(), Dragengine.Scenery.ECBehaviorConversation.Instance.getTopic(), and Dragengine.Scenery.ECBehaviorConversation.Instance.setTopicGroup().
| ECPConversation Dragengine.Scenery.ECBehaviorConversation.getConversation | ( | ) |
| ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorConversation.getConversationActor | ( | ) |
Conversation actor behavior or null if not used.
References pTopic.
Referenced by getBehaviorIn(), getTopicGroup(), instance(), and new().
| ECPBoolean Dragengine.Scenery.ECBehaviorConversation.getDirectCamera | ( | ) |
Conversation directs camera.
Referenced by getBehaviorIn(), and setConversationActor().
| ECBehaviorPlayerControllable.Tracker Dragengine.Scenery.ECBehaviorConversation.getPlayerControlledActor | ( | ) |
Player controlled actor or null.
Referenced by getBehaviorIn(), and getSimpleConversation().
| String Dragengine.Scenery.ECBehaviorConversation.getPrefix | ( | ) |
Prefix.
Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorConversation.Instance.getTopic().
| ECPSimpleConversation Dragengine.Scenery.ECBehaviorConversation.getSimpleConversation | ( | ) |
Simple conversation.
References getPlayerControlledActor().
Referenced by getBehaviorIn().
| SimpleConversationConverter Dragengine.Scenery.ECBehaviorConversation.getSimpleConversationConverter | ( | ) |
| ECPStringID Dragengine.Scenery.ECBehaviorConversation.getTopic | ( | ) |
Topic to use for conversation.
Referenced by dispose(), and getBehaviorIn().
| ECPStringID Dragengine.Scenery.ECBehaviorConversation.getTopicGroup | ( | ) |
Topic group to use for conversation.
References getConversationActor().
Referenced by getBehaviorIn(), and new().
| ECBehaviorTriggered Dragengine.Scenery.ECBehaviorConversation.getTriggered | ( | ) |
Trigger conversation.
Referenced by getBehaviorIn(), Dragengine.Scenery.ECBehaviorConversation.Instance.getTopicGroup(), and Dragengine.Scenery.ECBehaviorConversation.Instance.BTAStart.runAction().
| Instance Dragengine.Scenery.ECBehaviorConversation.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
References getConversationActor(), and pConversationActor.
Referenced by getBehaviorIn(), Dragengine.Scenery.ECBehaviorConversation.Instance.getConversationActor(), Dragengine.Scenery.ECBehaviorConversation.Instance.getTopic(), Dragengine.Scenery.ECBehaviorConversation.Instance.getTopicGroup(), and Dragengine.Scenery.ECBehaviorConversation.Instance.loadConversation().
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass | ) |
Create behavior element class.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
References getConversationActor(), and pConversationActor.
Referenced by getBehaviorIn().
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass, |
| Loaders | loaders, | ||
| TSTriggerTable | triggerTable, | ||
| ECBehaviorPlayerControllable.Tracker | playerControlledActor ) |
Create behavior element class.
References getTopicGroup(), and pTopicGroup.
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass, |
| Loaders | loaders, | ||
| TSTriggerTable | triggerTable, | ||
| ECBehaviorPlayerControllable.Tracker | playerControlledActor, | ||
| String | id ) |
Create behavior element class.
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass, |
| Loaders | loaders, | ||
| TSTriggerTable | triggerTable, | ||
| ECBehaviorPlayerControllable.Tracker | playerControlledActor, | ||
| String | id, | ||
| String | subID ) |
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass, |
| Loaders | loaders, | ||
| TSTriggerTable | triggerTable, | ||
| ECBehaviorPlayerControllable.Tracker | playerControlledActor, | ||
| String | id, | ||
| String | subID, | ||
| String | prefix ) |
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass, |
| String | id ) |
Create behavior element class.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
| ECBehaviorConversation Dragengine.Scenery.ECBehaviorConversation.new | ( | BehaviorElementClass | eclass, |
| String | id, | ||
| String | prefix ) |
Create behavior element class.
| void Dragengine.Scenery.ECBehaviorConversation.setBehaviorTree | ( | ECBehaviorBehaviorTree | behaviorTree | ) |
Set behavior tree or null.
References pConversationActor.
Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorConversation.Instance.BTAStart.runAction().
| void Dragengine.Scenery.ECBehaviorConversation.setConversationActor | ( | ECBehaviorConversationActor | conversationActor | ) |
Set conversation actor behavior or null if not used.
References getDirectCamera(), and pDirectCamera.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorConversation.setPlayerControlledActor | ( | ECBehaviorPlayerControllable.Tracker | playerControlledActor | ) |
Set player controllable tracker or null.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorConversation.setSimpleConversationConverter | ( | SimpleConversationConverter | converter | ) |
| ECPStringID Dragengine.Scenery.ECBehaviorConversation.pAddPlayer |
Referenced by getBehaviorIn(), and getBehaviorTree().
| ECBehaviorBehaviorTree Dragengine.Scenery.ECBehaviorConversation.pBehaviorTree |
Referenced by getBehaviorIn().
| ECPConversation Dragengine.Scenery.ECBehaviorConversation.pConversation |
Referenced by getBehaviorIn().
| ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorConversation.pConversationActor |
Referenced by getBehaviorIn(), instance(), new(), and setBehaviorTree().
| ECPBoolean Dragengine.Scenery.ECBehaviorConversation.pDirectCamera |
Referenced by getBehaviorIn(), getConversation(), and setConversationActor().
| ECBehaviorPlayerControllable.Tracker Dragengine.Scenery.ECBehaviorConversation.pPlayerControlledActor |
Referenced by getBehaviorIn().
| String Dragengine.Scenery.ECBehaviorConversation.pPrefix |
Referenced by getBehaviorIn().
| ECPSimpleConversation Dragengine.Scenery.ECBehaviorConversation.pSimpleConversation |
Referenced by getBehaviorIn().
| SimpleConversationConverter Dragengine.Scenery.ECBehaviorConversation.pSimpleConversationConverter |
Referenced by getBehaviorIn().
| ECPStringID Dragengine.Scenery.ECBehaviorConversation.pTopic |
Referenced by dispose(), getBehaviorIn(), and getConversationActor().
| ECPStringID Dragengine.Scenery.ECBehaviorConversation.pTopicGroup |
Referenced by dispose(), getBehaviorIn(), and new().
| ECBehaviorTriggered Dragengine.Scenery.ECBehaviorConversation.pTriggered |
Referenced by getBehaviorIn().