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

Convert simple conversation snippet into conversation actions. More...

Inheritance diagram for Dragengine.ConversationSystem.SimpleConversationConverter:

Classes

class  Gesture
 Gesture to be added to speech. More...
 
class  State
 Conversation state. More...
 

Public Member Functions

void convert (SimpleConversationSnippet snippet, SimpleConversation simpleConversation, ConversationPlayback playback)
 Convert snippet adding conversation actions similar to CActionSnippet.
 
void convert (SimpleConversationSnippet snippet, SimpleConversation simpleConversation, ConversationPlayback playback, Array actions)
 Convert snippet adding conversation actions similar to CActionSnippet.
 
void convert (SimpleConversationSnippet snippet, SimpleConversation simpleConversation, ConversationPlayback playback, bool advance)
 Convert snippet adding conversation actions similar to CActionSnippet.
 
UnicodeString getCharsPhraseBreak ()
 Matching string with characters separating phrases.
 
UnicodeString getCharsSubPhraseBreak ()
 Matching string with characters separating sub phrases.
 
UnicodeString getCharsWordBreak ()
 Matching string with characters separating words.
 
float getElongateSpeak ()
 Elongate speaking duration.
 
float getEstimateWordLength ()
 Average character length.
 
float getFacePoseDuration ()
 Face pose duration.
 
float getLookAtDuration ()
 Look-at duration.
 
float getMinGestureDuration ()
 Minimum available duration for gesture to start playing.
 
int getMinSpeakCountCameraChange ()
 Minimum count of actor speaks before switch camera.
 
float getPausePhrase ()
 Pause in seconds to insert after a phrase break.
 
float getPauseSubPhrase ()
 Pause in seconds to insert after a sub phrase break.
 
bool getScaleLastGesture ()
 Scale last gesture to fit speech length.
 
float getSpeakSpeed ()
 Speaking speed.
 
SimpleConversationConverter new ()
 Create simple conversation convertor.
 
void setCharsPhraseBreak (UnicodeString chars)
 Set matching string with characters separating phrases.
 
void setCharsSubPhraseBreak (UnicodeString chars)
 Set matching string with characters separating sub phrases.
 
void setCharsWordBreak (UnicodeString chars)
 Set matching string with characters separating words.
 
void setElongateSpeak (float duration)
 Set elongate speaking duration.
 
void setEstimateWordLength (float length)
 Set average character length.
 
void setFacePoseDuration (float duration)
 Set face pose duration.
 
void setLookAtDuration (float duration)
 Set look-at duration.
 
void setMinGestureDuration (float duration)
 Set minimum available duration for gesture to start playing.
 
void setMinSpeakCountCameraChange (int count)
 Set minimum count of actor speaks before switch camera.
 
void setPausePhrase (float seconds)
 Set pause in seconds to insert after a phrase break.
 
void setPauseSubPhrase (float seconds)
 Set pause in seconds to insert after a sub phrase break.
 
void setScaleLastGesture (bool scale)
 Set scale last gesture to fit speech length.
 
void setSpeakSpeed (float speed)
 Set speaking speed.
 

Public Attributes

float pAverageCharacterLength
 
UnicodeString pCharsWordBreak
 
float pFacePoseDuration
 
float pMinGestureDuration
 
int pMinSpeakCountCameraChange
 
float pPausePhrase
 
bool pScaleLastGesture
 
float pSpeakSpeed
 

Protected Member Functions

void applyCameraWaitMode (State state, ConversationAction action, Enumeration mode)
 Apply camera wait mode to conversation action.
 
void applySpeechPause (State state)
 Apply speech pause if present.
 
float cameraDelay (State state, SimpleConversationCamera camera, Enumeration mode)
 Delay to use for camera change.
 
void closeActions (State state)
 Close open conversation actions if present.
 
void closeSpeak (State state)
 Close open actor speak conversation action if present.
 
void convert (State state)
 Convert snippet using state.
 
void convertActor (State state, SimpleConversationAction action)
 Convert actor action.
 
