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

Play back conversation. More...

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

Public Member Functions

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...
 
bool conditionGameCommand (String command)
 Game condition command send by the conversation script. More...
 
void dispose ()
 Dispose of conversation playback. 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...
 
ConversationPlayback new (Conversation conversation)
 Create conversation playback. More...
 
ConversationPlayback new (PersistencyEnvironment env, FileReader reader)
 Read from file. More...
 
void notifyRunningChanged ()
 Notify listeners running state changed. 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 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...
 

Detailed Description

Play back conversation.

Member Function Documentation

◆ addActor()

void Dragengine.ConversationSystem.ConversationPlayback.addActor ( ConversationActor  actor,
StringID  alias 
)

Add actor with alias if absent.

◆ addCoordSystem()

void Dragengine.ConversationSystem.ConversationPlayback.addCoordSystem ( ConversationCoordSystem  coordSystem,
StringID  alias 
)

Add coordinate system with alias if absent.

◆ addListener()

void Dragengine.ConversationSystem.ConversationPlayback.addListener ( ConversationPlaybackListener  listener)

Add listener.

◆ changeMusic()

void Dragengine.ConversationSystem.ConversationPlayback.changeMusic ( String  music)

Switch music.

Overwrite to make the game change music. The default implementation does nothing.

◆ conditionGameCommand()

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

Game condition command send by the conversation script.

Overwrite to make the game evaluate the command returning true or false as result. The default implementation returns false.

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ dispose()

void Dragengine.ConversationSystem.ConversationPlayback.dispose ( )

Dispose of conversation playback.

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ forEachCoordSystem()

void Dragengine.ConversationSystem.ConversationPlayback.forEachCoordSystem ( Block  ablock)

Visit coordinate systems with block with parameter ConversationCoordSystem.

◆ getActorAt()

ConversationActor Dragengine.ConversationSystem.ConversationPlayback.getActorAt ( int  index)

Actor by index.

◆ getActorCount()

int Dragengine.ConversationSystem.ConversationPlayback.getActorCount ( )

Number of actors.

◆ getActorMatching()

ConversationActor Dragengine.ConversationSystem.ConversationPlayback.getActorMatching ( StringID  id)

Actor with ID or number or null if absent.

◆ getCameraDirector()

ConversationCameraDirector Dragengine.ConversationSystem.ConversationPlayback.getCameraDirector ( )

Camera director or null.

◆ getCoordSystemByID()

ConversationCoordSystem Dragengine.ConversationSystem.ConversationPlayback.getCoordSystemByID ( StringID  id)

Coordinate system with ID or <em null if absent.

◆ getCoordSystemCount()

int Dragengine.ConversationSystem.ConversationPlayback.getCoordSystemCount ( )

Number of coordinate systems.

◆ getElapsedActionWaiting()

float Dragengine.ConversationSystem.ConversationPlayback.getElapsedActionWaiting ( )

Elapsed action waiting time in seconds.

Version
1.16

◆ getEnableFastForwardSpeaking()

bool Dragengine.ConversationSystem.ConversationPlayback.getEnableFastForwardSpeaking ( )

Enabling calling fastForwardSpeaking() to be allowed.

◆ getNextAction()

ConversationAction Dragengine.ConversationSystem.ConversationPlayback.getNextAction ( )

Next action or null if top layer is finished.

Version
1.16

◆ getPaused()

bool Dragengine.ConversationSystem.ConversationPlayback.getPaused ( )

Playback is paused.

◆ getPlayerChoice()

ConversationPlaybackPlayerChoice Dragengine.ConversationSystem.ConversationPlayback.getPlayerChoice ( )

Player choice interface or null.

◆ getRunning()

bool Dragengine.ConversationSystem.ConversationPlayback.getRunning ( )

Playback is running.

◆ getSubTitle()

ConversationPlaybackSubTitle Dragengine.ConversationSystem.ConversationPlayback.getSubTitle ( )

Sub title or null.

◆ getTopic()

ConversationTopic Dragengine.ConversationSystem.ConversationPlayback.getTopic ( )

Topic being talking about.

◆ getTopicGroup()

ConversationTopicGroup Dragengine.ConversationSystem.ConversationPlayback.getTopicGroup ( )

Topic group being talking about.

◆ getTopLayer()

ConversationPlaybackLayer Dragengine.ConversationSystem.ConversationPlayback.getTopLayer ( )

Top layer.

◆ getTranslationManager()

TranslationManager Dragengine.ConversationSystem.ConversationPlayback.getTranslationManager ( )

Translation manager or null.

Version
1.16

◆ getVariable()

int Dragengine.ConversationSystem.ConversationPlayback.getVariable ( String  name,
int  defaultValue 
)

Variable value or default value if not set.

◆ getWaitingForAction()

bool Dragengine.ConversationSystem.ConversationPlayback.getWaitingForAction ( )

Waiting for action to begin.

Version
1.16

◆ hasNextAction()

bool Dragengine.ConversationSystem.ConversationPlayback.hasNextAction ( )

Next action is present.

◆ hasVariable()

bool Dragengine.ConversationSystem.ConversationPlayback.hasVariable ( String  name)

Variable is set.

◆ new() [1/2]

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

Create conversation playback.

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ new() [2/2]

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

Read from file.

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

The typical factory call would look like this:

