Drag[en]gine Script Module DragonScript  1.21
Dragengine.ConversationSystem.BaseConversationPlayback Class Reference

Conversation playback for use with BaseGameApp. More...

Inheritance diagram for Dragengine.ConversationSystem.BaseConversationPlayback:
Dragengine.ConversationSystem.ConversationPlayback Dragengine.LoadSave.Persistable

Classes

interface  ConversationCommand
 Conversation command. More...
 
interface  ConversationCondition
 Conversation condition. More...
 
class  Factory
 Factory for loading. More...
 

Public Member Functions

void addActor (BaseActor actor, StringID alias)
 Add actor. More...
 
void addActor (ECBehaviorConversationActor.Instance actor, StringID alias)
 Add actor. More...
 
void addCommand (String name, ConversationCommand command)
 Add command replacing command with same name if present. More...
 
void addCondition (String name, ConversationCondition condition)
 Add condition replacing condition with same name if present. More...
 
void addPlayerActor ()
 Add actor controlled by player with alias "player". More...
 
void addPlayerActor (StringID alias)
 Add actor controlled by player. More...
 
bool conditionGameCommand (String command)
 Game condition command send by the conversation script. More...
 
ConversationCoordSystem createConversationCoordSystem (StringID id)
 Create coordinate system matching conversation identifier. More...
 
void dispose ()
 Dispose of conversation playback. More...
 
bool evaluateCondition (Array arguments)
 Game condition command send by the conversation script. More...
 
void gameCommand (String command)
 Game command send by the conversation script. More...
 
int getCommandCount ()
 Count of conversation commands. More...
 
ConversationCommand getCommandNamed (String name)
 Named command or null if absent. More...
 
Array getCommandNames ()
 Supported command names as Array of String. More...
 
CommandLineParser getCommandParser ()
 Command parser. More...
 
int getConditionCount ()
 Count of conversation condition. More...
 
ConversationCondition getConditionNamed (String name)
 Named condition or null if absent. More...
 
Array getConditionNames ()
 Supported condition names as Array of String. More...
 
InputProcessor getInputProcessor ()
 Input processor or null to not change. More...
 
ECBehaviorPlayerControllable.Tracker getPlayerControlledActor ()
 Player controlled actor. More...
 
TSTriggerTable getTriggerTable ()
 Trigger table to use. More...
 
ConversationActor loadConversationActor (StringID id)
 Get actor matching conversation identifier. More...
 
BaseConversationPlayback new (Conversation conversation)
 Create conversation playback. More...
 
BaseConversationPlayback new (Conversation conversation, ECBehaviorPlayerControllable.Tracker playerControlledActor)
 Create conversation playback. More...
 
BaseConversationPlayback new (PersistencyEnvironment env, FileReader reader)
 Read from file. More...
 
void onConversationStarted ()
 Conversation started hook method. More...
 
void onConversationStopped ()
 Conversation stopped hook method. More...
 
String persistencyFactoryName ()
 Name of PersistencyFactory required to load object from file. More...
 
void runCommand (Array arguments)
 Game command send by the conversation script. More...
 
void setCommandParser (CommandLineParser parser)
 Set command parser. More...
 
void setInputProcessor (InputProcessor inputProcessor)
 Set input processor or null to not change. More...
 
void setTopic (String idTopicGroup, String idTopic)
 Set conversation topic. More...
 
- Public Member Functions inherited from Dragengine.ConversationSystem.ConversationPlayback
void addActor (ConversationActor actor, StringID alias)
 Add actor with alias if absent. More...
 
void addCoordSystem (ConversationCoordSystem coordSystem, StringID alias)
 Add coordinate system with alias if absent. More...
 
void addListener (ConversationPlaybackListener listener)
 Add listener. More...
 
void changeMusic (String music)
 Switch music. More...
 
void forEachCoordSystem (Block ablock)
 Visit coordinate systems with block with parameter ConversationCoordSystem. More...
 
ConversationActor getActorAt (int index)
 Actor by index. More...
 
int getActorCount ()
 Number of actors. More...
 
