Drag[en]gine Script Module DragonScript Script API  1.0
ConversationPlayback Class Referenceabstract

Play back conversation. More...

Inheritance diagram for ConversationPlayback:
Persistable

Public Member Functions

void addActor (ConversationActor actor)
 Add actor with no alias if absent. More...
 
void addActor (ConversationActor actor, StringID alias)
 Add actor with alias if absent. More...
 
void addCoordSystem (ConversationCoordSystem coordSystem)
 Add coordinate system without 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 advanceToNextAction ()
 Advance to next action. More...
 
void cancelLoopingAction ()
 Cancel looping action. More...
 
bool conditionGameCommand (String command)
 Game condition command send by the conversation script. More...
 
void dispose ()
 Dispose of conversation playback. More...
 
void fastForwardSpeaking ()
 Fast forward until the actor stopped speaking. More...
 
void forEachActor (Block ablock)
 Visit actors with block with parameter ConversationActor. 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, int number)
 Actor with ID or number or null if absent. More...
 
Conversation getConversation ()
 Conversation. More...
 
ConversationCoordSystem getCoordSystemByID (StringID id)
 Coordinate system with ID or <em null if absent. More...
 
int getLayerCount ()
 Number of layers. More...
 
bool getPaused ()
 Playback is paused. More...
 
ConversationPlaybackPlayerChoice getPlayerChoice ()
 Player choice interface or null. More...
 
bool getRunning ()
 Playback is running. More...
 
SubTitleBox getSubTitleBox ()
 Sub title box or null. More...
 
ConversationTopic getTopic ()
 Topic being talking about. More...
 
ConversationTopicGroup getTopicGroup ()
 Topic group being talking about. More...
 
ConversationPlaybackLayer getTopLayer ()
 Top layer. More...
 
int getVariable (String name, int defaultValue)
 Variable value or default value if not set. More...
 
bool hasNextAction ()
 Next action or null if top layer is finished. More...
 
bool hasVariable (String name)
 Variable is set. More...
 
void hideDoneActorSubTitles ()
 Hide sub title of all actors done speaking. More...
 
ConversationActor loadConversationActor (StringID id)
 Obtain actor for a conversation identifier. 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...
 
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 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 setSubTitleBox (SubTitleBox box)
 Set sub title box or null. More...
 
void setTopic (ConversationTopicGroup group, ConversationTopic topic)
 Set topic to talk about. 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 writeObjectDelayedToFile (PersistencyEnvironment env, FileWriter writer)
 Write object data to file writer read during readDelayedFromFile. More...
 
void writeObjectToFile (PersistencyEnvironment env, FileWriter writer)
 Write object to file writer. More...
 

Detailed Description

Play back conversation.

Member Function Documentation

◆ addActor() [1/2]

void addActor ( ConversationActor  actor)

Add actor with no alias if absent.

◆ addActor() [2/2]

void addActor ( ConversationActor  actor,
StringID  alias 
)

Add actor with alias if absent.

◆ addCoordSystem() [1/2]

void addCoordSystem ( ConversationCoordSystem  coordSystem)

Add coordinate system without alias if absent.

◆ addCoordSystem() [2/2]

void addCoordSystem ( ConversationCoordSystem  coordSystem,
StringID  alias 
)

Add coordinate system with alias if absent.

◆ addListener()

void addListener ( ConversationPlaybackListener  listener)

Add listener.

◆ advanceToNextAction()

void advanceToNextAction ( )

Advance to next action.

◆ cancelLoopingAction()

void cancelLoopingAction ( )

Cancel looping action.

◆ conditionGameCommand()

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

◆ dispose()

void dispose ( )

Dispose of conversation playback.

◆ fastForwardSpeaking()

void fastForwardSpeaking ( )

Fast forward until the actor stopped speaking.

◆ forEachActor()

void forEachActor ( Block  ablock)

Visit actors with block with parameter ConversationActor.

◆ forEachCoordSystem()

void forEachCoordSystem ( Block  ablock)

Visit coordinate systems with block with parameter ConversationCoordSystem.

◆ getActorAt()

ConversationActor getActorAt ( int  index)

Actor by index.

◆ getActorCount()

int getActorCount ( )