void convertAddActor (State state, SimpleConversationAction action)
 Convert add actor action.
 
void convertAddCoordSystem (State state, SimpleConversationAction action)
 Convert add coordinate system action.
 
void convertCamera (State state, SimpleConversationCamera camera, SimpleConversationCameraShot shot, Enumeration mode)
 Add camera conversation actor.
 
void convertCameraActorCommand (State state, SimpleConversationCamera camera, SimpleConversationCameraShot shot, Enumeration mode)
 Add camera conversation actor using actor command.
 
void convertCameraGameCommand (State state, SimpleConversationCamera camera, SimpleConversationCameraShot shot, Enumeration mode)
 Add camera conversation actor using game command.
 
void convertCameraShot (State state, SimpleConversationCamera camera, SimpleConversationCameraShot shot, Enumeration mode)
 Add camera conversation actor using camera shot.
 
void convertCameraSnippet (State state, SimpleConversationCamera camera, SimpleConversationCameraShot shot, Enumeration mode)
 Add camera conversation actor using snippet.
 
void convertCommand (State state, SimpleConversationAction action)
 Convert command action.
 
ConversationCondition convertCondition (State state, SimpleConversationCondition condition)
 Convert condition.
 
void convertFacePose (State state, ConversationFacePose facePose, float duration)
 Add conversation face pose.
 
void convertFacePose (State state, SimpleConversationAction action)
 Convert face pose action.
 
void convertGesture (State state, ConversationGesture gesture)
 Add conversation gesture.
 
void convertGesture (State state, SimpleConversationAction action)
 Convert gesture action.
 
void convertIfElif (State state, SimpleConversationAction action)
 Convert if/elif action.
 
void convertLookAt (State state, ConversationTarget lookAt, float duration)
 Add conversation look-at.
 
void convertLookAt (State state, SimpleConversationAction action)
 Convert look-at action.
 
void convertMusic (State state, SimpleConversationAction action)
 Convert music action.
 
void convertPlayerChoice (State state, SimpleConversationAction action)
 Convert player choice action.
 
void convertPlayerChoiceOption (State state, SimpleConversationAction action)
 Convert player choice option action.
 
void convertRemoveActor (State state, SimpleConversationAction action)
 Convert remove actor action.
 
void convertRemoveCoordSystem (State state, SimpleConversationAction action)
 Convert remove coordinate system action.
 
void convertSnippet (State state, SimpleConversationAction action)
 Convert snippet action.
 
void convertSpeak (State state, SimpleConversationAction action)
 Convert speak action.
 
void convertStopConversation (State state, SimpleConversationAction action)
 Convert stop conversation action.
 
void convertStopTopic (State state, SimpleConversationAction action)
 Convert stop topic action.
 
void convertTrigger (State state, SimpleConversationAction action)
 Convert modify trigger action.
 
void convertVariable (State state, SimpleConversationAction action)
 Convert set variable action.
 
void convertWait (State state, SimpleConversationAction action)
 Convert wait action.
 
SimpleConversationSnippet getSnippetRequired (State state, StringID id)
 Get snippet throw exception if absent.
 

Detailed Description

Convert simple conversation snippet into conversation actions.

Version
1.25

Member Function Documentation

◆ applyCameraWaitMode()

void Dragengine.ConversationSystem.SimpleConversationConverter.applyCameraWaitMode ( State  state,
ConversationAction  action,
Enumeration  mode 
)
protected

Apply camera wait mode to conversation action.

◆ applySpeechPause()

void Dragengine.ConversationSystem.SimpleConversationConverter.applySpeechPause ( State  state)
protected

Apply speech pause if present.

◆ cameraDelay()

float Dragengine.ConversationSystem.SimpleConversationConverter.cameraDelay ( State  state,
SimpleConversationCamera  camera,
Enumeration  mode 
)
protected

Delay to use for camera change.

◆ closeActions()

void Dragengine.ConversationSystem.SimpleConversationConverter.closeActions ( State  state)
protected

Close open conversation actions if present.

