Description
Changelog
Reviews (0)

DDSL is a dialogue manager plugin for Godot 4.6+, primarily focusing on snippet-like conversations and integration with the GDScript system

Source code and latest versions on Github

Basic usage

Dialogue scripts can be created anywhere within the game's project folder. For this, create a text file, and end it with .ddsl, then fill it with the dialogue, for example

edwin = ^"res://sprites/portraits/edwin.png"
edwin: "Hello, little rover. Are you lost?" { autoconfirm = true }
<- option
- "Yes"
    edwin: "Oh, well, we can't have that here. Come, follow me"
    Cutscenes.trigger("edwinTavernWalk")
- "No"
    edwin: "Are you sure? Well, then... Hope this helps you in your journey"
    Inventory.add("potion/health2")
    edwin: "If you need me, you can find me in my tavern"
- "Kill all humans" ? Inventory.has("weapon/knife") # this branch is not created unless the player has a knife
    edwin: "Why, why, so aggressive! And here I thought you were a friendly little roomba!"
    edwin: "I say, you shouldn't have this"
    Inventory.remove("weapon/knife")
    edwin: "Are you even old enough to have a knife? When were you born?"
    age <- number(1980, 10000)
    ? Time.get_time_dict_from_system()["year"] < age
        edwin: "A time traveller too? I find it hard to believe."
    edwin: "I think you should come with me"
    Cutscenes.trigger("edwinTavernWalk")

Information about the domain-specific language can be found on the wiki

Note that the language focuses on programmer-styled dialogue description rather than a writer-style one. It is also not intended for creating monolithic dialogues carrying the entire story(i.e. it is not made for visual novels)

Once a dialogue file is created, it can be executed in-game in two primary ways

# Note that there is no default dialogue box provided so Dialogue will error during execution if one is not explicitly set
Dialog.setBox(someDialogBoxScene)

# The main way the dialogues can interact with GDScript is via explicit object bindings
# Global bindings are permanent between all dialogue calls
Dialog.bindGlobal(InventoryManager, "Inventory")

# This will start the dialogue without blocking current execution, executing _dialog_callback after the dialogue finishes
Dialog.start("res://path/to/dialog.ddsl", null, _dialog_callback)

# Current execution will be paused for the duration of the dialogue
# `value` will be assigned to a dictionary containing all variables created during script execution
var vars = await Dialog.start("res://path/to/dialog.ddsl")

Full usage instructions can be found in the wiki

Features

  • Integration with GDScript, including native calls to built-in methods
  • Operator overloading possible within the DSL
  • Unboundedly nested branching options without forced use of goto statements

Documentation

The documentation for the plugin is hosted on the Github Wiki of the repository

Changelog for version 1.2.1

No changelog provided for this version.

Reviews

DDSL has no reviews yet.

Login to write a review.

Consider supporting the creators!

If you enjoyed this asset consider supporting its creator. Follow the link below.