Theatre
by nnda
Theatre
Yet another (linear) dialogue system/addon/plugin for Godot. With features such as:
- ✍️ Human-readable syntax.
- ⚡ Simple setup. Get started in just 7 lines of codes!
- 😐 ....
- 📝 And 100% written in GDScript!
| Rendered | Written |
|
|
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}."
\(^ ▽ ^) |
var epic_dialogue := Dialogue.load('res://epic_dialogue.dlg')
@export var my_stage: TheatreStage
func _ready():
my_stage.start(epic_dialogue)
func _input(event):
if event.is_action_pressed('ui_accept'):
my_stage.progress()Important
This project is still in development and is subject to frequent breaking changes, and bugs. Check out the Issues page for known bugs & issues, and Common Troubleshooting documentation page if you encounter any issues.
Features
Dialogue Tags
Fine-tune your dialogue flow with {delay} and {speed}.
Godette:
"Hello!{delay = 0.7} Nice to meet you."Variables
Insert static or dynamic variables.
Dia:
"Great job, {player}. Just {item_left} to go."Dia:
"Your operating system is {User.os}.
It is currently {User.datetime}.
Your IP address is {User.ip_adress}"Set Properties
Manipulate properties & variables.
Ritsu:
UI.portrait = "ritsu_smile.png"
"Cheers!"Ritsu:
Global.friendship_lv += 1
"Yay!"Call Functions
Connect your story to the game with function calls.
{player}:
Player.heal(20)
"Thanks! That feels so much better."Call functions or set properties/variables at specific points in the Dialogue.
Dia:
"Let's brighten up the room a little...{d = 1.1}
Background.set_brightness(1.0)
# or
Background.brightness = 1.0
there we go."📚 More comprehensive Dialogue features documented here.
(Very) Quick Start
Write your epic Dialogue!
# Write it in a *.dlg file, and load it.
var epic_dialogue := Dialogue.load("res://epic_dialogue.dlg")
# Write it directly with triple quotation marks.
var epic_dialogue := Dialogue.new("""
Dia:
"Loading the Dialogue written in a *.dlg file
is much better for performance."
:
"It'll keep things clean and efficient."
:
"Plus, you’ll have syntax highlighting
for better readability."
""")Set the Stage! Add TheatreStage and DialogueLabel node to your scene. Structure your scene like the following:
Adjust the position and size of the PanelContainer to your liking.
Select the TheatreStage node, and reference the Label & DialogueLabel node to display your Dialogue. Adjust and configure your TheatreStage via the inspector. Alternatively, you can also set them in script:
| Inspector | GDScript |
|
|
@onready var my_stage: TheatreStage = $TheatreStage
func _ready():
my_stage.actor_label =\
$PanelContainer/VBoxContainer/Label
my_stage.dialogue_label =\
$PanelContainer/VBoxContainer/DialogueLabel
|
Reference the TheatreStage node in the script, and set up a way to progress your Dialogue with TheatreStage.progress().
func _input(event):
if event.is_action_pressed('ui_accept'):
my_stage.progress()And finally, start the TheatreStage with your epic_dialogue.
func _ready():
my_stage.start(epic_dialogue)📚 More detailed quick start tutorial here.
License
- Theatre is licensed under MIT.
- Theatre logo, created by nnda, is licensed under CC-BY 4.0.
- Class icons from @fontawesome (recolored), are licensed under CC-BY 4.0.
Download
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author