◆ closeSpeak()

void Dragengine.ConversationSystem.SimpleConversationConverter.closeSpeak ( State  state)
protected

Close open actor speak conversation action if present.

If closing updates last gesture duration if it is a held gesture. Stored actor information linked to speak conversation action are not cleared to reuse them.

◆ convert() [1/4]

void Dragengine.ConversationSystem.SimpleConversationConverter.convert ( SimpleConversationSnippet  snippet,
SimpleConversation  simpleConversation,
ConversationPlayback  playback 
)

Convert snippet adding conversation actions similar to CActionSnippet.

Adds ConversationPlaybackLayer to conversation with converted actions.

◆ convert() [2/4]

void Dragengine.ConversationSystem.SimpleConversationConverter.convert ( SimpleConversationSnippet  snippet,
SimpleConversation  simpleConversation,
ConversationPlayback  playback,
Array  actions 
)

Convert snippet adding conversation actions similar to CActionSnippet.

Adds converted actions to actions array.

◆ convert() [3/4]

void Dragengine.ConversationSystem.SimpleConversationConverter.convert ( SimpleConversationSnippet  snippet,
SimpleConversation  simpleConversation,
ConversationPlayback  playback,
bool  advance 
)

Convert snippet adding conversation actions similar to CActionSnippet.

Adds ConversationPlaybackLayer to conversation with converted actions. The value of advance is used in the ConversationPlaybackLayer constructor to advance the actions iterator. Use true for advance unless you can not avoid calling ConversationPlayback::advanceToNextAction() later on.

◆ convert() [4/4]

void Dragengine.ConversationSystem.SimpleConversationConverter.convert ( State  state)
protected

Convert snippet using state.

◆ convertActor()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertActor ( State  state,
SimpleConversationAction  action 
)
protected

Convert actor action.

Closes open actions if present. If actor is set adds action for switching camera. Then adds instance of CActionActorSpeak. If actor is not set uses the previous CActionActorSpeak actor. The added CActionActorSpeak and the matching conversation actor are not present in the state as open speak action. Throws exception if actor is not set and no previous CActionActorSpeak is present.

◆ convertAddActor()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertAddActor ( State  state,
SimpleConversationAction  action 
)
protected

Convert add actor action.

Closes open actions if present then adds instance of CActionActorAdd.

◆ convertAddCoordSystem()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertAddCoordSystem ( State  state,
SimpleConversationAction  action 
)
protected

Convert add coordinate system action.

Closes open actions if present then adds instance of CActionCoordSystemAdd.

◆ convertCamera()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertCamera ( State  state,
SimpleConversationCamera  camera,
SimpleConversationCameraShot  shot,
Enumeration  mode 
)
protected

Add camera conversation actor.

◆ convertCameraActorCommand()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertCameraActorCommand ( State  state,
SimpleConversationCamera  camera,
SimpleConversationCameraShot  shot,
Enumeration  mode 
)
protected

Add camera conversation actor using actor command.

◆ convertCameraGameCommand()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertCameraGameCommand ( State  state,
SimpleConversationCamera  camera,
SimpleConversationCameraShot  shot,
Enumeration  mode 
)
protected

Add camera conversation actor using game command.

◆ convertCameraShot()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertCameraShot ( State  state,
SimpleConversationCamera  camera,
SimpleConversationCameraShot  shot,
Enumeration  mode 
)
protected

Add camera conversation actor using camera shot.

◆ convertCameraSnippet()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertCameraSnippet ( State  state,
SimpleConversationCamera  camera,
SimpleConversationCameraShot  shot,
Enumeration  mode 
)
protected

Add camera conversation actor using snippet.

◆ convertCommand()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertCommand ( State  state,
SimpleConversationAction  action 
)
protected

Convert command action.

Closes open actions if present. Then adds instance of CActionGameCommand or CActionActorCommand with 0 delay waiting for speaking actors to finish.

◆ convertCondition()