Number of actors.

◆ getActorMatching()

ConversationActor getActorMatching ( StringID  id,
int  number 
)

Actor with ID or number or null if absent.

◆ getConversation()

Conversation getConversation ( )

◆ getCoordSystemByID()

ConversationCoordSystem getCoordSystemByID ( StringID  id)

Coordinate system with ID or <em null if absent.

◆ getLayerCount()

int getLayerCount ( )

Number of layers.

◆ getPaused()

bool getPaused ( )

Playback is paused.

◆ getPlayerChoice()

ConversationPlaybackPlayerChoice getPlayerChoice ( )

Player choice interface or null.

◆ getRunning()

bool getRunning ( )

Playback is running.

◆ getSubTitleBox()

SubTitleBox getSubTitleBox ( )

Sub title box or null.

◆ getTopic()

ConversationTopic getTopic ( )

Topic being talking about.

◆ getTopicGroup()

ConversationTopicGroup getTopicGroup ( )

Topic group being talking about.

◆ getTopLayer()

ConversationPlaybackLayer getTopLayer ( )

Top layer.

◆ getVariable()

int getVariable ( String  name,
int  defaultValue 
)

Variable value or default value if not set.

◆ hasNextAction()

bool hasNextAction ( )

Next action or null if top layer is finished.

◆ hasVariable()

bool hasVariable ( String  name)

Variable is set.

◆ hideDoneActorSubTitles()

void hideDoneActorSubTitles ( )

Hide sub title of all actors done speaking.

◆ loadConversationActor()

ConversationActor loadConversationActor ( StringID  id)

Obtain actor for a conversation identifier.

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

◆ new() [1/2]

ConversationPlayback new ( Conversation  conversation)

Create conversation playback.

◆ new() [2/2]

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
  • SubTitleBox
  • pPlayerChoice

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

◆ notifyRunningChanged()

void notifyRunningChanged ( )

Notify listeners running state changed.

◆ persistencyFactoryName()

String 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 Persistable.

◆ popLayer()

void popLayer ( )

Pop top layer off stack.

◆ processActions()

void processActions ( float  elapsed,
bool  skipDelay 
)

Process actions.

◆ pushLayer()

void pushLayer ( ConversationPlaybackLayer  layer)

Push layer to top of stack.

◆ readDelayedFromFile()

void 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 removeActor ( ConversationActor  actor)

Remove actor if present.

◆ removeAllActors()

void removeAllActors ( )

Remove all actors.

◆ removeAllCoordSystems()

void removeAllCoordSystems ( )

Remove all coordinate systems.

◆ removeAllLayers()

void removeAllLayers ( )

Remove all layers.

◆ removeAllVariables()

void removeAllVariables ( )

Remove all variables.

◆ removeCoordSystem()

void removeCoordSystem ( ConversationCoordSystem  coordSystem)

Remove coordinate system if present.

◆ removeListener()

void removeListener ( ConversationPlaybackListener  listener)

Remove listener if present.

◆ removeVariable()

void removeVariable ( String  name)

Remove variable if set.

◆ setCameraDirector()

void setCameraDirector ( ConversationCameraDirector  director)

Set camera director or null.

◆ setPaused()

void setPaused ( bool  paused)

Set if playback is paused.

◆ setPlayerChoice()

void setPlayerChoice ( ConversationPlaybackPlayerChoice  playerChoice)

Set player choice interface or null.

◆ setRunning()

void setRunning ( bool  running)

Set if playback is running.

◆ setSubTitleBox()

void setSubTitleBox ( SubTitleBox  box)

Set sub title box or null.

◆ setTopic()

void setTopic ( ConversationTopicGroup  group,
ConversationTopic  topic 
)

Set topic to talk about.

◆ setVariable()

void setVariable ( String  name,
int  value 
)

Set variable.

◆ stopConversation()

void stopConversation ( )

Stop conversation.

◆ update()

void update ( float  elapsed)

Update playback.

◆ writeObjectConstructToFile()

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

◆ writeObjectDelayedToFile()

void writeObjectDelayedToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write object data to file writer read during readDelayedFromFile.

Writes all data which are read from inside readDelayedFromFile() 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 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 Persistable.


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