Core Architecture: Major System: Dialogues - UA-ScriptEase/scriptease GitHub Wiki

Dialogues allow users to create conversations in their games. The game may not support dialogues, in which case ScriptEase II should generate a dialogue in the game based on what was created in the editor. If they do support conversations, the dialogue editor should either stay unimplemented, or tie into the game to create those conversations. For example, we have dialogues working for Unity where they generate a GUI using custom scripts attached by ScriptEase II. We could implement them in Neverwinter Nights to work with the built in dialogue editor, but this would involve touching the byte code, which is terrifying.

Editing a Dialogue

To edit a dialogue in a game that has an existing translator, first create one in the resource panel by clicking the green plus button. You can then edit it by clicking the blue wrench beside the created game object.

Each node represents a dialogue line. Adding, deleting, and connecting nodes in the dialogue editor works the same as in the story graph, although PC lines can only be attached to NPC lines and vice versa. Nodes can have text, whether they are enabled by default, and attached audio and image if the translator supports them.

Adding Dialogues to Translators

To add dialogues support, a translator must implement the getDialogueType and getDialogueLineType in its GameModule implementation. These return the keyword string of a gametype that represents them. Optionally, you can implement getImageType and/or getAudioType to allow the user to add those to the dialogue lines.

Dialogue lines are represented at the ScriptEase code level by the DialogueLine class. Dialogue objects are just top level DialogueLines. All required information for code generation can be retrieved from the Dialogue Lines.