A downloadable asset pack

Godot Dialogue Graph with Json.


This is a simple Dialogue System for your Godot 3.x and 4.x games.

It is built around a preset JSON format ( Example found under Dialogues folder) .

I made this system for one of my pet projects and figured I would post it for anyone in need of a simple system or a reference for building their own. 


For a more full fledged solution please check out this Open Source project posted here .


Description:

What you CAN do:

- Linear Dialogue

- Branching Dialogue (Multi-answer supported!)

- Looping and branching Dialogue

- Basically any kind of graph based dialogue


What you CAN NOT do:

- Dialogue Conditionals are at this point not supported and since I do not need them for my current projects it is unlikely i will be implementing it soon


How To:
---------- VERSION 4.0.2 +  RECOMENDED ------------
Provide better naming for variables functions and files where applicable
Move all scripts to snake_case to match gdscript.
Split dialogue_manager from trigger:
The only demonstration on how to call a dialogue externally (from another node or user action) was inside the main dialogue_manager script , convoluting things in the script, possibly making it harder to understand and with no real way to show users how to do this properly.
Since then a second script has been added (dialogue_trigger_demo.gd) that shows how to interact with a dialogue system from any game or system easily. Along with this change the whole dialogue ui scene has been loaded as an autoload, making it readily accessible and minimizing resource use.

I suggest everyone go read the dialogue_manager.gd script in order to understand how the system works, and then check out the dialogue_trigger_demo.gd script on how to call it.
For anyone that has no previous experience with autoload scenes and scripts I suggest the official docs here.
The project has the dialogue ui scene already set up as an autoload, you will find it at Project > Project Settings > Autoload .

All in all this version should both be more readable, easy to integrate and use, and be a better educational piece than before.

For users Upgrading: Take extra note to check the changes in the demo json file, some renames have been applied to better match case sensitivity with the rest of the project, also the force option has been removed since it's now obsolete (due to trigger demostration).

-------VERSION 4.0.1 or older --------

There are instructions of how to Load a dialogue and start it inside the single script of the project (Scripts/DIalogueManager.gd) , if that is not sufficient feel free to contact me.

There is a Dialogue json Example that you ABSOLUTELY SHOULD look at. That is how your dialogue files should look like. 


THINGS TO NOTE :
- Dialogue Nodes should start at id 0 

 - If you want to exit the dialogue set the next_id to -1 

-Every Dialogue Node must have a different id number

-The generic next_id will be ignored if you fill the choices[] array.
- Currently supports up to 4 choices, you can easily expand it to more

FAQ:

Q: JSON Files are not showing in my Godot editor :
A: This is by Godot's design and is unlikely to change, you are still able to load and read the files just fine, they are just not shown inside the editor. 
Godot 4 Update: You should be able to see json files inside the editor.

Hope you find this useful , looking forward to some feedback.

VERSIONS:

- 1.0.0 Original version as uploaded on 11/03/2018

- 1.0.1 Bug Fix As pointed out by user @Hobofairy

- 1.0.2 Port to Godot 4 (not backwards compatible with Godot 3).

- 3.0.1 renamed from 1.0.1 to reflect godot version

- 4.0.1 renamed to 1.0.2 to reflect godot version

- 4.0.2 clean up variable names, simplify dialogue manager script further, add extra comments. Move to a trigger - autoload solution (more info in description).

Tested And working with (should work with everything above 3.1) : 
Godot 3 : 3.1 up to 3.6 (dialogue versions 1.0.0, 1.0.1, 3.0.1)
Godot 4: 4.0 , 4.1.1 (dialogue versions 1.0.2, 4.0.1, 4.0.2)

StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(3 total ratings)
Authorinsbilla
GenreEducational
Tagsdialogue, Godot

Download

Download
Godot 3 - JsonDialogue_v3.0.1.zip 13 kB
Download
Godot 4 - JsonDialogue_v4.0.1.zip 4 MB
Download
(Latest) Godot 4 - JsonDialogue_v4.0.2.zip 4 MB

