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

Play back conversation. More...

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

Public Member Functions

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.
 
bool conditionGameCommand (String command)
 Game condition command send by the conversation script.
 
void dispose ()
 Dispose of conversation playback.
 
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.
 
ConversationPlayback new (Conversation conversation)
 Create conversation playback.
 
ConversationPlayback new (PersistencyEnvironment env, FileReader reader)
 Read from file.
 
void notifyRunningChanged ()
 Notify listeners running state changed.
 
void onConversationStarted ()
 Conversation started hook method.
 
void onConversationStopped ()
 Conversation stopped hook method.
 
String persistencyFactoryName ()
 Name of PersistencyFactory required to load object from file.
 
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

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

ConversationPlaybackLane getActiveLane ()
 Active lane.
 
void setActiveLane (ConversationPlaybackLane lane)
 Set active lane.
 

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.

◆ addSideLane()

void Dragengine.ConversationSystem.ConversationPlayback.addSideLane ( ConversationPlaybackLane  lane)

Add side lane.

Version
1.28

Adding a side lane runs it once.

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

◆ findActor()

ConversationActor Dragengine.ConversationSystem.ConversationPlayback.findActor ( Block  ablock)

Find actor using block.

Version
1.28

Block requires signature (ConversationActor actor) or (int index, ConversationActor actor) and returns true if found.

◆ findCoordSystem()

ConversationCoordSystem Dragengine.ConversationSystem.ConversationPlayback.findCoordSystem ( Block  ablock)

Find conversation coordinate system using block.

Version
1.28

Block requires signature (ConversationCoordSystem actor) or (int index, ConversationCoordSystem actor) and returns true if found.

◆ forEachCoordSystem()

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

Visit coordinate systems with block with parameter ConversationCoordSystem.

◆ getActiveLane()

ConversationPlaybackLane Dragengine.ConversationSystem.ConversationPlayback.getActiveLane ( )
protected

Active lane.

Version
1.28
Warning
For internal use only.

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

◆ getLayerAt()

ConversationPlaybackLayer Dragengine.ConversationSystem.ConversationPlayback.getLayerAt ( int  index)

Layer at index where index is counted from the top.

Version
1.28

◆ getLayerCount()

int Dragengine.ConversationSystem.ConversationPlayback.getLayerCount ( )

Number of layers.

◆ getMainLane()

ConversationPlaybackLane Dragengine.ConversationSystem.ConversationPlayback.getMainLane ( )

Main lane.

Version
1.28

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

◆ getSideLaneAt()

ConversationPlaybackLane Dragengine.ConversationSystem.ConversationPlayback.getSideLaneAt ( int  lane)

Side lane at index.

Version
1.28

◆ getSideLaneCount()

int Dragengine.ConversationSystem.ConversationPlayback.getSideLaneCount ( )

Count of side lanes.

Version
1.28

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

func Persistable readObjectFromFile(PersistencyEnvironment env, FileReader reader)
var MyConversationPlayback playback = MyConversationPlayback.new(env, reader)
playback.readDelayedFromFile(env, reader)
return playback
end
File reader.
Definition FileReader.ds:17

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.

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.

◆ removeAllSideLanes()

void Dragengine.ConversationSystem.ConversationPlayback.removeAllSideLanes ( )

Remove all side lanes.

Version
1.28

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

◆ removeSideLane()

void Dragengine.ConversationSystem.ConversationPlayback.removeSideLane ( ConversationPlaybackLane  lane)

Remove side lane.

Version
1.28

◆ removeVariable()

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

Remove variable if set.

◆ setActiveLane()

void Dragengine.ConversationSystem.ConversationPlayback.setActiveLane ( ConversationPlaybackLane  lane)
protected

Set active lane.

Version
1.28
Warning
For internal use only.

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

◆ setSimpleSnippet()

void Dragengine.ConversationSystem.ConversationPlayback.setSimpleSnippet ( SimpleConversationConverter  converter,
SimpleConversation  simpleConversation,
SimpleConversationSnippet  snippet 
)

Set simple conversation snippet to talk about.

Version
1.25

Removes all layers adding layer with converted snippet.

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

Member Data Documentation

◆ pActiveLane

ConversationPlaybackLane Dragengine.ConversationSystem.ConversationPlayback.pActiveLane

◆ pActors

Array Dragengine.ConversationSystem.ConversationPlayback.pActors

◆ pCameraDirector

ConversationCameraDirector Dragengine.ConversationSystem.ConversationPlayback.pCameraDirector

◆ pConversation

Conversation Dragengine.ConversationSystem.ConversationPlayback.pConversation

◆ pListeners

Array Dragengine.ConversationSystem.ConversationPlayback.pListeners

◆ pPlayerChoice

ConversationPlaybackPlayerChoice Dragengine.ConversationSystem.ConversationPlayback.pPlayerChoice

◆ pRunning

bool Dragengine.ConversationSystem.ConversationPlayback.pRunning

◆ pSideLanes

SafeArray Dragengine.ConversationSystem.ConversationPlayback.pSideLanes

◆ pSubTitle

ConversationPlaybackSubTitle Dragengine.ConversationSystem.ConversationPlayback.pSubTitle

◆ pTopic

ConversationTopic Dragengine.ConversationSystem.ConversationPlayback.pTopic

◆ pTopicGroup

ConversationTopicGroup Dragengine.ConversationSystem.ConversationPlayback.pTopicGroup

◆ pTranslationManager

TranslationManager Dragengine.ConversationSystem.ConversationPlayback.pTranslationManager

◆ pVariables

Dictionary Dragengine.ConversationSystem.ConversationPlayback.pVariables

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