Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • branchContainsTag(query: string): boolean
  • branchTitleHasBeenVisited(title: string): any
  • Check if a player has visited a Dialogue Branch in the past.

    Parameters

    • title: string

      The title of the branch to check for. Leaving this empty will check if the current branch title has been visited in the past.

    Returns any

  • branchTitleIs(title: string): boolean
  • clearState(): void
  • commandParametersCount(): number
  • compareVariable(key: string, value: string | number | boolean): boolean
  • Check if a specific variable created by the Dialogue parses exists and is equal to a specific value.

    Parameters

    • key: string

      The name of the variable you want to check the value of

    • value: string | number | boolean

      The value you want to check against

    Returns boolean

  • completeClippedTextScrolling(): void
  • Scroll the clipped text to its end, so the entire text is printed. This can be useful in keeping the event sheet logic simpler, while supporting more variation.

    Returns void

  • confirmSelectOption(): void
  • Confirm the currently selected option, during the parsing of an Options type line.

    This will advance the dialogue tree to the dialogue branch was selected by the player.

    Returns void

  • getBranchTag(index: number): string
  • Get one of the current Dialogue branch tags via index.

    Parameters

    • index: number

      The index of the Dialogue Branch tag you want to get.

    Returns string

    The branch tag at the specified index, or an empty string if not found.

  • getBranchTags(): string
  • getBranchText(): string
  • getBranchTitle(): string
  • getClippedLineText(): string
  • Get the current dialogue line with a scrolling effect (recommended). Used with the scrollClippedText to achieve a classic scrolling text, as well as any <> effects to pause scrolling.

    Returns string

  • getCommandParameter(paramIndex: number): string
  • Get a command parameter in any command with parameters that has been caught by a isCommandCalled condition

    Parameters

    • paramIndex: number

      The index of the parameter to get.

    Returns string

  • getLineOption(optionIndex: number): string | never[]
  • Get the text of an option the player can select. Used with getLineOptionsCount to render options for the player when a line of the Options type is parsed

    Parameters

    • optionIndex: number

      The index of the option you want to get

    Returns string | never[]

  • getLineOptionsCount(): number
  • getLineOptionsText(optionSelectionCursor: string, addNewLine: boolean): string
  • Get the text of the options the player can select, along with the selection cursor.

    Parameters

    • optionSelectionCursor: string

      The string used to draw the currently selected option's cursor

    • addNewLine: boolean

      when true each option is rendered on a new line.

    Returns string

  • getLineOptionsTextHorizontal(optionSelectionCursor: any): string
  • getLineOptionsTextVertical(optionSelectionCursor: any): string
  • getLineText(): string
  • Get the current complete dialogue line without using any scrolling effects. Note that using this instead getClippedLineText will skip any <> commands entirely.

    Returns string

  • getSelectedOption(): number
  • getTagParameter(paramIndex: number): string
  • Get any tag(parameter,anotherParameter) from a tag captured by the branchContainsTag Condition

    Parameters

    • paramIndex: number

      The index of the tag parameter you want to get. Leaving this empty will result in retrieving the first parameter.

    Returns string

  • getVariable(key: string): string | float | boolean
  • getVariableAsNumber(key: string): float
  • getVariableAsString(key: string): string
  • getVisitedBranchTitles(): string
  • goToNextDialogueLine(): void
  • This is the main lifecycle function.It runs once only when the user is advancing the dialogue to the next line. Progress Dialogue to the next line. Hook it to your game input. Note that this action can be influenced by any <> commands, but they work only if you have at least one isCommandCalled condition.

    Returns void

  • hasClippedScrollingCompleted(): boolean
  • hasDialogueBranch(branchName: string): any
  • Check if a branch exists. It is also used internally whenever you use the start from action.

    Parameters

    • branchName: string

      The Dialogue Branch name you want to check.

    Returns any

  • hasSelectedOptionChanged(): boolean
  • Check when the player has changed option selection since the last call to this function.

    Can be used to re-render your displayed dialogue options when needed.

    Returns boolean

    true if the selected option was updated since the last call to this function

  • isCommandCalled(command: string): boolean
  • Catch <> and <> from the current Dialogue Line. You can trigger custom logic that relate to the story you are telling during the dialogue.

    Parameters

    • command: string

      The command you want to check for being called. Write it without the <<>>.

    Returns boolean

  • isDialogueLineType(type: string): boolean
  • Check the type of the Dialogue Line that is being displayed to the player at the moment.

    There are three types:

    • text - regular dialogue text is being parsed at the moment
    • options - the player has reached a branching choice moment where they must select one of multiple options
    • command - a <> was called in the background, that can be used to trigger game events, but will not be displayed in the dialogue box.

    Parameters

    • type: string

      The type you want to check for ( one of the three above )

    Returns boolean

  • isRunning(): boolean
  • loadFromJsonFile(instanceContainer: RuntimeInstanceContainer, jsonResourceName: string, startDialogueNode: string): void
  • Load the Dialogue Tree data from a JSON resource.

    Parameters

    • instanceContainer: RuntimeInstanceContainer

      The scene where the dialogue is running.

    • jsonResourceName: string

      The JSON resource where to load the Dialogue Tree data from. The data is a JSON string usually created with Yarn Dialogue Editor.

    • startDialogueNode: string

      The Dialogue Branch to start the Dialogue Tree from. If left empty, the data will only be loaded, but can later be initialized via another action

    Returns void

  • loadFromSceneVariable(sceneVar: Variable, startDialogueNode: string): void
  • Load the Dialogue Tree data of the game. Initialize The Dialogue Tree, so as it can be used in the game.

    Parameters

    • sceneVar: Variable

      The variable to load the Dialogue tree data from. The data is a JSON string, created by Yarn.

    • startDialogueNode: string

      The Dialogue Branch to start the Dialogue Tree from. If left empty, the data will only be loaded, but can later be initialized via another action

    Returns void

  • loadState(inputVariable: Variable): void
  • Load the current State of the Dialogue Parser from a specified variable. Can be used to implement persistence in dialogue through your game's Load/Save function. That way you can later load all the dialogue choices the player has made.

    Parameters

    • inputVariable: Variable

      The structured variable where to load the State from.

    Returns void

  • saveState(outputVariable: Variable): void
  • Store the current State of the Dialogue Parser in a specified variable. Can be used to implement persistence in dialogue through your game's Load/Save function. That way you can later load all the dialogue choices the player has made.

    Parameters

    • outputVariable: Variable

      The variable where to store the State

    Returns void

  • scrollClippedText(): void
  • selectNextOption(): void
  • selectOption(optionIndex: number): void
  • selectPreviousOption(): void
  • setVariable(key: string, value: string | number | boolean): void
  • Set a specific variable created by the Dialogue parser to a specific value.

    Parameters

    • key: string

      The name of the variable you want to set the value of

    • value: string | number | boolean

      The value you want to set

    Returns void

  • startFrom(startDialogueNode: string): void
  • Start parsing dialogue from a specified Dialogue tree branch. Can be used if you want to store multiple dialogues inside a single Dialogue tree data set.

    Parameters

    • startDialogueNode: string

      The Dialogue Branch name you want to start parsing from.

    Returns void

  • stopRunningDialogue(): void

Generated using TypeDoc