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 entityentityThe entity that you want to listen to
YaCharacterDialog YaDialogAPI.CharacterDialog(YaEntity character)
DEPRECATED
Returnsthe API handle
An API handle for managing a character's dialoguescharacterThe 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 callbackYaEntity, 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 callbackYaEntity, 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 callbackYaEntity, 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 namenameThe 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 charactercharacterEntityThe 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 callbackYaDialogueData)
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 charactercharacterEntityThe 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 callbackYaEntity, YaDialogueData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a conversation occursentityThe 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 callbackYaEntity, YaDialogueData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when any conversation occurscallbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData of the dialogue
CancelToken YaDialogAPI.OnBreakDialog(YaEntity entity, function callbackYaEntity, YaDialogueData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a conversation is interruptedentityThe 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 callbackYaEntity, YaDialogueData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when any conversation is interruptedcallbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData of the dialogue
CancelToken YaDialogAPI.OnFinishDialog(YaEntity entity, function callbackYaEntity, YaDialogueData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a conversation is finishedentityThe 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 callbackYaEntity, YaDialogueData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when any conversation is finishedcallbackA callback with characters in the conversation and dialogue informationcharacterEntityThe character entitydialogueDataData of the dialogue