ConversationCondition Dragengine.ConversationSystem.SimpleConversationConverter.convertCondition ( State  state,
SimpleConversationCondition  condition 
)
protected

Convert condition.

◆ convertFacePose() [1/2]

void Dragengine.ConversationSystem.SimpleConversationConverter.convertFacePose ( State  state,
ConversationFacePose  facePose,
float  duration 
)
protected

Add conversation face pose.

◆ convertFacePose() [2/2]

void Dragengine.ConversationSystem.SimpleConversationConverter.convertFacePose ( State  state,
SimpleConversationAction  action 
)
protected

Convert face pose action.

◆ convertGesture() [1/2]

void Dragengine.ConversationSystem.SimpleConversationConverter.convertGesture ( State  state,
ConversationGesture  gesture 
)
protected

Add conversation gesture.

◆ convertGesture() [2/2]

void Dragengine.ConversationSystem.SimpleConversationConverter.convertGesture ( State  state,
SimpleConversationAction  action 
)
protected

Convert gesture action.

◆ convertIfElif()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertIfElif ( State  state,
SimpleConversationAction  action 
)
protected

Convert if/elif action.

If action is if-type closes open actions if present then adds instance of CActionIfElse with using 0 delay waiting for speaking actors to finish. Then adds converted conditions to the open if-else action. Then adds to this case actions of the referenced snippet.

◆ convertLookAt() [1/2]

void Dragengine.ConversationSystem.SimpleConversationConverter.convertLookAt ( State  state,
ConversationTarget  lookAt,
float  duration 
)
protected

Add conversation look-at.

◆ convertLookAt() [2/2]

void Dragengine.ConversationSystem.SimpleConversationConverter.convertLookAt ( State  state,
SimpleConversationAction  action 
)
protected

Convert look-at action.

◆ convertMusic()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertMusic ( State  state,
SimpleConversationAction  action 
)
protected

Convert music action.

Closes open actions if present then adds instance of CActionMusic.

◆ convertPlayerChoice()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertPlayerChoice ( State  state,
SimpleConversationAction  action 
)
protected

Convert player choice action.

Closes open actions if present then adds instance of CActionPlayerChoice with using 0 delay waiting for speaking actors to finish.

◆ convertPlayerChoiceOption()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertPlayerChoiceOption ( State  state,
SimpleConversationAction  action 
)
protected

Convert player choice option action.

Adds instance of CActionPlayerChoiceOption to the open player-choice action. Then adds to this option actions of the referenced snippet.

◆ convertRemoveActor()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertRemoveActor ( State  state,
SimpleConversationAction  action 
)
protected

Convert remove actor action.

Closes open actions if present then adds instance of CActionActorRemove.

◆ convertRemoveCoordSystem()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertRemoveCoordSystem ( State  state,
SimpleConversationAction  action 
)
protected

Convert remove coordinate system action.

Closes open actions if present then adds instance of CActionCoordSystemRemove.

◆ convertSnippet()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertSnippet ( State  state,
SimpleConversationAction  action 
)
protected

Convert snippet action.

Closes open actions if present. If getSubTarget() is null adds referenced snippet actions. If getSubTarget() is not null adds CActionSnippet.

◆ convertSpeak()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertSpeak ( State  state,
SimpleConversationAction  action 
)
protected

Convert speak action.

◆ convertStopConversation()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertStopConversation ( State  state,
SimpleConversationAction  action 
)
protected

Convert stop conversation action.

Closes open actions if present. Then adds instance of CActionStopConversation with 0 delay waiting for speaking actors to finish.

◆ convertStopTopic()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertStopTopic ( State  state,
SimpleConversationAction  action 
)
protected

Convert stop topic action.

Closes open actions if present. Then adds instance of CActionStopTopic with 0 delay waiting for speaking actors to finish.

◆ convertTrigger()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertTrigger ( State  state,
SimpleConversationAction  action 
)
protected

Convert modify trigger action.

Closes open actions if present. Then adds instance of CActionTrigger using 0 delay waiting for speaking actors to finish.

