Dialink

An asset by eptwalabha
The page banner background of a mountain and forest
Dialink hero image

Quick Information

0 ratings
Dialink icon image
eptwalabha
Dialink

A custom node to handle dialogs in your game.The purpose of this new DialogSystem node isn't to display dialogs but to manage:- simple dialog text- multiple choices- conditional branching- characters / tags / signalsDialogs are loaded from a JSON file. The new DialogSystem node will take care of the rest.

Supported Engine Version
3.2
Version String
0.0.2
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL

Dialink :) README dialink icon

A Godot 3.2 plugin to easily handle dialogs in your game.

What this plugin isn't

  • This plugin is not a Nod2D nor a Control node that will display dialogs
  • This plugin is not (yet) a dialog editor

Then what is it?

This plugin is useful if your game needs to handle multiple dialogs with multiple choices and/or conditional branching (it also handles simple linear dialog as well ;) ).
Under the hood, the new DialogSystem node will take care of the logic of your dialogs.
Once everything's setup, you just have to ask the node what to display next.

Install

From github:

Download / clone the project somewhere on your computer

git clone [email protected]:Eptwalabha/godot-dialink.git

Then copy the addons/dialink directory into the addons directory of your project.
Finaly, activate the plugin Project>Project Settings>Plugins.

From the Godot asset library

The plugin was submitted to the asset library but has not yet been approved.
I'll update this section once the plugin's available on the plateform.

Quick tutorial

Add the new DialogSystem node to your scene:

Once the plugin is activated, you should see a new DialogSystem node in the node list with the following icon:
README dialink icon
Add it to your Scene (you can add more than one).

Setup the new node

In order to work, you need to provide to the new node with a JSON file. This file is where all your dialogs are defined. For the sake of this tutorial, we'll use the following JSON file (my-simple-dialog.json):

{
    "dialogs": {
        "hello-world": [
            {
                "text": "Hello my friend."
            },
            {
                "text": "How are you?",
                "choices": [
                    {
                        "text": "Fine, and you?",
                        "then": [
                            { "text": "Very well" }
                        ]
                    },
                    {
                        "text": "I'm not feeling very well today",
                        "then": [
                            { "text": "Too bad" }
                        ]
                    }
                ]
            }
        ]
    }
}

Seting up a new node is as simple as:

var dialogs = $DialogSystem
# setup the json file containing all your game dialogs
# (this can also be done directly from the editor's inspector)
dialogs.dialog_file = 'res://my-simple-dialog.json'
# let start the dialog named 'hello-world'
dialogs.start("hello-world")

That's it, you're all setup!

Let's chat a bit

If you want to know what dialog to display next, you just have to call the next() function:

var dialog_content = dialogs.next()

This will return a Dictionary containing the current line of dialog to display on screen.

{
    'text': "Hello my friend."
}

Calling next() again will return the choices you need to display to your player:

{
    'text': "How are you?",
    'choices': [
        {
            'id': 0,
            'text': "Fine, thank you"
        },
        {
            'id': 1,
            'text': "I'm not feeling very well today"
        }
    ]
}

Call the choice_next(id) function once your player has choosen what to answer:

# let's say the player picked the second choice with the `id` = 1
dialog_content = dialogs.choice_next(1)

Now dialog_content contains the next line of dialog to display:

{
    "text": "Too bad"
}

This is only a simple example, this node can do much much more

Licence

Dialink is provided under the MIT License.

A custom node to handle dialogs in your game.
The purpose of this new DialogSystem node isn't to display dialogs but to manage:
- simple dialog text
- multiple choices
- conditional branching
- characters / tags / signals

Dialogs are loaded from a JSON file. The new DialogSystem node will take care of the rest.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Dialink icon image
eptwalabha
Dialink

A custom node to handle dialogs in your game.The purpose of this new DialogSystem node isn't to display dialogs but to manage:- simple dialog text- multiple choices- conditional branching- characters / tags / signalsDialogs are loaded from a JSON file. The new DialogSystem node will take care of the rest.

Supported Engine Version
3.2
Version String
0.0.2
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers