How to Edit Dialogue Databases

The Dialogue System provides several ways to create dialogue databases. If you don't want to use one of the Dialogue Database Converters to import from an external authoring tool, you can use the powerful, built-in Dialogue Editor.

Whichever method you choose, follow the tips below when creating your content.


General Tips

In the Dialogue System and Chat Mapper, space characters and hyphens get replaced with underscores in Lua variables. This is described in more detail in the section Important Note About Table Indices. For example, My Item becomes My_Item when referencing the Item[] table. For example:

Item["My_Item"].Cost = 50

If you enter Lua code directly into a dialogue entry's Conditions or Script fields, rather than using the point-and-click Lua Wizards, remember to use underscores in table indices.

Every asset in a dialogue database should have a unique ID. If you end up with ID conflicts (for example, if you merge in another database without specifying to assign unique IDs), you can use the Unique ID Tool to correct the conflicts.


Actor Content

At a minimum, define at least two actors, usually the Player and an NPC. If you create a conversation in the Dialogue Editor and only have one actor, the editor will automatically create a generic NPC actor to fill out the participants.

The Dialogue System will try to match the participants' GameObject names with their actor names in the dialogue database. It's simplest to keep these the same. Otherwise you can use an Override Actor Name component on your GameObject to tie it to a specific actor in the dialogue database.


Variable Content

The Dialogue System will define these variables:

Variable Description
Alert Set this to display a gameplay alert message
Actor The name of the actor in the current conversation
Conversant The name of the conversant in the current conversation

Alert Variable

During a conversation, you can assign text to the Alert variable. At the end of the conversation, the dialogue UI will display that text. You can use this to give the player information. For example, to let the player know that they just acquired a new quest, add a Script such as:

Variable["Alert"] = "New Quest: Kill 5 Rats"

Actor and Conversant Variables

In the Dialogue System, you can configure a conversation to trigger for any character, not just the actor defined in your Chat Mapper project. The classic example is a generic shopkeeper conversation that you can re-use for any shopkeeper in any village in your game world.

Read the value of Variable["Actor"] to get the name of the current actor and Variable["Conversant"] to get the name of the current conversant.


Conversation Content

The first dialogue entry of every conversation should be START. This is the default. The Dialogue System will log a warning if it encounters a conversation that doesn't have a START entry.

You can define a cutscene sequence in a field named Sequence. If this field is blank, the entry will use the default sequence define in the Dialogue Manager's display settings. For more information, see Sequences.

You can also define an additional sequence named Response Menu Sequence that will play in the background after the dialogue entry has been spoken and the response menu is being shown. If the player makes a selection in the response menu while the response menu sequence is playing, the response menu sequence will end and the next dialogue entry's sequence will begin on the same frame. If both sequences include Camera() commands, you may need to add a final required Camera() command that runs a short time after the end. For example, adding the following command to the end of Response Menu Sequence will guarantee that it ends with a closeup on Private Hart:

required Camera(Closeup,Private Hart,0.1)@99999

Alternatively, you could include a delay in the next dialogue entry's sequence to ensure that it runs after the response menu sequence is completely stopped (e.g,. Camera(Closeup,speaker,0.1)).

The Dialogue System natively supports language localization. To set up localization, see Localization.

In your dialogue text, you can use a number of special Dialogue Markup Tags.


<< Dialogue Database | Dialogue Markup Tags >>