Text that is displayed to the player (for example, in a text box) is stored in a Text Database. All of the text in your game is stored in the Text Database, and each individual message is given a unique name. The Text Database is created by Story Machine and automatically updated as a file called “Text Database.txt” in your project directory.

The Text Database File

The contents of a Text Database file look like this:

StartButton=START
QuitButton=QUIT

# Quit confirmation dialog
ReallyQuit=Are you sure you want to quit?

# Scene 1 Dialog
Intro01=Harris Bullard was found dead in his study five days ago.\nNobody believes me, but I think he was murdered.
Intro02=I'm not leaving until I find out what happened.

Each line defines a message and a name to name that message. For example, the first line names the message “START” (a label to be put on a button in the main menu) with a name called StartButton. To display the word “START” in a text box in Story Machine, we assign the StartButton name to it.

Lines beginning with a # character are comments and will not be included in the database. Comments may also be added at the end of a line of text.

All text entries must fall on a single line. To add a line break within an individual message, use \n to specify a new line.

Editing the Text Database

You can add new text entries to you game by editing the Text Database.txt file directly. If Story Machine is running, it will automatically import your changes immediately.

Editing the Text Database

You can also add and edit text entries directly in Story Machine, via the Window > Text Database menu. The Text Database editor can help you add, remove, and organize text entries, as well as help you manage localization. Note that the Text Database is shared across the entire game, so if you edit an entry in one scene, those edits will be reflected in all other scenes.

Localization

The purpose of the Text Database is to make localization easy. To localize a game in Story Machine, simply translate the Text Database.txt file (or add appropriate entries via the Text Database editor), leaving the names intact and changing only the text messages. For example, a Japanese version of the example database above might look like this:

StartButton=スタート
QuitButton=終了

# Quit confirmation dialog
ReallyQuit=本当に終了しますか。

To test a different language in the Story Machine editor, select a database it from Run > Active Text Database menu. Strings that are not present in a localized Text Database will fall back on the default database.