I'm working on my dialogue system for now and am having issues running it. I was using tutorials for 3.X and trying to make it work with 4.X
This is my dialogue manager code... I've been messing with it so it may not be the same as I had it from the tutorial but it all ends in the same error.
#Preload the Dialogue Box
const INTERFACE_SCENE : PackedScene = preload("res://Dialogue/dialogue.tscn")
var current_interface : dialogue_interface
func begin_dialogue(file_path: String):
#Load the file
var file = FileAccess.open(file_path, FileAccess.READ)
#Parse JSON into Dictionary
var dialogue_dictionary = JSON.new()
var parse_result = dialogue_dictionary.parse(file.get_as_text())
var result = dialogue_dictionary.get_data()
#Launch the dialogue window
current_interface = INTERFACE_SCENE.instantiate()
get_tree().root.add_child(current_interface)
#current_interface.show_dialogue(dialogue_dictionary)
func end_dialogue():
current_interface.queue_free()
The error I'm getting is "Invalid type in function 'show_dialogue' in base 'CanvasLayer (dialogue_interface)'. Cannot convert argument 1 from int to Dictionary
This is my JSON file
{
"001" {
"name":"Test NPC",
"text":"You have to keep playing!"
},
"002" {
"name": "Test NPC",
"text": "You must win at any cost!"
}
}