ConversationActor getActorMatching (StringID id)
 Actor with ID or number or null if absent. More...
 
ConversationCameraDirector getCameraDirector ()
 Camera director or null. More...
 
ConversationCoordSystem getCoordSystemByID (StringID id)
 Coordinate system with ID or <em null if absent. More...
 
int getCoordSystemCount ()
 Number of coordinate systems. More...
 
float getElapsedActionWaiting ()
 Elapsed action waiting time in seconds. More...
 
bool getEnableFastForwardSpeaking ()
 Enabling calling fastForwardSpeaking() to be allowed. More...
 
ConversationAction getNextAction ()
 Next action or null if top layer is finished. More...
 
bool getPaused ()
 Playback is paused. More...
 
ConversationPlaybackPlayerChoice getPlayerChoice ()
 Player choice interface or null. More...
 
bool getRunning ()
 Playback is running. More...
 
ConversationPlaybackSubTitle getSubTitle ()
 Sub title or null. More...
 
ConversationTopic getTopic ()
 Topic being talking about. More...
 
ConversationTopicGroup getTopicGroup ()
 Topic group being talking about. More...
 
ConversationPlaybackLayer getTopLayer ()
 Top layer. More...
 
TranslationManager getTranslationManager ()
 Translation manager or null. More...
 
int getVariable (String name, int defaultValue)
 Variable value or default value if not set. More...
 
bool getWaitingForAction ()
 Waiting for action to begin. More...
 
bool hasNextAction ()
 Next action is present. More...
 
bool hasVariable (String name)
 Variable is set. More...
 
void notifyRunningChanged ()
 Notify listeners running state changed. More...
 
void popLayer ()
 Pop top layer off stack. More...
 
void processActions (float elapsed, bool skipDelay)
 Process actions. More...
 
void pushLayer (ConversationPlaybackLayer layer)
 Push layer to top of stack. More...
 
void readDelayedFromFile (PersistencyEnvironment env, FileReader reader)
 Read data from file accessing subclass implemented methods. More...
 
void removeActor (ConversationActor actor)
 Remove actor if present. More...
 
void removeAllActors ()
 Remove all actors. More...
 
void removeAllCoordSystems ()
 Remove all coordinate systems. More...
 
void removeAllLayers ()
 Remove all layers. More...
 
void removeAllVariables ()
 Remove all variables. More...
 
void removeCoordSystem (ConversationCoordSystem coordSystem)
 Remove coordinate system if present. More...
 
void removeListener (ConversationPlaybackListener listener)
 Remove listener if present. More...
 
void removeVariable (String name)
 Remove variable if set. More...
 
void setCameraDirector (ConversationCameraDirector director)
 Set camera director or null. More...
 
void setEnableFastForwardSpeaking (bool enable)
 Set if calling fastForwardSpeaking() is allowed. More...
 
void setPaused (bool paused)
 Set if playback is paused. More...
 
void setPlayerChoice (ConversationPlaybackPlayerChoice playerChoice)
 Set player choice interface or null. More...
 
void setRunning (bool running)
 Set if playback is running. More...
 
void setSubTitle (ConversationPlaybackSubTitle subTitle)
 Set sub title or null. More...
 
void setTopic (ConversationTopicGroup group, ConversationTopic topic)
 Set topic to talk about. More...
 
void setTranslationManager (TranslationManager translationManager)
 Set translation manager or null. More...
 
void setVariable (String name, int value)
 Set variable. More...
 
void stopConversation ()
 Stop conversation. More...
 
void update (float elapsed)
 Update playback. More...
 
void writeObjectConstructToFile (PersistencyEnvironment env, FileWriter writer)
 Write object data to file writer read during construction time. More...
 
void writeObjectToFile (PersistencyEnvironment env, FileWriter writer)
 Write object to file writer. More...
 

Protected Member Functions

ConversationCameraDirector createCameraDirector ()
 Create camera director or null to keep the current one. More...
 
InputProcessor createInputProcessor ()
 Create input processor or null to keep the current one. More...
 