◆ convertVariable()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertVariable ( State  state,
SimpleConversationAction  action 
)
protected

Convert set variable action.

Closes open actions if present. Then adds instance of CActionSetVariable or CActionSetActorParameter depending if SimpleConversationAction::getTarge() is null or not. Action is set to use 0 delay waiting for speaking actors to finish.

◆ convertWait()

void Dragengine.ConversationSystem.SimpleConversationConverter.convertWait ( State  state,
SimpleConversationAction  action 
)
protected

Convert wait action.

Closes open actions if present then adds instance of CActionWait with using 0 delay waiting for speaking actors to finish. Then adds to the wait action the actions of the referenced snippet.

◆ getCharsPhraseBreak()

UnicodeString Dragengine.ConversationSystem.SimpleConversationConverter.getCharsPhraseBreak ( )

Matching string with characters separating phrases.

Default value ".;:?!". Produces a long pause while speaking.

◆ getCharsSubPhraseBreak()

UnicodeString Dragengine.ConversationSystem.SimpleConversationConverter.getCharsSubPhraseBreak ( )

Matching string with characters separating sub phrases.

Default value ",". Produces a short pause while speaking.

◆ getCharsWordBreak()

UnicodeString Dragengine.ConversationSystem.SimpleConversationConverter.getCharsWordBreak ( )

Matching string with characters separating words.

Default value " \t\n\r,.;:\"?!()".

◆ getElongateSpeak()

float Dragengine.ConversationSystem.SimpleConversationConverter.getElongateSpeak ( )

Elongate speaking duration.

Slows down speaking by elongating the speak duration by a fixed amount of seconds. This gives users some time to locate the beginning of the text to read. Combined with getSpeakSpeed() this allows to fine tune the speak duration for users with different reading speeds. Default value is 0.15.

◆ getEstimateWordLength()

float Dragengine.ConversationSystem.SimpleConversationConverter.getEstimateWordLength ( )

Average character length.

Used to estimate the length of a word without speech animation defining the length. Default value is 0.095.

◆ getFacePoseDuration()

float Dragengine.ConversationSystem.SimpleConversationConverter.getFacePoseDuration ( )

Face pose duration.

Duration in seconds to use for added face poses unless explicitely set. Defines how fast the actor blends from the old face pose to the new face pose. Default value is 0.25.

◆ getLookAtDuration()

float Dragengine.ConversationSystem.SimpleConversationConverter.getLookAtDuration ( )

Look-at duration.

Duration in seconds to use for added look-ats unless explicitely set. Defines how fast the actor switches looking direction from old look-at to new look-at. Default value is 0.5.

◆ getMinGestureDuration()

float Dragengine.ConversationSystem.SimpleConversationConverter.getMinGestureDuration ( )

Minimum available duration for gesture to start playing.

Default value is 0.5.

◆ getMinSpeakCountCameraChange()

int Dragengine.ConversationSystem.SimpleConversationConverter.getMinSpeakCountCameraChange ( )

Minimum count of actor speaks before switch camera.

If enabled triggers the camera switch defined in the speaking actor after a set amount of speaks have been done. This breaks long sequences of speaks with with random camera changes. To disable set count to a high value like 100.

Default value is 100.

◆ getPausePhrase()

float Dragengine.ConversationSystem.SimpleConversationConverter.getPausePhrase ( )

Pause in seconds to insert after a phrase break.

Default value 0.5 .

◆ getPauseSubPhrase()

float Dragengine.ConversationSystem.SimpleConversationConverter.getPauseSubPhrase ( )

Pause in seconds to insert after a sub phrase break.

Default value 0.35 .

◆ getScaleLastGesture()

bool Dragengine.ConversationSystem.SimpleConversationConverter.getScaleLastGesture ( )

Scale last gesture to fit speech length.

Default value is true.

◆ getSnippetRequired()

SimpleConversationSnippet Dragengine.ConversationSystem.SimpleConversationConverter.getSnippetRequired ( State  state,
StringID  id 
)
protected

