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
entityThe 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
characterThe 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.
characterThe characterspeakerThe speaker
YaDialogConfig YaDialogAPI.GetDialogConfig(number dialogID)¶
DEPRECATED
Returnsthe dialogue configuration
Gets the dialogue configuration using the dialogue ID.
dialogIDThe unique identifier of the dialog configuration
void YaDialogAPI.OnEnterDialogState(function callback<YaEntity, YaDialogState>)¶
DEPRECATED
Fired when any conversation occurs.
callbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitystateInfoIncludes dialogue state and dialogue data
void YaDialogAPI.OnExitDialogState(function callback<YaEntity, YaDialogState>)¶
DEPRECATED
Fired when any conversation is interrupted.
callbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitystateInfoIncludes dialogue state and dialogue data
void YaDialogAPI.OnDialogStateEnds(function callback<YaEntity, YaDialogState>)¶
SERVER ONLY DEPRECATED
Fired when any conversation is finished.
callbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitystateInfoIncludes dialogue state and dialogue data
YaDialogConfig YaDialogAPI.GetDialogConfigByName(string name)¶
Returnsthe dialogue configuration
Gets the dialogue configuration by its name
nameThe name of configuration
void YaDialogAPI.AddAvailableDialog(YaEntity characterEntity, YaDialogueData dialogData)¶
SERVER ONLY
Adds an available dialogue to the character's interactive list
characterEntityThe entity of the player's characterdialogDataYaDialogueData of the dialog
Array<YaDialogueData> YaDialogAPI.GetAvailableDialogs(YaEntity characterEntity, [YaEntity speakerEntity])¶
ReturnsArray of YaDialogueData or nil
Gets available dialogues on the character
characterEntityThe entity of the player's characterspeakerEntityGet from which NPC speaker (optional)
void YaDialogAPI.ClearAvailableDialogs(YaEntity characterEntity, [YaEntity speakerEntity])¶
Deletes available dialogues on the character.
characterEntityThe entity of the player's characterspeakerEntityThe 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
characterEntityThe player's character entity to listen tocallbackA callback with dialogue informationdialogueDataData of the added dialogue
void YaDialogAPI.StartDialog(YaEntity characterEntity, YaDialogueData dialogData)¶
Starts a dialogue with a NPC speaker
characterEntityThe entity of the player's characterdialogDataData of the dialog
void YaDialogAPI.BreakDialog(YaEntity characterEntity)¶
Breaks the dialogue of the character
characterEntityThe entity of the player's character
void YaDialogAPI.FinishDialog(YaEntity characterEntity)¶
Finishes the dialogue of the character
characterEntityThe 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
entityThe NPC speaker or player character entity to listen tocallbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData 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
callbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData 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
entityThe NPC speaker or player character entity to listen tocallbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData 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
callbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData 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
entityThe NPC speaker or player character entity to listen tocallbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData 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
callbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData of the dialogue