Detailed Description

Conversation playback for use with BaseGameApp.

Game Commands/Conditions (1.4)

Provides support to define game command and game conditions. Commands received by the conversation scripts are parsed using CommandLineParser. The first argument is used to look up the command or condition to apply. This allows game scripts to register command and condition handlers without needing two overwrite gameCommand() or conditionGameCommand().

Member Function Documentation

◆ addActor() [1/2]

void Dragengine.ConversationSystem.BaseConversationPlayback.addActor ( BaseActor  actor,
StringID  alias 
)

Add actor.

◆ addActor() [2/2]

void Dragengine.ConversationSystem.BaseConversationPlayback.addActor ( ECBehaviorConversationActor.Instance  actor,
StringID  alias 
)

Add actor.

◆ addCommand()

void Dragengine.ConversationSystem.BaseConversationPlayback.addCommand ( String  name,
ConversationCommand  command 
)

Add command replacing command with same name if present.

Version
1.4

◆ addCondition()

void Dragengine.ConversationSystem.BaseConversationPlayback.addCondition ( String  name,
ConversationCondition  condition 
)

Add condition replacing condition with same name if present.

Version
1.4

◆ addPlayerActor() [1/2]

void Dragengine.ConversationSystem.BaseConversationPlayback.addPlayerActor ( )

Add actor controlled by player with alias "player".

◆ addPlayerActor() [2/2]

void Dragengine.ConversationSystem.BaseConversationPlayback.addPlayerActor ( StringID  alias)

Add actor controlled by player.

◆ conditionGameCommand()

bool Dragengine.ConversationSystem.BaseConversationPlayback.conditionGameCommand ( String  command)

Game condition command send by the conversation script.

Parses command using CommandLineParser into Array of String and calls evaluateCondition()

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ createCameraDirector()

ConversationCameraDirector Dragengine.ConversationSystem.BaseConversationPlayback.createCameraDirector ( )
protected

Create camera director or null to keep the current one.

Default implementation creates instance of .

◆ createConversationCoordSystem()

ConversationCoordSystem Dragengine.ConversationSystem.BaseConversationPlayback.createConversationCoordSystem ( StringID  id)

Create coordinate system matching conversation identifier.

This is used to add coordinate system for playing back the conversation. Subclass to create the coordinate system matching a conversation identifier.

Default implementation looks up the identifier in the getConvoCoordSystemList() from the current GameWorld loaded into WindowGameWorld of BaseGameApp.

◆ createInputProcessor()

InputProcessor Dragengine.ConversationSystem.BaseConversationPlayback.createInputProcessor ( )
protected

Create input processor or null to keep the current one.

Default implementation creates instance of ConversationInputProcessor.

◆ dispose()

void Dragengine.ConversationSystem.BaseConversationPlayback.dispose ( )

Dispose of conversation playback.

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ evaluateCondition()

bool Dragengine.ConversationSystem.BaseConversationPlayback.evaluateCondition ( Array  arguments)

Game condition command send by the conversation script.

Version
1.4

Looks up condition to evaluate using first argument. If found evaluates condition using arguments. Otherwise throws an exception.

◆ gameCommand()

void Dragengine.ConversationSystem.BaseConversationPlayback.gameCommand ( String  command)

Game command send by the conversation script.

Parses command using CommandLineParser into Array of String and calls runCommand()

◆ getCommandCount()

int Dragengine.ConversationSystem.BaseConversationPlayback.getCommandCount ( )

Count of conversation commands.

Version
1.4

◆ getCommandNamed()

ConversationCommand Dragengine.ConversationSystem.BaseConversationPlayback.getCommandNamed ( String  name)

Named command or null if absent.

Version
1.4

◆ getCommandNames()

Array Dragengine.ConversationSystem.BaseConversationPlayback.getCommandNames ( )

Supported command names as Array of String.

Version
1.4

◆ getCommandParser()

CommandLineParser Dragengine.ConversationSystem.BaseConversationPlayback.getCommandParser ( )

Command parser.

Version
1.4