Get snippet throw exception if absent.

◆ getSpeakSpeed()

float Dragengine.ConversationSystem.SimpleConversationConverter.getSpeakSpeed ( )

Speaking speed.

Larger values slow down speaking which makes it easier for users to read the text. A value of 1 equals fast reading. A value of 1.1 is moderate speed. A value of 1.2 is slow speed. Default value is 1.1.

◆ new()

SimpleConversationConverter Dragengine.ConversationSystem.SimpleConversationConverter.new ( )

Create simple conversation convertor.

◆ setCharsPhraseBreak()

void Dragengine.ConversationSystem.SimpleConversationConverter.setCharsPhraseBreak ( UnicodeString  chars)

Set matching string with characters separating phrases.

◆ setCharsSubPhraseBreak()

void Dragengine.ConversationSystem.SimpleConversationConverter.setCharsSubPhraseBreak ( UnicodeString  chars)

Set matching string with characters separating sub phrases.

◆ setCharsWordBreak()

void Dragengine.ConversationSystem.SimpleConversationConverter.setCharsWordBreak ( UnicodeString  chars)

Set matching string with characters separating words.

◆ setElongateSpeak()

void Dragengine.ConversationSystem.SimpleConversationConverter.setElongateSpeak ( float  duration)

Set elongate speaking duration.

◆ setEstimateWordLength()

void Dragengine.ConversationSystem.SimpleConversationConverter.setEstimateWordLength ( float  length)

Set average character length.

◆ setFacePoseDuration()

void Dragengine.ConversationSystem.SimpleConversationConverter.setFacePoseDuration ( float  duration)

Set face pose duration.

◆ setLookAtDuration()

void Dragengine.ConversationSystem.SimpleConversationConverter.setLookAtDuration ( float  duration)

Set look-at duration.

◆ setMinGestureDuration()

void Dragengine.ConversationSystem.SimpleConversationConverter.setMinGestureDuration ( float  duration)

Set minimum available duration for gesture to start playing.

◆ setMinSpeakCountCameraChange()

void Dragengine.ConversationSystem.SimpleConversationConverter.setMinSpeakCountCameraChange ( int  count)

Set minimum count of actor speaks before switch camera.

◆ setPausePhrase()

void Dragengine.ConversationSystem.SimpleConversationConverter.setPausePhrase ( float  seconds)

Set pause in seconds to insert after a phrase break.

◆ setPauseSubPhrase()

void Dragengine.ConversationSystem.SimpleConversationConverter.setPauseSubPhrase ( float  seconds)

Set pause in seconds to insert after a sub phrase break.

◆ setScaleLastGesture()

void Dragengine.ConversationSystem.SimpleConversationConverter.setScaleLastGesture ( bool  scale)

Set scale last gesture to fit speech length.

◆ setSpeakSpeed()

void Dragengine.ConversationSystem.SimpleConversationConverter.setSpeakSpeed ( float  speed)

Set speaking speed.

Member Data Documentation

◆ pAverageCharacterLength

float Dragengine.ConversationSystem.SimpleConversationConverter.pAverageCharacterLength

◆ pCharsWordBreak

UnicodeString Dragengine.ConversationSystem.SimpleConversationConverter.pCharsWordBreak

◆ pFacePoseDuration

float Dragengine.ConversationSystem.SimpleConversationConverter.pFacePoseDuration

◆ pMinGestureDuration

float Dragengine.ConversationSystem.SimpleConversationConverter.pMinGestureDuration

◆ pMinSpeakCountCameraChange

int Dragengine.ConversationSystem.SimpleConversationConverter.pMinSpeakCountCameraChange

◆ pPausePhrase

float Dragengine.ConversationSystem.SimpleConversationConverter.pPausePhrase

◆ pScaleLastGesture

bool Dragengine.ConversationSystem.SimpleConversationConverter.pScaleLastGesture

◆ pSpeakSpeed

float Dragengine.ConversationSystem.SimpleConversationConverter.pSpeakSpeed

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