Comments

Log in with itch.io to leave a comment.

Do you have a Discord username?

Hey, sorry no, you can post any question here that you like, it's always better so that people looking for the same issue can find the solution as well :)

Hello, will there be godot4.x version of it?

Hey, sorry haven't been very active with either itch or gdscript. Just uploaded the 4.x version. I didn't have the time to fix up the ui so it might be a bit off from the pictures but it is working. :) 

(+1)

Hi! I just wanted to say: thank you so much! I was always stuck on how to make a dialogue system in Godot, and happened to stumble upon your project last year. I used your project as reference for building my own dialogue system (https://github.com/QueenChristina/gd_dialog), and finally finished it. It was such a great educational experience, and your project broke down how it all worked in such an easy to follow way. Seriously, I cannot thank you enough! I don't think I could've managed this without you sharing your project.

(+2)

I am glad it was of help, your project from a quick glance seems awesome :D Thanks for sharing and making it Open Source :) I will add it to the description for people that are looking for a full fledged solution :) 

I'm a beginner in Godot and spent like a week searching for a good way to import json files into a dialogue system, this was exactly what I was looking for! Thanks a lot for this :D

(+1)

Glad it was helpful :D Looking forward to your games.

hey could you make a video tutorial for this?

Hey there, I am sorry I am not really into video making at all. If you have specific questions just fire away. In general the .json files included in the project should be self explanatory, also there is some documentation in the script, if that doesn't cover it just come back here with your questions.
The general concept is:
- Make a new script that triggers the dialogue in any way you need it (overlap with character, button press, anything else)
- Get a reference to the main UI script provided (with get_node() or with an autoload

- Then you call LoadFile("Name Of File Here")
- And finaly you call StartDialogue()

Everything else should be setup inside each .json file for each dialogue you have created, including names,text,options and where they lead etc. The one included should give a good representation of what you can do with it.

If you don't know how .json files work (or are supposed to work anyway, they are plain text files after all, they just have defined structure is all) you should check out a generic json tutorial , it should clear most things up.

(+3)

So i just wanna say i have very minimal coding experience and the most i have is what i learned in my first game jam like 3 weeks ago lol.  I've been looking for some pre built dialog systems but none of them stood out as something accesible and such. However your dialog graph is really good and nice and i managed to even get it to where letters appear one at a time and sound plays on each letter shown, etc. So like super kudos to you for making it accessible and such and just the comments throughout the code is so helpful! <3 

(+1)

I am really glad it was helpful to you,  the whole point was for it to be easy to follow/educational . Getting these stuff to work for you i just 3 weeks is amazing btw, looking forward to seeing your games one day :D

(+2)

I love this project and its worked really well so far, except one bit, For some reason I keep coming up with the error

E 0:00:25:0486   Signal 'pressed' is already connected to given method '_on_Button_Pressed' in that object.
  <C Source>     core/object.cpp:1476 @ connect()
  <Stack Trace>  DIalogueManager.gd:127 @ UpdateUI()
                 DIalogueManager.gd:98 @ HandleNode()
                 DIalogueManager.gd:89 @ NextNode()
                 DIalogueManager.gd:142 @ _on_Button_Pressed()

Any help would be really appreciated, thnx

(+1)

BTW I fixed it, here's the fixed version for reference:

func UpdateUI():
if curent_node_id >= 0:
if current_node_affect > 0:
AffectRecognition()
dialoguePanel.show()
for x in dialogueButtons:
x.hide()
#disconnect buttons
if x.is_connected("pressed",self,"_on_Button_Pressed"):
x.disconnect("pressed",self,"_on_Button_Pressed")

Thankyou, I love your code :)

(1 edit) (+1)

Hey, I am glad it was of help to someone, will fix it when I get back from work , thanks for the input :D


Edit: Fixed , thanks for pointing that out , that was a silly mistake :D

Is fine, thanks for the code, its so adaptable for everything :) !!!

(+2)

This is really cool.  Thanks for sharing. I'll let you know if I use it in a project.