nndda / Theatre

:performing_arts: Yet another Godot (linear) dialogue addon. Written in human-readable plain text. Compatible with Godot 4.3.
https://nndda.github.io/Theatre/
MIT License
28 stars 2 forks source link
dialogue-systems game-dev gdscript godot godot-addon godot-engine godot-plugin godot4

Theatre

Theatre logo

Godot 4.3 Build status Documentation

Yet another (linear) dialogue system/addon/plugin for Godot. With features such as:

[!IMPORTANT] This project is still in development, and is subject to frequent, breaking changes, and bugs.

Rendered Written
Theatre in action ``` Dia: "Welcome! {d=0.8}to the [fx1]Theatre[/fx1]! d=0.9 yet another text-based dialogue addon d=0.3 developed for Godot {gd_ver}." \(^ ▽ ^) ```

Features

Dialogue tags

Fine-tune your dialogue flow with {delay} and {speed}.

Godette:
    "Hello!{delay = 0.7} Nice to meet you."
Godette:
    "Hello!
        delay=0.7
    Nice to meet you."

Function calls

Connect your story to the game with function calls.

{player_name}:
    "Thanks! That feels so much better."

    Player.heal(20)
Ritsu:
    "Cheers!"

    Portrait.set("ritsu_smile.png")

Call functions only at specific points in the Dialogue.

Dia:
    "Let's brighten up the room a little...{d = 1.1}
    {0}
    there we go."

# Call this function using its index: {0}
    Background.set_brightness(1.0)

More comprehensive Dialogue features documented here.

Quick Start

Write your epic Dialogue!

# write it directly with triple quotation marks
var epic_dialogue = Dialogue.new("""

Dia:
    "For performance reason, I'd recommend
    using the method below instead."

""")

# alternatively, write it in a *.dlg file, and load it
var epic_dialogue = Dialogue.load("res://epic_dialogue.dlg")

Set the Stage! Add Stage and DialogueLabel node to your scene. Structure your scene like the following:

A scene tree, with Stage and PanelContainer > VBoxContainer > Label, DialogueLabel


Adjust the position and size of the PanelContainer to your liking.

Select the Stage node, and reference the Label & DialogueLabel node to display your Dialogue. Adjust and configure your Stage via the inspector. Alternatively, you can also set them in script:

Inspector GDScript
Inspector dock's representation of Stage's properties. ```gdscript @onready var my_stage : Stage = $Stage func _ready(): my_stage.actor_label =\ $PanelContainer/VBoxContainer/Label my_stage.dialogue_label =\ $PanelContainer/VBoxContainer/DialogueLabel my_stage.allow_skip = true my_stage.allow_cancel = true my_stage.allow_func = true my_stage.speed_scale = 1.0 ```

Reference the Stage node in the script, and set up a way to progress your Dialogue with Stage.progress().

func _input(event):
    if event.is_action_pressed("ui_accept"):
        my_stage.progress()

And finally, start the Stage with your epic_dialogue.

func _ready():
    my_stage.start(epic_dialogue)

More detailed quick start tutorial here.

License