Drag[en]gine Script Module DragonScript 1.32.1
Loading...
Searching...
No Matches
Dragengine.ConversationSystem.BaseConversationPlayback Class Reference

Conversation playback for use with BaseGameApp. More...

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

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

Public Attributes

CommandLineParser pCommandParser
 
Dictionary pCommands
 
TagResolver pCommandTagResolver
 
Dictionary pConditions
 
InputProcessor pInputProcessor
 
ECBehaviorPlayerControllable.Tracker pPlayerControlledActor
 
CameraDirector pRestoreCameraDirector
 
InputProcessor pRestoreInputProcessor
 
- Public Attributes inherited from Dragengine.ConversationSystem.ConversationPlayback
ConversationPlaybackLane pActiveLane
 
Array pActors
 
ConversationCameraDirector pCameraDirector
 
Conversation pConversation
 
Array pListeners
 
ConversationPlaybackPlayerChoice pPlayerChoice
 
bool pRunning
 
SafeArray pSideLanes
 
ConversationPlaybackSubTitle pSubTitle
 
ConversationTopic pTopic
 
ConversationTopicGroup pTopicGroup
 
TranslationManager pTranslationManager
 
Dictionary pVariables
 

Protected Member Functions

ConversationCameraDirector createCameraDirector ()
 Create camera director or null to keep the current one.
 
InputProcessor createInputProcessor ()
 Create input processor or null to keep the current one.
 
- Protected Member Functions inherited from Dragengine.ConversationSystem.ConversationPlayback
ConversationPlaybackLane getActiveLane ()
 Active lane.
 
void setActiveLane (ConversationPlaybackLane lane)
 Set active lane.
 

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(Array).

Version 1.29

Added support for tag resolving command before parsing it into an array. This allows to use dynamic command parts without needing to create special conversation commands. The context used for resolving is this instance.

◆ 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

◆ getCommandTagResolver()

TagResolver Dragengine.ConversationSystem.BaseConversationPlayback.getCommandTagResolver ( )

Command tag resolver.

Version
1.29

◆ 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/4]

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

Create conversation playback.

Reimplemented from Dragengine.ConversationSystem.ConversationPlayback.

◆ new() [2/4]

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

Create conversation playback.

◆ new() [3/4]

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.

◆ new() [4/4]

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

◆ 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

◆ setCommandTagResolver()

void Dragengine.ConversationSystem.BaseConversationPlayback.setCommandTagResolver ( TagResolver  resolver)

Set command tag resolver.

Version
1.29

◆ 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.

Member Data Documentation

◆ pCommandParser

CommandLineParser Dragengine.ConversationSystem.BaseConversationPlayback.pCommandParser

◆ pCommands

Dictionary Dragengine.ConversationSystem.BaseConversationPlayback.pCommands

◆ pCommandTagResolver

TagResolver Dragengine.ConversationSystem.BaseConversationPlayback.pCommandTagResolver

◆ pConditions

Dictionary Dragengine.ConversationSystem.BaseConversationPlayback.pConditions

◆ pInputProcessor

InputProcessor Dragengine.ConversationSystem.BaseConversationPlayback.pInputProcessor

◆ pPlayerControlledActor

ECBehaviorPlayerControllable.Tracker Dragengine.ConversationSystem.BaseConversationPlayback.pPlayerControlledActor

◆ pRestoreCameraDirector

CameraDirector Dragengine.ConversationSystem.BaseConversationPlayback.pRestoreCameraDirector

◆ pRestoreInputProcessor

InputProcessor Dragengine.ConversationSystem.BaseConversationPlayback.pRestoreInputProcessor

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