Skip to content

YaCharacterDialogBySpeaker

YaCharacterDialogBySpeaker is an object representing dialogues on the specified speaker. You can only apply this API to a speaker. A speaker is a non-player character (NPC) with a Dialogue component.

Functions

boolean IsValid()
Returns true if the struct is valid.
number AddDialogWithQuestID(number dialogID, number questID, [number customTriggerID])
Adds a dialogue with a quest to a speaker.
  • dialogID The unique identifier of the dialogue
  • questID The unique identifier of the quest
  • customTriggerID Used to group UI dialogues
number AddDialog(number dialogID, [number customTriggerID])
Adds a dialogue to a speaker.
  • dialogID The unique identifier of the dialogue
  • customTriggerID Used to group UI dialogues
boolean ContainsDialog(number dialogSN)
Returns true if the speaker contains an interactable dialogue.
  • dialogSN The serial number of the dialogue
boolean RemoveDialog(number dialogSN)
Removes an interactable dialogue for the speaker.
  • dialogSN The serial number of the dialogue
number GetDialogsCount()
Gets the number of interactable dialogues on the speaker.
YaDialogData[] GetDialogs()
Gets the dialogue list of interactable dialogues on the speaker.
boolean TryAddCompletedDialog(number dialogID, number dialogSN)
Records the finished dialogue for the speaker.
  • dialogID The unique identifier of the dialogue
  • dialogSN The serial number of the dialogue
boolean ContainsCompletedDialog(number dialogSN)
Returns true if the dialogue is finished for the speaker.
  • dialogSN The serial number of the dialogue
boolean ContainsCompletedDialogByAny(number dialogID)
Returns true if any speaker has completed the dialogue.
  • dialogID The unique identifier of the dialogue
boolean RemoveCompletedDialog(number dialogSN)
Removes the completed dialogues recorded on the speaker.
  • dialogSN The serial number of the dialogue
void EnterDialogState(number dialogID, number dialogSN, [number customTriggerID])
Enters a dialogue with the speaker.
  • dialogID The unique identifier of the dialogue
  • dialogSN The serial number of the dialogue
  • customTriggerID Used to group UI dialogues
void EnterDialogState(YaDialogData dialogData)
Enters a dialogue with a speaker.
  • dialogData The data of the dialogue
void SelectOption(number dialogSN, number sentenceID, number optionID)
Selects an option in the current dialogue.
  • dialogSN The serial number of the dialogue
  • sentenceID The unique identifier of the sentence
  • optionID The unique identifier of the option
YaDialogSelectOption[] GetSelectOptions()
Gets all options of the speaker. Call it in the dialogue end event.
void ExitDialogState()
Interrupts the dialogue of the speaker.
void DialogStateEnds()
Completes the dialogue of the speaker.
boolean IsInDialogState()
Returns true if the speaker is in a dialogue.
YaDialogState GetDialogState()
Gets the dialogue state of the speaker.
YaDialogConfig GetDialogConfig(number dialogID)
Gets the configuration of the dialogue.
  • dialogID The unique identifier of the dialogue