github dialogic-godot/dialogic 1.0.1
Dialogic - 1.0

latest releases: 2.0-alpha-14, v1.5.1, 2.0-alpha-13...
3 years ago

Screenshot

Create dialogs, characters and scenes to display conversations in your Godot games.

⚙ Installation

⬇ Downloading the plugin

To install a Dialogic, download it as a ZIP archive. All releases are listed here: https://github.com/coppolaemilio/dialogic/releases. Then extract the ZIP archive and move the addons/ folder it contains into your project folder. Then, enable the plugin in project settings.

If you want to know more about installing plugins you can read the official documentation page.

You can also install Dialogic using the AssetLib tab in the editor, but the version here will not be the latest one available since it takes some time for it to be approved.

📦 Preparing the export

When you export a project using Dialogic, you need to add *.json, *.cfg on the Resources tab (see the image below). This allows Godot to pack the files from the /dialogic folder.

Screenshot

✅ Basic Usage

After installing the plugin, you will find a new Dialogic tab at the top, next to the Assets Lib. Clicking on it will display the Dialogic editor.

Using the buttons on the top left, you can create 4 types of objects:

  • Timelines: The actual dialog! Control characters, make them talk, change the background, ask questions, emit signals and more!
  • Characters: Each entry represents a different character. You can set a name, a description, a color, and set different images for expressions. When Dialogic finds the character name in a text, it will color it using the one you specified.
  • Definitions: These can be either a simple variable, or a glossary entry.
    • Variables: Can have a name and a string value. The plugin tries to convert the value to a number when doing comparisons in if branches. TO show a variable content in a dialog box, write [variable_name].
    • Glossary: Can have a name, a title, some text and some extra info. When the given name is found inside a dialog text, it will be colored and hovering the cursor over the name will display an infobox.
  • Themes: Control how the dialog box appears. There are many settings you can tweak to suit your need.

Dialogic is very simple to use, try it a bit and you will quickly understand how to master it.

📖 v1.0 Documentation

Note: ⚠️ This documentation is valid only for the v1.0 branch. ⚠️

The Dialogic class exposes methods allowing you to control the plugin:

🔶 start

start(
  timeline: String, 
  reset_saves: bool=true, 
  dialog_scene_path: String="res://addons/dialogic/Dialog.tscn", 
  debug_mode: bool=false
  )

Starts the dialog for the given timeline and returns a Dialog node. You must then add it manually to the scene to display the dialog.

Example:

var new_dialog = Dialogic.start('Your Timeline Name Here')
add_child(new_dialog)

This is exactly the same as using the editor: you can drag and drop the scene located at /addons/dialogic/Dialog.tscn and set the current timeline via the inspector.

  • @param timeline The timeline to load. You can provide the timeline name or the filename.
  • @param reset_saves True to reset dialogic saved data such as definitions.
  • @param dialog_scene_path If you made a custom Dialog scene or moved it from its default path, you can specify its new path here.
  • @param debug_mode Debug is disabled by default but can be enabled if needed.
  • @returns A Dialog node to be added into the scene tree.

🔶 start_from_save

start_from_save(
  initial_timeline: String, 
  dialog_scene_path: String="res://addons/dialogic/Dialog.tscn", 
  debug_mode: bool=false
  )

Same as the start method above, but using the last timeline saved.

🔶 get_default_definitions

get_default_definitions()

Gets default values for definitions.

  • @returns Dictionary in the format {'variables': [], 'glossary': []}

🔶 get_definitions

get_definitions()

Gets currently saved values for definitions.

  • @returns Dictionary in the format {'variables': [], 'glossary': []}

🔶 save_definitions

save_definitions()

Save current definitions to the filesystem. Definitions are automatically saved on timeline start/end.

  • @returns Error status, OK if all went well

🔶 reset_saves

reset_saves()

Resets data to default values. This is the same as calling start with reset_saves to true.

🔶 get_variable

get_variable(name: String)

Gets the value for the variable with the given name.

The returned value is a String but can be easily converted into a number using Godot built-in methods: is_valid_float and float().

  • @param name The name of the variable to find.
  • @returns The variable's value as string, or an empty string if not found.

🔶 set_variable

set_variable(name: String, value)

Sets the value for the variable with the given name.

The given value will be converted to string using the str() function.

  • @param name The name of the variable to edit.
  • @param value The value to set the variable to.
  • @returns The variable's value as string, or an empty string if not found.

🔶 get_glossary

get_glossary(name: String)

Gets the glossary data for the definition with the given name.

Returned format: { title': '', 'text' : '', 'extra': '' }

  • @param name The name of the glossary to find.
  • @returns The glossary data as a Dictionary. A structure with empty strings is returned if the glossary was not found.

🔶 set_glossary

set_glossary(name: String, title: String, text: String, extra: String)

Sets the data for the glossary of the given name.

Returned format: { title': '', 'text' : '', 'extra': '' }

  • @param name The name of the glossary to edit.
  • @param title The title to show in the information box.
  • @param text The text to show in the information box.
  • @param extra The extra information at the bottom of the box.

🔶 get_current_timeline

get_current_timeline()

Gets the currently saved timeline.

Timeline saves are set on timeline start, and cleared on end. This means you can keep track of timeline changes and detect when the dialog ends.

  • @returns The current timeline filename, or an empty string if none was saved.

❔ FAQ

🔷 How can I make a dialog show up in game?

There are two ways of doing this; using gdscript or the scene editor.

Using the Dialogic class you can add dialogs from code easily:

var new_dialog = Dialogic.start('Your Timeline Name Here')
add_child(new_dialog)

And using the editor, you can drag and drop the scene located at /addons/dialogic/Dialog.tscn and set the current timeline via the inspector.

🔷 Can I use Dialogic in one of my projects?

Yes, you can use Dialogic to make any kind of game (even commercial ones). The project is developed under the MIT License. Please remember to credit!

🔷 Why are you not using graph nodes?

When I started developing Dialogic I wanted to do it with graph nodes, but when I tried some of the existing solutions myself I found that they are not very useful for long conversations. Because of how the graph nodes are, the screen gets full of UI elements and it gets harder to follow. I also researched other tools for making Visual Novels (like TyranoBuilder and Visual Novel Maker) and they both work with a series of events flowing from top to bottom. I still haven't developed a complex game using both systems to tell which one is better but I don't want to break the conventions too much.
If you want to use graph based editors you can try Levraut's LE Dialogue Editor or EXP Godot Dialog System.

🔷 The plugin is cool! Why is it not shipped with Godot?

I see a lot of people saying that the plugin should come with Godot, but I believe this should stay as a plugin since most of the people making games won't be using it. I'm flattered by your comments but this will remain a plugin :)

🔷 Can I use C# with Dialogic?

You probably can, but I have no idea how to 😓. If you know your way around C# and Godot please let me know! #55

Don't miss a new dialogic release

NewReleases is sending notifications on new releases.