update
This commit is contained in:
+34
-46
@@ -2,66 +2,54 @@ extends Node
|
|||||||
|
|
||||||
var emotion: String
|
var emotion: String
|
||||||
var dialog_flags : Dictionary = {
|
var dialog_flags : Dictionary = {
|
||||||
"psychiatric_history": "not_asked",
|
"history_of_present_illness": [],
|
||||||
"substance_use_history": "not_asked",
|
"appearance": [],
|
||||||
"lifestyle" : "not_asked",
|
"behaviour": [],
|
||||||
"history_of_present_illness": "not_asked",
|
"speech": [],
|
||||||
"appearance": "not_asked",
|
"thought_process": [],
|
||||||
"behaviour": "not_asked",
|
"thought_content": [],
|
||||||
"speech": "not_asked",
|
"perceptions": [],
|
||||||
"thought_process": "not_asked",
|
"insight": [],
|
||||||
"delusions": "not_asked",
|
"sleep": [],
|
||||||
"hallucinations": "not_asked",
|
"mood": [],
|
||||||
"insight": "not_asked",
|
"suicidal_ideation": [],
|
||||||
"sleep": "not_asked",
|
|
||||||
"mood": "not_asked",
|
|
||||||
"suicidal_ideation": "not_asked",
|
|
||||||
}
|
}
|
||||||
var dialog_branch: Array = []
|
var dialog_tree: Dictionary
|
||||||
var dialog_tree: Dictionary = {"completed":false}
|
var marker: Array[int]
|
||||||
|
|
||||||
var marker: int = 0
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
dialog_branch.resize(100000)
|
marker.resize(10)
|
||||||
#dialog_tree.merge({1:{"completed":false}})
|
marker.fill(0)
|
||||||
#var tree = [110,120,121,122,130,210,220,230,310,320,330]
|
|
||||||
#build_dialog_tree(tree)
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func build_dialog_tree(tree) -> void:
|
|
||||||
var dialog_model = tree
|
|
||||||
var choices_max = []
|
|
||||||
var string_var = []
|
|
||||||
choices_max.resize(20)
|
|
||||||
|
|
||||||
print(tree.max())
|
func build_dialog_tree(tree_model: Array[int]) -> Dictionary:
|
||||||
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]
|
var branch : Dictionary
|
||||||
print(string_var.max())
|
var tree : Dictionary
|
||||||
print(choices_max[11])
|
|
||||||
|
|
||||||
print(choices_max[1])
|
for branch_id in tree_model:
|
||||||
for i in range(1,10):
|
branch = {branch_id: "not_asked"}
|
||||||
add_branch(dialog_tree, i)
|
tree.merge(branch)
|
||||||
for i in range(1,10):
|
|
||||||
add_branch(dialog_tree[1], i)
|
return tree
|
||||||
for i in range (1,3):
|
|
||||||
add_branch(dialog_tree[1][2], i)
|
|
||||||
|
|
||||||
|
|
||||||
func add_branch(parent_branch: Dictionary, child_branch: int) -> void:
|
func change_emotion(new_emotion: String) -> void:
|
||||||
var new_branch = {child_branch: {"completed": false}}
|
emotion = new_emotion
|
||||||
parent_branch.merge(new_branch)
|
|
||||||
|
|
||||||
func change_emotion(emotion) -> void:
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func send_to_reset() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func send_to_isolation() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ extends Control
|
|||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
||||||
var dialogue_resource = load("res://dialogues/test.dialogue")
|
var dialogue_resource = load("res://dialogues/mr_orleg.dialogue")
|
||||||
var dialogue_start = "mr_orleg_day_1_dialogue_start"
|
var dialogue_start = "mr_orleg_day_1_dialogue_start"
|
||||||
|
|
||||||
var dialogue = DialogueManager.show_dialogue_balloon(dialogue_resource, dialogue_start)
|
var dialogue = DialogueManager.show_dialogue_balloon(dialogue_resource, dialogue_start)
|
||||||
|
|||||||
+133
-25
@@ -1,62 +1,170 @@
|
|||||||
~ mr_orleg_day_1_dialogue_start
|
~ mr_orleg_day_1_dialogue_start
|
||||||
|
|
||||||
#dialog_branch[1215] signifie dialog_branch[choix_1][answer_2][answer_1][answer_5]
|
do CurrentPatient.marker.fill(0)
|
||||||
|
set CurrentPatient.dialog_tree = CurrentPatient.build_dialog_tree([1100,1200,1210,1220, 1300, 1400, 1500, 1610, 1620])
|
||||||
set CurrentPatient.marker = 0
|
|
||||||
|
|
||||||
: The patient remains still, watching you expectantly.
|
: The patient remains still, watching you expectantly.
|
||||||
|
|
||||||
Psychiatrist: Greetings Mr Orleg. You shall be my in care for the duration of your stay in this facility.
|
Psychiatrist: Greetings Mr Orleg. You shall be my in care for the duration of your stay in this facility.
|
||||||
|
|
||||||
Mr Orleg: Greetings Doctor. I need your help, i don't know why i'm here, there must have been a mistake !
|
Mr Orleg: Greetings Doctor. I need your help, i don't know why i'm here, there must have been a mistake !
|
||||||
|
|
||||||
|
|
||||||
~ choice_1
|
~ choice_1
|
||||||
- Tell me why you were brought here. [if CurrentPatient.dialog_branch[11] == false]
|
|
||||||
set CurrentPatient.dialog_branch[11] = true
|
- Tell me why you were brought here. [if CurrentPatient.dialog_tree[1100] == "not_asked"]
|
||||||
|
|
||||||
|
set CurrentPatient.dialog_tree[1100] = "asked"
|
||||||
|
do CurrentPatient.marker[0] += 1
|
||||||
do CurrentPatient.change_emotion("neutral")
|
do CurrentPatient.change_emotion("neutral")
|
||||||
|
do CurrentPatient.dialog_flags["insight"].append("Anosognosia")
|
||||||
|
|
||||||
Mr Orleg: Sure. I was at the usual grocery store next door, and there was that cashier who was threatening me. I was busy explaining her nobody can talk to Mr Orleg this way, when these damned cops came out of nowhere and brutally restrained me ! Can you imagine ?!
|
Mr Orleg: Sure. I was at the usual grocery store next door, and there was that cashier who was threatening me. I was busy explaining her nobody can talk to Mr Orleg this way, when these damned cops came out of nowhere and brutally restrained me ! Can you imagine ?!
|
||||||
|
|
||||||
=> choice_1
|
=> choice_1
|
||||||
|
|
||||||
- Do you feel safe in this room ? [if CurrentPatient.dialog_branch[12] == false]
|
- Do you feel safe in this room ? [if CurrentPatient.dialog_tree[1200] == "not_asked"]
|
||||||
|
|
||||||
|
set CurrentPatient.dialog_tree[1200] = "asked"
|
||||||
|
do CurrentPatient.marker[0] += 1
|
||||||
|
do CurrentPatient.change_emotion("scared")
|
||||||
|
do CurrentPatient.dialog_flags["thought_content"].append("Persecutory delusions")
|
||||||
|
|
||||||
Mr Orleg: Honestly ? I don't. Some of your colleagues have been giving me the heeby jeebies. Gotta stay sharp, i'm pretty sure he's here.
|
Mr Orleg: Honestly ? I don't. Some of your colleagues have been giving me the heeby jeebies. Gotta stay sharp, i'm pretty sure he's here.
|
||||||
|
|
||||||
~ choice_1_2
|
~ choice_1_2
|
||||||
- Who's "he" ? [if CurrentPatient.dialog_branch[121] == false]
|
|
||||||
set CurrentPatient.dialog_branch[121] = true
|
- Who's "he" ? [if CurrentPatient.dialog_tree[1210] == "not_asked"]
|
||||||
do CurrentPatient.marker += 1
|
|
||||||
|
set CurrentPatient.dialog_tree[1210] = "asked"
|
||||||
|
do CurrentPatient.marker[1] += 1
|
||||||
|
do CurrentPatient.dialog_flags["thought_content"].append("Mystical delusions")
|
||||||
|
|
||||||
Mr Orleg: Shhh... you musntn't speak his name aloud. "He" is the Harbinger. The Prophet and the Reaper. The Messiah and the Deceiver.
|
Mr Orleg: Shhh... you musntn't speak his name aloud. "He" is the Harbinger. The Prophet and the Reaper. The Messiah and the Deceiver.
|
||||||
|
|
||||||
if CurrentPatient.marker == 2
|
if CurrentPatient.marker[1] == 2
|
||||||
set CurrentPatient.dialog_branch[12] = true
|
set CurrentPatient.marker[1] = 0
|
||||||
set CurrentPatient.marker = 0
|
|
||||||
set CurrentPatient.dialog_flags["delusions"] = "Mystical and Persecutory"
|
|
||||||
=> choice_1
|
=> choice_1
|
||||||
else
|
else
|
||||||
=> choice_1_2
|
=> choice_1_2
|
||||||
|
|
||||||
- Which of my colleagues are you talking about ? [if CurrentPatient.dialog_branch[122] == false]
|
- Which of my colleagues are you talking about ? [if CurrentPatient.dialog_tree[1220] == "not_asked"]
|
||||||
set CurrentPatient.dialog_branch[122] = true
|
|
||||||
do CurrentPatient.marker += 1
|
set CurrentPatient.dialog_tree[1220] = "asked"
|
||||||
|
do CurrentPatient.marker[1] += 1
|
||||||
|
do CurrentPatient.dialog_flags["perceptions"].append("Mystical delusions")
|
||||||
|
|
||||||
Mr Orleg: Every single one of them... He's been using their shapes to contact me. I need to remain strong, Doctor.
|
Mr Orleg: Every single one of them... He's been using their shapes to contact me. I need to remain strong, Doctor.
|
||||||
|
|
||||||
if CurrentPatient.marker == 2
|
if CurrentPatient.marker[1] == 2
|
||||||
set CurrentPatient.dialog_branch[12] = true
|
set CurrentPatient.marker[1] = 0
|
||||||
set CurrentPatient.marker = 0
|
|
||||||
=> choice_1
|
=> choice_1
|
||||||
else
|
else
|
||||||
=> choice_1_2
|
=> choice_1_2
|
||||||
|
|
||||||
- Have you ever been hospitalized in Psychiatry before ?
|
- How has your sleep been recently ? [if CurrentPatient.dialog_tree[1300] == "not_asked"]
|
||||||
|
|
||||||
- Do you have any relatives suffering from a psychiatric condition ?
|
set CurrentPatient.dialog_tree[1300] = "asked"
|
||||||
|
do CurrentPatient.marker[0] += 1
|
||||||
|
do CurrentPatient.change_emotion("neutral")
|
||||||
|
do CurrentPatient.dialog_flags["sleep"].append("Insomnia")
|
||||||
|
|
||||||
- Did you sleep well last night ?
|
Mr Orleg: Hard to keep my eyes shut lately, i'll admit. I definitely could use some rest.
|
||||||
|
|
||||||
- Start again => mr_orleg_day_1_dialogue_start
|
=> choice_1
|
||||||
- End the conversation => END
|
|
||||||
|
- How are you feeling lately ? [if CurrentPatient.dialog_tree[1400] == "not_asked"]
|
||||||
|
|
||||||
|
set CurrentPatient.dialog_tree[1400] = "asked"
|
||||||
|
do CurrentPatient.marker[0] += 1
|
||||||
|
do CurrentPatient.change_emotion("neutral")
|
||||||
|
do CurrentPatient.dialog_flags["mood"].append("Euthymia")
|
||||||
|
|
||||||
|
Mr Orleg: I'm feeling rather fine, actually. My life's quite enjoyable, except for the whole "i'm locked in here cause people think i'm crazy" situation. You've got to help me Doctor.
|
||||||
|
|
||||||
|
- Have you had any thoughts about wanting to end your life ?
|
||||||
|
|
||||||
|
do CurrentPatient.dialog_flags["suicidal_ideation"].append("None")
|
||||||
|
|
||||||
|
Mr Orleg: I would never dare end the life God has given me.
|
||||||
|
|
||||||
|
=> choice_1
|
||||||
|
|
||||||
|
- Examine [if CurrentPatient.dialog_tree[1500] == "not_asked"]
|
||||||
|
|
||||||
|
set CurrentPatient.dialog_tree[1500] = "asked"
|
||||||
|
do CurrentPatient.marker[0] += 1
|
||||||
|
do CurrentPatient.dialog_flags["appearance"].append("Fixed gaze")
|
||||||
|
|
||||||
|
: The patient appears to be calm and collected. His garment is clean, if a bit crumpled. His gaze switches back and forth between a wide-eyed focus on your face, and vacantly staring at the wall.
|
||||||
|
|
||||||
|
=> choice_1
|
||||||
|
|
||||||
|
- Don't you feel anxious about this otherwordly being targeting you ? [if CurrentPatient.marker[0] == 5]
|
||||||
|
|
||||||
|
set CurrentPatient.marker[0] = 0
|
||||||
|
do CurrentPatient.change_emotion("happy")
|
||||||
|
do CurrentPatient.dialog_flags["thought_process"].append("Ideo-affective dissociation")
|
||||||
|
do CurrentPatient.dialog_flags["thought_content"].append("Megalomaniac delusions")
|
||||||
|
|
||||||
|
Mr Orleg: Not really. I'm protected by God. No one can hurt me.
|
||||||
|
|
||||||
|
~ choice_1_6
|
||||||
|
|
||||||
|
- How do you know God protects you ? [if CurrentPatient.dialog_tree[1610] == "not_asked"]
|
||||||
|
|
||||||
|
set CurrentPatient.dialog_tree[1610] = "asked"
|
||||||
|
set CurrentPatient.marker[2] += 1
|
||||||
|
do CurrentPatient.dialog_flags["perceptions"].append("Intra-psychic auditory hallucinations")
|
||||||
|
|
||||||
|
Mr Orleg: He shares his Will with me directly inside my head. We have a special connection.
|
||||||
|
|
||||||
|
if CurrentPatient.marker[2] == 2
|
||||||
|
set CurrentPatient.marker[2] = 0
|
||||||
|
=> choice_2
|
||||||
|
else
|
||||||
|
=> choice_1_6
|
||||||
|
|
||||||
|
- Have you ever seen God or this evil being with your own eyes ? [if CurrentPatient.dialog_tree[1620] == "not_asked"]
|
||||||
|
|
||||||
|
set CurrentPatient.dialog_tree[1620] = "asked"
|
||||||
|
set CurrentPatient.marker[2] += 1
|
||||||
|
|
||||||
|
Mr Orleg: Never. I don't need to see them to know they're here.
|
||||||
|
|
||||||
|
if CurrentPatient.marker[2] == 2
|
||||||
|
set CurrentPatient.marker[2] = 0
|
||||||
|
=> choice_2
|
||||||
|
else
|
||||||
|
=> choice_1_6
|
||||||
|
|
||||||
|
~ choice_2
|
||||||
|
|
||||||
|
- Send to Reset
|
||||||
|
|
||||||
|
Psychiatrist: You are in need of psychiatric care, Mr Orleg. My colleagues here will take you to the resetting room for adequate treatment.
|
||||||
|
|
||||||
|
Mr Orleg: You can't do that Doctor ! This is a mistake !
|
||||||
|
|
||||||
|
Mr Orleg: I swear i'm not crazy !
|
||||||
|
|
||||||
|
do CurrentPatient.send_to_reset()
|
||||||
|
|
||||||
|
=> END
|
||||||
|
|
||||||
|
- Send to Isolation
|
||||||
|
|
||||||
|
Psychiatrist: I have assessed that you are currently unstable, Mr Orleg. You may be dangerous to other people, and even to yourself. We are going to Isolate you to ensure your safety.
|
||||||
|
|
||||||
|
do CurrentPatient.change_emotion("scared")
|
||||||
|
|
||||||
|
Mr Orleg: What ?? Th- This can't be...
|
||||||
|
|
||||||
|
Mr Orleg: Please, have mercy.
|
||||||
|
|
||||||
|
do CurrentPatient.send_to_isolation
|
||||||
|
|
||||||
|
=> END
|
||||||
|
|
||||||
|
- End the evaluation => END
|
||||||
|
|
||||||
=> END
|
=> END
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="dialogue_manager_compiler_14"
|
importer="dialogue_manager_compiler_14"
|
||||||
type="Resource"
|
type="Resource"
|
||||||
uid="uid://d180ahgobkj4e"
|
uid="uid://j4cb2hniy7mk"
|
||||||
path="res://.godot/imported/mr_orleg.dialogue-de858637a612f91e5bc83867aa2a9e9f.tres"
|
path="res://.godot/imported/mr_orleg.dialogue-de858637a612f91e5bc83867aa2a9e9f.tres"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
~ mr_orleg_day_1_dialogue_start
|
|
||||||
|
|
||||||
set CurrentPatient.marker = 0
|
|
||||||
do CurrentPatient.build_dialog_tree([110,120,121,122,130,210,220,230,310,320,330])
|
|
||||||
|
|
||||||
: The patient remains still, watching you expectantly.
|
|
||||||
Psychiatrist: Greetings Mr Orleg. You shall be my in care for the duration of your stay in this facility.
|
|
||||||
Mr Orleg: Greetings Doctor. I need your help, i don't know why i'm here, there must have been a mistake !
|
|
||||||
|
|
||||||
|
|
||||||
~ choice_1
|
|
||||||
- Tell me why you were brought here. [if CurrentPatient.dialog_tree[1][1]["completed"] == false]
|
|
||||||
set CurrentPatient.dialog_tree[1][1]["completed"] = true
|
|
||||||
do CurrentPatient.change_emotion("neutral")
|
|
||||||
|
|
||||||
Mr Orleg: Sure. I was at the usual grocery store next door, and there was that cashier who was threatening me. I was busy explaining her nobody can talk to Mr Orleg this way, when these damned cops came out of nowhere and brutally restrained me ! Can you imagine ?!
|
|
||||||
|
|
||||||
=> choice_1
|
|
||||||
|
|
||||||
- Do you feel safe in this room ? [if CurrentPatient.dialog_tree[1][2]["completed"] == false]
|
|
||||||
set CurrentPatient.dialog_tree[1][2]["completed"] = true
|
|
||||||
do CurrentPatient.change_emotion("scared")
|
|
||||||
set CurrentPatient.dialog_flags["delusions"] = "Mystical and Persecutory"
|
|
||||||
|
|
||||||
Mr Orleg: Honestly ? I don't. Some of your colleagues have been giving me the heeby jeebies. Gotta stay sharp, i'm pretty sure he's here.
|
|
||||||
|
|
||||||
~ choice_1_2
|
|
||||||
- Who's "he" ? [if CurrentPatient.dialog_tree[1][2][1]["completed"] == false]
|
|
||||||
set CurrentPatient.dialog_tree[1][2][1]["completed"] = true
|
|
||||||
do CurrentPatient.marker += 1
|
|
||||||
|
|
||||||
Mr Orleg: Shhh... you musntn't speak his name aloud. "He" is the Harbinger. The Prophet and the Reaper. The Messiah and the Deceiver.
|
|
||||||
|
|
||||||
if CurrentPatient.marker == 2
|
|
||||||
set CurrentPatient.marker = 0
|
|
||||||
=> choice_1
|
|
||||||
else
|
|
||||||
=> choice_1_2
|
|
||||||
|
|
||||||
- Which of my colleagues are you talking about ? [if CurrentPatient.dialog_tree[1][2][2]["completed"] == false]
|
|
||||||
set CurrentPatient.dialog_tree[1][2][2]["completed"] = true
|
|
||||||
do CurrentPatient.marker += 1
|
|
||||||
|
|
||||||
Mr Orleg: Every single one of them... He's been using their shapes to contact me. I need to remain strong, Doctor.
|
|
||||||
|
|
||||||
if CurrentPatient.marker == 2
|
|
||||||
set CurrentPatient.marker = 0
|
|
||||||
=> choice_1
|
|
||||||
else
|
|
||||||
=> choice_1_2
|
|
||||||
|
|
||||||
- Have you ever been hospitalized in Psychiatry before ?
|
|
||||||
|
|
||||||
- Do you have any relatives suffering from a psychiatric condition ?
|
|
||||||
|
|
||||||
- Did you sleep well last night ?
|
|
||||||
|
|
||||||
- Start again => mr_orleg_day_1_dialogue_start
|
|
||||||
- End the conversation => END
|
|
||||||
|
|
||||||
=> END
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="dialogue_manager_compiler_14"
|
|
||||||
type="Resource"
|
|
||||||
uid="uid://j4cb2hniy7mk"
|
|
||||||
path="res://.godot/imported/test.dialogue-dc69268be77aa19a4b95a0f66b796254.tres"
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://dialogues/test.dialogue"
|
|
||||||
dest_files=["res://.godot/imported/test.dialogue-dc69268be77aa19a4b95a0f66b796254.tres"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
defaults=true
|
|
||||||
+1
-1
@@ -45,4 +45,4 @@ enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg")
|
|||||||
|
|
||||||
[internationalization]
|
[internationalization]
|
||||||
|
|
||||||
locale/translations_pot_files=PackedStringArray("res://dialogues/mr_orleg.dialogue", "res://dialogues/test.dialogue")
|
locale/translations_pot_files=PackedStringArray("res://dialogues/mr_orleg.dialogue")
|
||||||
|
|||||||
Reference in New Issue
Block a user