◆ getConditionCount()

int Dragengine.ConversationSystem.BaseConversationPlayback.getConditionCount ( )

Count of conversation condition.

Version
1.4

◆ getConditionNamed()

ConversationCondition Dragengine.ConversationSystem.BaseConversationPlayback.getConditionNamed ( String  name)

Named condition or null if absent.

Version
1.4

◆ getConditionNames()

Array Dragengine.ConversationSystem.BaseConversationPlayback.getConditionNames ( )

Supported condition names as Array of String.

Version
1.4

◆ getInputProcessor()

InputProcessor Dragengine.ConversationSystem.BaseConversationPlayback.getInputProcessor ( )

Input processor or null to not change.

◆ getPlayerControlledActor()

ECBehaviorPlayerControllable.Tracker Dragengine.ConversationSystem.BaseConversationPlayback.getPlayerControlledActor ( )

Player controlled actor.

◆ getTriggerTable()

TSTriggerTable Dragengine.ConversationSystem.BaseConversationPlayback.getTriggerTable ( )

Trigger table to use.

◆ loadConversationActor()

ConversationActor Dragengine.ConversationSystem.BaseConversationPlayback.loadConversationActor ( StringID  id)

Get actor matching conversation identifier.

This is used by readFromFile to add actors for playing back the conversation. Subclass to return the actors matching a conversation identifier.

Default implementation looks up the identifier in the getConvoActorList() from the current GameWorld loaded into WindowGameWorld of BaseGameApp.

◆ new() [1/3]

BaseConversationPlayback Dragengine.ConversationSystem.BaseConversationPlayback.new ( Conversation  conversation)

Create conversation playback.

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ new() [2/3]

BaseConversationPlayback Dragengine.ConversationSystem.BaseConversationPlayback.new ( Conversation  conversation,
ECBehaviorPlayerControllable.Tracker  playerControlledActor 
)

Create conversation playback.

◆ new() [3/3]

BaseConversationPlayback Dragengine.ConversationSystem.BaseConversationPlayback.new ( PersistencyEnvironment  env,
FileReader  reader 
)

Read from file.

This call loads only data not accessing subclass implemented methods. To finish loading call readRemainingFromFile().

These objects are not persisted. Subclass is responsible to set them.

  • CameraDirector
  • SubTitle
  • pPlayerChoice

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ onConversationStarted()

void Dragengine.ConversationSystem.BaseConversationPlayback.onConversationStarted ( )

Conversation started hook method.

Called if running state changed to true after sending notifications to listeners.

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ onConversationStopped()

void Dragengine.ConversationSystem.BaseConversationPlayback.onConversationStopped ( )

Conversation stopped hook method.

Called if running state changed to false after sending notifications to listeners.

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ persistencyFactoryName()

String Dragengine.ConversationSystem.BaseConversationPlayback.persistencyFactoryName ( )

Name of PersistencyFactory required to load object from file.

Name of PersistencyFactory is first written to the file as string with 8-bit length. Then writeToFile() is called to write the object itself. Empty name is not allowed as is names longer than 255 characters. Name has to match a PersistencyFactory present in the Persistency instance used for loading objects. Object is read using PersistencyFactory.readObjectFromFile() of the matching PersistencyFactory.

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ runCommand()

void Dragengine.ConversationSystem.BaseConversationPlayback.runCommand ( Array  arguments)

Game command send by the conversation script.

Version
1.4

Looks up command to run using first argument. If found runs command using arguments. Otherwise throws an exception.

◆ setCommandParser()

void Dragengine.ConversationSystem.BaseConversationPlayback.setCommandParser ( CommandLineParser  parser)

Set command parser.

Version
1.4

◆ setInputProcessor()

void Dragengine.ConversationSystem.BaseConversationPlayback.setInputProcessor ( InputProcessor  inputProcessor)

Set input processor or null to not change.

◆ setTopic()

void Dragengine.ConversationSystem.BaseConversationPlayback.setTopic ( String  idTopicGroup,
String  idTopic 
)

Set conversation topic.


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