Skip to content

Class: CPhraseDialog ​

Phrase dialog built or extended from scripts.

Source ​

C++ class CPhraseDialog

Custom Constructor ​

CPhraseDialog

Remarks ​

A phrase dialog is a directed phrase graph. Phrase id "0" is the start phrase used by loaded XML dialogs.

Constructors ​

Constructor ​

ts
new CPhraseDialog(): CPhraseDialog;

Returns ​

CPhraseDialog

Methods ​

AddPhrase() ​

ts
AddPhrase(
   text: string, 
   phrase_id: string, 
   prev_phrase_id: string, 
   goodwill_level: number): CPhrase;

Add a phrase to the dialog tree.

Parameters ​

ParameterTypeDescription
textstringText or string table id.
phrase_idstringNew phrase id.
prev_phrase_idstringParent phrase id, or an empty string.
goodwill_levelnumberGoodwill value used when the engine orders available replies.

Returns ​

CPhrase

Created phrase.

Remarks ​

prev_phrase_id creates the edge from the previous phrase to the new one. Pass an empty string for a root phrase. Reusing an existing phrase_id returns the existing phrase and still links it from prev_phrase_id.