Skip to main content

SproutyDialogsDialogueData

Inherits: Resource

Description

This resource stores the dialogue data from the graph editor. It includes the graph data, character references, dialogues and a reference to a CSV file for translations.

Properties

TypeNameDefault
Dictionarygraph_data{}
Dictionarydialogs{}
Dictionarycharacters{}
intcsv_file_uid-1

Methods

Return TypeMethod
Array[String]get_start_ids()
Dictionaryget_portraits_on_dialog(start_id: String)

Property Descriptions

var graph_data : Dictionary = {}

The dialogue data from the graph editor. This is a dictionary where each key is the ID (start id) of a dialogue branch and its value is a nested dictionary containing the nodes of that branch.

This dictionary is structured as follows:

{
"dialogue_id_1": {
"node_1": { ... },
"node_2": { ... },
},
"dialogue_id_2": {
"node_1": { ... },
"node_2": { ... },
},
...
}

var dialogs : Dictionary = {}

A dictionary containing the dialogues for each dialogue ID.

This dictionary is structured as follows:

{
"dialogue_id_1": {
"locale_code_1": "Translated text in locale 1",
"locale_code_2": "Translated text in locale 2",
...
},
...
}

var characters : Dictionary = {}

A dictionary containing the characters for each dialogue ID. This is a dictionary where each key is the dialogue ID and its value is the characters associated with its UID.

This dictionary is structured as follows:

{
"dialogue_id_1": {
"character_name_1": UID of the character resource,
"character_name_2": UID of the character resource,
...
},
...
}

var csv_file_uid : int = -1

Reference to CSV file with the translations for the dialogues. This is the UID of the CSV file resource.


Method Descriptions

func get_start_ids() -> Array[String]

Returns a list of the start IDs from the graph data.


func get_portraits_on_dialog(start_id: String) -> Dictionary

Returns a dictionary of the characters and their portraits for a given start ID. The start ID is the ID of the dialogue branch to get the characters from.

The dictionary is structured as follows:

{
"character_name_1": [portrait_name_1, portrait_name_2, ...],
"character_name_2": [portrait_name_1, portrait_name_2, ...],
...
}