minor changes and added rewritten version of dialog json will be implemented later
This commit is contained in:
51
dialog/npcs/rewrite_villager_normal.json
Normal file
51
dialog/npcs/rewrite_villager_normal.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"dialogTitle": "Debug Character",
|
||||
"dialogType": "villager",
|
||||
|
||||
"random":
|
||||
{
|
||||
"welcome":
|
||||
[
|
||||
"Oh hello, {0}... You look great! What do you want from me?",
|
||||
"Hey, {0}! Hope you have fun today!",
|
||||
"Hi! What's up {0}?"
|
||||
],
|
||||
"goodbye":
|
||||
[
|
||||
"Was nice talking to you goodbye!",
|
||||
"Have a great day, {0}!"
|
||||
]
|
||||
},
|
||||
"multi":
|
||||
{
|
||||
"tipp":
|
||||
{
|
||||
"0":
|
||||
[
|
||||
"You can walk arround with WASD on PC.",
|
||||
"You can also use your joystick and D-Pad, if you have a controller.",
|
||||
"You can interact with cupcakes and use the buggy placeholder clouds as a football."
|
||||
],
|
||||
"1":
|
||||
[
|
||||
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr,",
|
||||
"sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,",
|
||||
"sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.",
|
||||
"Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
|
||||
],
|
||||
"2":
|
||||
[
|
||||
"test1test1test1test1test1test1test1test1test1test1test1test1test1test1test1",
|
||||
"test2test2test2test2test2test2test2test2test2test2test2test2test2test2test2",
|
||||
"test3test3test3test3test3test3test3test3test3test3test3test3test3test3test3",
|
||||
"So do you want to do xy for me?",
|
||||
{
|
||||
"Okay I'm doing that":
|
||||
[
|
||||
"Good nice thank you!"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -26,7 +26,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"multiDebugTipp2":[
|
||||
"multiTipp2":[
|
||||
"test1test1test1test1test1test1test1test1test1test1test1test1test1test1test1",
|
||||
"test2test2test2test2test2test2test2test2test2test2test2test2test2test2test2",
|
||||
"test3test3test3test3test3test3test3test3test3test3test3test3test3test3test3",
|
||||
|
@@ -16,7 +16,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
{
|
||||
userName = playerName;
|
||||
GetNode("/root/main/player").Call("ChangeProcess", false);
|
||||
currentKey = "multiTipp0";//2 is a selection menu needs to be planned before coding
|
||||
currentKey = "multiTipp2";//2 is a selection menu needs to be planned before coding
|
||||
using var file = FileAccess.Open(dialogFile, FileAccess.ModeFlags.Read);
|
||||
string text = file.GetAsText();
|
||||
allDialog = (Dictionary)JSON.ParseString(text);
|
||||
@@ -24,7 +24,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
addText();
|
||||
|
||||
|
||||
//Todo: add multiline text and actual running dialog. And go through string for other dictionaries wich always will be playeranswers
|
||||
//Todo: Implement the better json file structure.
|
||||
|
||||
}
|
||||
public void EndDialog()
|
||||
@@ -36,16 +36,11 @@ public partial class dialog_bubble : CanvasLayer
|
||||
}
|
||||
public void addText()
|
||||
{
|
||||
var dialogWithKey = allDialog[currentKey].AsStringArray();
|
||||
if (currentKey.StartsWith("random"))
|
||||
{
|
||||
string[] dialogRand = allDialog[currentKey].AsStringArray();
|
||||
currentDialogList.Add(dialogRand[GD.Randi() % dialogRand.Length]);
|
||||
}
|
||||
currentDialogList.Add(dialogWithKey[GD.Randi() % dialogWithKey.Length]);
|
||||
if (currentKey.StartsWith("multi"))
|
||||
{
|
||||
string[] dialogMulti = allDialog[currentKey].AsStringArray();
|
||||
currentDialogList.AddRange(dialogMulti);
|
||||
}
|
||||
currentDialogList.AddRange(dialogWithKey);
|
||||
}
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
|
Reference in New Issue
Block a user