now using multiple files instead of giant multiple files with extra keys

This commit is contained in:
2022-11-29 21:37:32 +01:00
parent 9865198883
commit 2f57e22f06
4 changed files with 14 additions and 30 deletions

View File

@@ -0,0 +1,12 @@
{
"randomWelcomeText":[
"Oh hello, §player§... You look great! What do you want from me?",
"Hey, §player§! Hope you have fun today!",
"Hi! What's up §player§?"
],
"debugAnswer": "Cool master you set me up successfully for this simulation!",
"randomGoodbyeText":[
"Was nice talking to you goodbye!",
"Have a great day, §player§!"
]
}

View File

@@ -1,26 +0,0 @@
{
"1": {
"randomWelcomeText":[
"Oh hello, §player§... You look great! What do you want from me?",
"Hey, §player§! Hope you have fun today!",
"Hi! What's up §player§?"
],
"debugAnswer": "Cool master you set me up successfully for this simulation!",
"randomGoodbyeText":[
"Was nice talking to you goodbye!",
"Have a great day, §player§!"
]
},
"2": {
"randomWelcomeText":[
"Oh hello, §player§... You look great! What do you want from me?",
"Hey, §player§! Hope you have fun today!",
"Hi! What's up §player§?"
],
"debugAnswer": "Cool master you set me up successfully for this simulation!",
"randomGoodbyeText":[
"Was nice talking to you goodbye!",
"Have a great day, §player§!"
]
}
}

View File

@@ -18,7 +18,7 @@ texture = ExtResource("1_imilm")
shape = SubResource("RectangleShape2D_pchpi") shape = SubResource("RectangleShape2D_pchpi")
[node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")] [node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")]
dialogFile = "res://dialog/npcs/villagers.json" dialogFile = "res://dialog/npcs/villager_normal.json"
[node name="collision_shape_2d" parent="dialog_trigger_area" index="0"] [node name="collision_shape_2d" parent="dialog_trigger_area" index="0"]
shape = SubResource("RectangleShape2D_d78tr") shape = SubResource("RectangleShape2D_d78tr")

View File

@@ -13,9 +13,7 @@ public partial class dialog_trigger_area : Area2D
var jsonFile = JSON.ParseString(text); var jsonFile = JSON.ParseString(text);
Dictionary allDialog = (Dictionary)jsonFile; Dictionary allDialog = (Dictionary)jsonFile;
Dictionary firsChunkDialog = (Dictionary)allDialog["1"]; GD.Print(allDialog["debugAnswer"]);
GD.Print(firsChunkDialog["debugAnswer"]);
} }