DialogueManager

The main global interface to the Dialogue Manager.

[!NOTE] If you're using C# for your project then have a look at the C# wrapper.

Signals

dialogue_ended

signal dialogue_ended(resource: DialogueResource)
public static event DialogueEndedEventHandler? DialogueEnded;

Emitted when the next line of dialogue is empty and provides the calling resource.

dialogue_started

signal dialogue_started(resource: DialogueResource)
public static event DialogueStartedEventHandler? DialogueStarted;

Emitted when a dialogue balloon is created by DialogueManager and dialogue begins.

got_dialogue

signal got_dialogue(line: DialogueLine)
public static event GotDialogueEventHandler? GotDialogue;

Emitted when a dialogue line is found.

mutated

signal mutated(mutation: Dictionary)
public static event MutatedEventHandler? Mutated;

Emitted when a mutation line is about to be run (not including set lines).

passed_cue

signal passed_cue(cue: String)
public static event PassedCueEventHandler? PassedCue;

Emitted when a cue marker is passed through.

waiting_for_input

signal waiting_for_input
public static event WaitingForInputEventHandler? WaitingForInput;

Emitted when waiting for input.

waited_for_input

signal waited_for_input
public static event WaitedForInputEventHandler? WaitedForInput;

Emitted when waiting for input received input.

Properties

get_current_scene

var get_current_scene: Callable = func() -> Node:
public static Func<Node> GetCurrentScene

Tell Dialogue Manager how to resolve what the "current scene" is. If you're using a scene manager then you'll want to override this to pass the scene manager's current scene through.

Methods

show_dialogue_balloon

func show_dialogue_balloon(resource: DialogueResource, cue: String = "", extra_game_states: Array = []) -> Node
public static Node ShowDialogueBalloon(Resource dialogueResource, string key = "", Array<Variant>? extraGameStates = null)

Opens the dialogue balloon configured in settings (or the example balloon if none has been set).

Returns the balloon's base node in case you want to queue_free() it yourself.

show_dialogue_balloon_scene

func show_dialogue_balloon_scene(balloon_scene: Node | String, resource: DialogueResource, cue: String = "", extra_game_states: Array = []) -> Node
public static Node ShowDialogueBalloonScene(string balloonScene, Resource dialogueResource, string key = "", Array<Variant>? extraGameStates = null)

Opens a dialogue balloon given in balloon_scene.

Returns the balloon's base node in case you want to queue_free() it yourself.

get_next_dialogue_line

func get_next_dialogue_line(resource: DialogueResource, key: String = "", extra_game_states: Array = [], mutation_behaviour: MutationBehaviour = MutationBehaviour.Wait) -> DialogueLine
public static async Task<DialogueLine?> GetNextDialogueLine(Resource dialogueResource, string key = "", Array<Variant>? extraGameStates = null, MutationBehaviour mutation_behaviour = MutationBehaviour.Wait)

[!IMPORTANT] Must be used with await.

Given a resource and cue/key, it will find the next printable line of dialogue (running mutations along the way unless mutation_behaviour is overriden).

Returns a DialogueLine or null.

Pass an array of nodes/dictionaries as extra_game_states in order to temporarily add to the game state shortcuts that are available to conditions and mutations.

You can specify mutation_behaviour to be one of the values provided in the DialogueManager.MutationBehaviour enum. Wait is the default and will await any mutation lines. DoNoWait will run the mutations but not wait for them before moving to the next line. Skip will skip mutations entirely. In most cases, you should leave this as the default.

[!NOTE] The example balloon only supports Wait.

show_example_dialogue_balloon

func show_example_dialogue_balloon(resource: DialogueResource, cue: String = "", extra_game_states: Array = []) -> CanvasLayer
public static CanvasLayer ShowExampleDialogueBalloon(Resource dialogueResource, string key = "", Array<Variant>? extraGameStates = null)

Opens the example balloon.

If your game viewport is less than 400, it will open the low res balloon. Otherwise, it will open the usual balloon.

It will close once dialogue runs out.

Returns the example balloon's base CanvasLayer in case you want to free it yourself.