A downloadable asset pack

Godot Dialogue Graph with Json!


This is a simple Dialogue System for your Godot 3.1 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. 

Disclaimer: I am familiar with good programming practices, that said I have some way to go and this was made in my first week of getting into Godot. If you have performance issues or have suggestions on how to improve performance feel free to comment. If you need help with setting it up in your own project or have unanswered questions about how it works feel free to comment as well.

And now to the point!

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:

There are instructions of how to Load a dialogue and start it inside the sole Script of the project, 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 [] table .
- 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


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


Tested And working with the lates 3.2 beta build.

Download

Download
JsonDialogue_v1.0.1.zip 13 kB

Comments

Log in with itch.io to leave a comment.

(+1)

This is so awesome. Thank you for putting this together!

One thing that I found is that if you change the root node type from Node2D to Control, then you can move the anchors to the center and just below the text box. Then when you resize your display window when the game is running, the dialogue UI isn't stuck in one spot.



I did a quick test and it seemed to work for me, but I don't know if changing the type will break something else down the line.

Thanks again!

Glad you liked it, there should be 0 problems moving from a Node2D to a control, or any other parent for that matter, as long as the children are there :)

(1 edit)

Ok great, thanks! 

Actually would you happen to know how to alter the way the text is displayed, so that instead of each text node showing all characters at once, they show one letter at a time(like a typing effect)? Looking at possible solutions and it seems that other people are using timers on the RichTextLabel nodes

Hey sorry for the late response, I had a lot of work and didn't check out itch all this time. Well yeah, you will have to make a timer of sorts that will add the letter to the TextLabel, you don't really need a TimerNode to do that, you can have an array with the final text, and another one with the current, then on the Update function you can do something of the sort:
var FullText = "Here is a green ballon!"
var CurrentText = ""

var i := 0
var timer := 0.0
_processdelta):
    timer += delta

    if timer >= 0.2:

        timer -= 0.2

        CurrentText += FullText[i]

        i += 1

And then you just update the Text Label with the current text, and check if the i reaches the last letter on the FullText so you can go on to the next DIalogue option.

(+2)

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 :) !!!

(+1)

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