YaDialogAPI¶
YaDialogAPI
is a class for managing dialogues of speakers.Functions¶
YaDialogStateListener YaDialogAPI.StateListener(YaEntity entity)¶
DEPRECATED
Returnsthe listener
A listener to events about dialogue state changes for the specified entity
entity
The entity that you want to listen to
YaCharacterDialog YaDialogAPI.CharacterDialog(YaEntity character)¶
DEPRECATED
Returnsthe API handle
An API handle for managing a character's dialogues
character
The character
YaCharacterDialogBySpeaker YaDialogAPI.CharacterDialogBySpeaker(YaEntity character, YaEntity speaker)¶
DEPRECATED
Returnsthe API handle
An API handle for managing a character's dialogues associated with the speaker.
character
The characterspeaker
The speaker
YaDialogConfig YaDialogAPI.GetDialogConfig(number dialogID)¶
DEPRECATED
Returnsthe dialogue configuration
Gets the dialogue configuration using the dialogue ID.
dialogID
The unique identifier of the dialog configuration
void YaDialogAPI.OnEnterDialogState(function callback<YaEntity, YaDialogState>)¶
DEPRECATED
Fired when any conversation occurs.
callback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitystateInfo
Includes dialogue state and dialogue data
void YaDialogAPI.OnExitDialogState(function callback<YaEntity, YaDialogState>)¶
DEPRECATED
Fired when any conversation is interrupted.
callback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitystateInfo
Includes dialogue state and dialogue data
void YaDialogAPI.OnDialogStateEnds(function callback<YaEntity, YaDialogState>)¶
SERVER ONLY DEPRECATED
Fired when any conversation is finished.
callback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitystateInfo
Includes dialogue state and dialogue data
YaDialogConfig YaDialogAPI.GetDialogConfigByName(string name)¶
Returnsthe dialogue configuration
Gets the dialogue configuration by its name
name
The name of configuration
void YaDialogAPI.AddAvailableDialog(YaEntity characterEntity, YaDialogueData dialogData)¶
SERVER ONLY
Adds an available dialogue to the character's interactive list
characterEntity
The entity of the player's characterdialogData
YaDialogueData of the dialog
Array<YaDialogueData> YaDialogAPI.GetAvailableDialogs(YaEntity characterEntity, [YaEntity speakerEntity])¶
ReturnsArray of YaDialogueData or nil
Gets available dialogues on the character
characterEntity
The entity of the player's characterspeakerEntity
Get from which NPC speaker (optional)
void YaDialogAPI.ClearAvailableDialogs(YaEntity characterEntity, [YaEntity speakerEntity])¶
Deletes available dialogues on the character.
characterEntity
The entity of the player's characterspeakerEntity
The entity of the NPC speaker (optional)
CancelToken YaDialogAPI.OnAddAvailableDialog(YaEntity characterEntity, function callback<YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a new available dialogue is added to the player character
characterEntity
The player's character entity to listen tocallback
A callback with dialogue informationdialogueData
Data of the added dialogue
void YaDialogAPI.StartDialog(YaEntity characterEntity, YaDialogueData dialogData)¶
Starts a dialogue with a NPC speaker
characterEntity
The entity of the player's characterdialogData
Data of the dialog
void YaDialogAPI.BreakDialog(YaEntity characterEntity)¶
Breaks the dialogue of the character
characterEntity
The entity of the player's character
void YaDialogAPI.FinishDialog(YaEntity characterEntity)¶
Finishes the dialogue of the character
characterEntity
The entity of the player's character
CancelToken YaDialogAPI.OnStartDialog(YaEntity entity, function callback<YaEntity, YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a conversation occurs
entity
The NPC speaker or player character entity to listen tocallback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitydialogueData
Data of the dialogue
CancelToken YaDialogAPI.OnStartAnyDialog(function callback<YaEntity, YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when any conversation occurs
callback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitydialogueData
Data of the dialogue
CancelToken YaDialogAPI.OnBreakDialog(YaEntity entity, function callback<YaEntity, YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a conversation is interrupted
entity
The NPC speaker or player character entity to listen tocallback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitydialogueData
Data of the dialogue
CancelToken YaDialogAPI.OnBreakAnyDialog(function callback<YaEntity, YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when any conversation is interrupted
callback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitydialogueData
Data of the dialogue
CancelToken YaDialogAPI.OnFinishDialog(YaEntity entity, function callback<YaEntity, YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a conversation is finished
entity
The NPC speaker or player character entity to listen tocallback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitydialogueData
Data of the dialogue
CancelToken YaDialogAPI.OnFinishAnyDialog(function callback<YaEntity, YaDialogueData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when any conversation is finished
callback
A callback with characters in the conversation and dialogue informationcharacterEntity
The character entitydialogueData
Data of the dialogue