public func Persistable readObjectFromFile(PersistencyEnvironment env, FileReader reader)
var MyConversationPlayback playback = MyConversationPlayback.new(env, reader)
playback.readDelayedFromFile(env, reader)
return playback
end

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

  • CameraDirector
  • SubTitle
  • pPlayerChoice

Subclass is usually not required to store additional data except initializing the above mentioned.

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ notifyRunningChanged()

void Dragengine.ConversationSystem.ConversationPlayback.notifyRunningChanged ( )

Notify listeners running state changed.

◆ onConversationStarted()

void Dragengine.ConversationSystem.ConversationPlayback.onConversationStarted ( )

Conversation started hook method.

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

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ onConversationStopped()

void Dragengine.ConversationSystem.ConversationPlayback.onConversationStopped ( )

Conversation stopped hook method.

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

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ persistencyFactoryName()

String Dragengine.ConversationSystem.ConversationPlayback.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.

Implements Dragengine.LoadSave.Persistable.

Reimplemented in Dragengine.ConversationSystem.BaseConversationPlayback.

◆ popLayer()

void Dragengine.ConversationSystem.ConversationPlayback.popLayer ( )

Pop top layer off stack.

◆ processActions()

void Dragengine.ConversationSystem.ConversationPlayback.processActions ( float  elapsed,
bool  skipDelay 
)

Process actions.

◆ pushLayer()

void Dragengine.ConversationSystem.ConversationPlayback.pushLayer ( ConversationPlaybackLayer  layer)

Push layer to top of stack.

◆ readDelayedFromFile()

void Dragengine.ConversationSystem.ConversationPlayback.readDelayedFromFile ( PersistencyEnvironment  env,
FileReader  reader 
)

Read data from file accessing subclass implemented methods.

Call after subclass is properly constructed. Subclass usually does not require to overwrite this method.

◆ removeActor()

void Dragengine.ConversationSystem.ConversationPlayback.removeActor ( ConversationActor  actor)

Remove actor if present.

◆ removeAllActors()

void Dragengine.ConversationSystem.ConversationPlayback.removeAllActors ( )

Remove all actors.

◆ removeAllCoordSystems()

void Dragengine.ConversationSystem.ConversationPlayback.removeAllCoordSystems ( )

Remove all coordinate systems.

◆ removeAllLayers()

void Dragengine.ConversationSystem.ConversationPlayback.removeAllLayers ( )

Remove all layers.

◆ removeAllVariables()

void Dragengine.ConversationSystem.ConversationPlayback.removeAllVariables ( )

Remove all variables.

◆ removeCoordSystem()

void Dragengine.ConversationSystem.ConversationPlayback.removeCoordSystem ( ConversationCoordSystem  coordSystem)

Remove coordinate system if present.

◆ removeListener()

void Dragengine.ConversationSystem.ConversationPlayback.removeListener ( ConversationPlaybackListener  listener)

Remove listener if present.

◆ removeVariable()

void Dragengine.ConversationSystem.ConversationPlayback.removeVariable ( String  name)

Remove variable if set.

◆ setCameraDirector()

void Dragengine.ConversationSystem.ConversationPlayback.setCameraDirector ( ConversationCameraDirector  director)

Set camera director or null.

◆ setEnableFastForwardSpeaking()

void Dragengine.ConversationSystem.ConversationPlayback.setEnableFastForwardSpeaking ( bool  enable)

Set if calling fastForwardSpeaking() is allowed.

◆ setPaused()

void Dragengine.ConversationSystem.ConversationPlayback.setPaused ( bool  paused)

Set if playback is paused.

◆ setPlayerChoice()

void Dragengine.ConversationSystem.ConversationPlayback.setPlayerChoice ( ConversationPlaybackPlayerChoice  playerChoice)

Set player choice interface or null.

◆ setRunning()

void Dragengine.ConversationSystem.ConversationPlayback.setRunning ( bool  running)

Set if playback is running.

◆ setSubTitle()

void Dragengine.ConversationSystem.ConversationPlayback.setSubTitle ( ConversationPlaybackSubTitle  subTitle)

Set sub title or null.

◆ setTopic()

void Dragengine.ConversationSystem.ConversationPlayback.setTopic ( ConversationTopicGroup  group,
ConversationTopic  topic 
)

Set topic to talk about.

◆ setTranslationManager()

void Dragengine.ConversationSystem.ConversationPlayback.setTranslationManager ( TranslationManager  translationManager)

Set translation manager or null.

Version
1.16

◆ setVariable()

void Dragengine.ConversationSystem.ConversationPlayback.setVariable ( String  name,
int  value 
)

Set variable.

◆ stopConversation()

void Dragengine.ConversationSystem.ConversationPlayback.stopConversation ( )

Stop conversation.

◆ update()

void Dragengine.ConversationSystem.ConversationPlayback.update ( float  elapsed)

Update playback.

◆ writeObjectConstructToFile()

void Dragengine.ConversationSystem.ConversationPlayback.writeObjectConstructToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write object data to file writer read during construction time.

Writes all data which are read during construction time not accessing subclass implemented methods. This affects besides others the use of loadConversationActor() and createConversationCoordSystem().

Subclass usually does not required to overwrite this method.

◆ writeObjectToFile()

void Dragengine.ConversationSystem.ConversationPlayback.writeObjectToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write object to file writer.

This method supports reading object using constructor and readDelayedFromFile(). Subclass has to overwrite writeObjectConstructToFile() and writeObjectDelayedToFile(). This method should not be changed.

Implements Dragengine.LoadSave.Persistable.


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