To install go to the releases page; You'll find 2 files there, one named DialogueMaker.exe and the other one named DialogueMakerNet.exe. Try downloading the first one, if it wont work for some reason then try with the second one. If both wont work, then contact me, or just compile the code Yourself. The program runs on .NET 5
I think I'm gonna do some more explaining in the program itself for now even though it's pretty self explanatory. All You do is create a project, go to the Create Tabcreate some dialogues and test them in the Test Tab. When You think You are done save the dialogues, go back to the Project Tab, select the desired export path and press Export.
Now that You have a .Json file all You need to do is import it into Your game and code Your Dialogue System for it. Examples of the code are in the Implementation Part.
Godot Code
All You need to do to get Your dialogues to work is to create all the required UI elements in Your dialogue scene like this:
DialogueBox Scene Code. This is the code that is attached to the DialogueUI element on the photo above.
extendsPanelvarDialogueDir="res://Assets/Dialogues/"varFile_name="Name.json"#Name of the file + ".json"! / This file has to be in the directory declared one line above!varNodesvarNPCName=""varNPCS;
varNPC;
varcurent_node_id=-1varcurent_node_namevarcurent_node_textvarcurent_node_choices= []
onreadyvardialogueButtons= [$Control/DialogueButton,$Control/DialogueButton2,$Control/DialogueButton3,$Control/DialogueButton4] #References to all the buttonsonreadyvardialogueText= $DialogueText#Reference to the label that will be showing the text of the dialogueonreadyvardialogueName= $DialogueName#Reference to the label thet will be showing the name of the NPConreadyvardialoguePanel=selffunc_ready():
rand_seed(OS.get_unix_time())
LoadFile(File_name)
StartDialogue()
funcLoadFile(fileName):
File_name=fileNamevarfile=File.new()
iffile.file_exists(DialogueDir+File_name):
file.open(DialogueDir+File_name, file.READ)
varjson_result=parse_json(file.get_as_text())
curent_node_id=1NPCS=json_result["NPCS"]
fornpcinNPCS:
if(npc["Name"] ==NPCName):
NPC=npcNodes=npc["Nodes"]
funcStartDialogue():
ifNodes:
curent_node_name=NPCNamecurent_node_id=1#Sets the id of the first Node, which is 1HandleNode()
else:
print("Dialogue: Could not Find Nodes")
funcEndDialogue():
curent_node_id=-1get_tree().get_current_scene().get_node("Player").isInDialogue=falsefuncNextNode(id):
curent_node_id=idHandleNode()
funcHandleNode():
ifcurent_node_id<1 :
EndDialogue()
else:
if !GetNode(curent_node_id):
EndDialogue()
UpdateUI()
funcGetNode(id):
fornodeinNodes:
ifint(node["Id"]) ==id:
curent_node_text=node["Text"]
curent_node_choices=node["Choices"]
returntruereturnfalsefuncUpdateUI():
ifcurent_node_id>=0:
dialoguePanel.show()
forxindialogueButtons:
x.hide()
ifx.is_connected("pressed",self,"_on_Button_Pressed"):
x.disconnect("pressed",self,"_on_Button_Pressed")
dialogueText.percent_visible=0dialogueName.text=curent_node_namedialogueText.text=curent_node_textifcurent_node_choices.size() >0:
forxinclamp(curent_node_choices.size(),0,3):
dialogueButtons[x].text=curent_node_choices[x]["Text"]
dialogueButtons[x].connect("pressed",self,"_on_Button_Pressed", [curent_node_choices[x]["Next_id"]])
dialogueButtons[x].show()
else:
dialoguePanel.hide()
func_on_Button_Pressed(id):
NextNode(id)Now the last, but not least You will need to open the dialogue box, so here's the code for it. You can run this code for example when the player gets near the NPC, or interacts with one.
varDialBox=DialogueBox.instance() #Creates a instance on the DialogueBox SceneDialBox.get_node("DialogueUI").NPCName=Name; #Sets the name of the NPCget_tree().get_current_scene().call_deferred("add_child", DialBox) #Adds the DialogueBox to the viewNote that you will have to position the window on the screen so its visible.
Better user interface (Darkmode etc.)User response dialogueOption to rename the projectAuto-Save functionSearch function (For NPC and Dialogue)Json object instructions to README.mdCustomization and user settings
Feel free to do pull requests, and edit the code hoverer You like. The software is distributed under a MIT license.
Preferable method of contact would be my discord: IsPossible#8212. You can send me anything you want, from issues regarding the software through new features to add and even pictures of Your cat. If I'll be getting too many messages I'll think about making a Discord Server, but I don't expect this program to get more than 100 downloads.
There is not much to say about that except that if You want more frequent updates and fixes, please consider Donating. Also, sorry for the code being a bit messy, I don't think I'll fix that anytime soon 😅.
