now using multiple files instead of giant multiple files with extra keys
This commit is contained in:
12
dialog/npcs/villager_normal.json
Normal file
12
dialog/npcs/villager_normal.json
Normal 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§!"
|
||||||
|
]
|
||||||
|
}
|
@@ -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§!"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -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")
|
||||||
|
@@ -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"]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user