extends Node var emotion: String var dialog_flags : Dictionary = { "psychiatric_history": "not_asked", "substance_use_history": "not_asked", "lifestyle" : "not_asked", "history_of_present_illness": "not_asked", "appearance": "not_asked", "behaviour": "not_asked", "speech": "not_asked", "thought_process": "not_asked", "delusions": "not_asked", "hallucinations": "not_asked", "insight": "not_asked", "sleep": "not_asked", "mood": "not_asked", "suicidal_ideation": "not_asked", } var dialog_branch: Array = [] var dialog_tree: Dictionary = {"completed":false} var marker: int = 0 # Called when the node enters the scene tree for the first time. func _ready() -> void: dialog_branch.resize(100000) #dialog_tree.merge({1:{"completed":false}}) #var tree = [110,120,121,122,130,210,220,230,310,320,330] #build_dialog_tree(tree) pass func build_dialog_tree(tree) -> void: var dialog_model = tree var choices_max = [] var string_var = [] choices_max.resize(20) print(tree.max()) choices_max[1] = str(tree.max()).split()[0] for i in range(tree.size()): if str(tree[i]).split()[0] == "1": string_var.append(int(tree[i])) choices_max[11] = str(string_var.max()).split()[1] print(string_var.max()) print(choices_max[11]) print(choices_max[1]) for i in range(1,10): add_branch(dialog_tree, i) for i in range(1,10): add_branch(dialog_tree[1], i) for i in range (1,3): add_branch(dialog_tree[1][2], i) func add_branch(parent_branch: Dictionary, child_branch: int) -> void: var new_branch = {child_branch: {"completed": false}} parent_branch.merge(new_branch) func change_emotion(emotion) -> void: pass # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: pass