Dialogue Trees and Logic
The script concept can also be applied to dialogues. Drafft lets you design a dialogue tree (or a general-purpose graph) and optionally attach scripts to nodes.
A dialogue tree consists of interconnected nodes. Drafft currently provides these default node types:
Startnode is a1 Outputnode. Its intended usage is for the developer to identify where to position the dialogue when starting it.Scriptnode is a1 Input -> 1 Outputnode that carries an associated script. This is intended for running game logic or linear dialogue.Choicenode is a1 Input -> n Outputsnode intended for branching logic.Conditionnode is a boolean branch node (True/False) based on an expression.Switchnode branches to multiple outputs based on matching case values.Eventnode triggers a function name with arguments before continuing the flow.Endnode is a1 Input onlynode intended to provide a flag on where a branch hits a dead end.- Similarly, the
Returnnode is a1 Input onlynode intended to provide a flag on where a branch hits a dead end and should return to the choice node, or any other custom logic. This is to avoid populating the graph with lots of arrows going back. Jumpnode is a1 Input -> 1 Outputnode that allows you to jump to another node in the tree. This is useful for reusing dialogue sections or creating loops without duplicating content.Notesnode is intended for adding comments or documentation within your dialogue tree. Notes nodes are ignored during execution and serve only as annotations for you or your team.
Even though the script node is intended to provide scripting logic, any node can have a linked script.
Also, any node can be customized to have a different number of inputs and outputs, but the ones listed above are the most commonly used and available by default.
Go to the Dialogues section and load a dialogue from your sample project. Click each node to inspect linked scripts and experiment with editing, moving, and reconnecting nodes.
With the document locked for edits, select the first node, the green starting node, and add a few lines at the start:
::Mother:: I saw Kenji walking all day looking for something.
::Mother:: Maybe he has a new job.
::Mother:: [Happy] Finally!
Detecting Actors
To update the Actor database, click the Auto Detect Actors button in the toolbar. You should see a message: "Added 1 Actors: Mother".
Generating Voice Over Tags
Using the Drafft Scripting Syntax (UAF), you can automatically generate a tag for each dialogue line. This allows you to link audio files to each line without needing a metadata database, simplifying the editing process. Tags follow this format: [#speechTag]::Actor::Actor Line [expression].
Tags are generated using a combination of the script alias and a short UUID. Click the "Generate tags for current script" button. A success message should appear.
Reopen the node script to see the changes.
Previewing Dialogue
Drafft includes a basic dialogue and script player. Select the dialogue and click the Play Dialogue button.
Use this screen to navigate and debug the dialogue logic.
For up-to-date node details, see Dialogue Tree Editor Reference.
The Drafft Scripting Syntax enhances the previewing process by ignoring non-dialogue elements and displaying actor portraits and emotions. The "speech only" button advances to ::ActorTag:: lines.
Click on the text box to advance to the next line.