Dialogue
Lines of talk shown one after another in a dialogue box, with choices that branch it, flags that remember what was said, and no code. Interact (E, Enter, the gamepad’s Y) finishes the line being typed, then moves on. Rows starting with “>” are choices offered under the line before them, picked with the arrow keys, D-pad, number keys or mouse and Interact, and they can go to other parts of the lines; rows can set flags and be said only when a flag is set (see Lines). A line starting with a Speaker’s name (“Guide: Hello!”) is said by them, and the rest by the Speaker on this entity, if it has one: a DialogueBox shows their name and portrait. The Box is shown while talking and hidden otherwise; put a Typewriter next to its text to type the lines out. Needs a collider, usually a trigger, unless it starts as the scene starts. Where it’s got to is saved with the scene, so a rewind goes back into the middle of a talk.
Requires: Collider (usually a trigger; none when it starts with the scene, or a hotspot starts it)
Works with: Speaker (for a name and portrait over its lines); Stage (a visual novel Stage its lines direct with [show], [hide], [move] and [background])
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
lines: lines of text: an array of strings, or one string with line breaks = [“Hello!”]. What’s said, one line per row. A row starting with “>” is a choice offered under the line before it, and one ending in “-> Name” goes to the row “# Name” when it’s picked (“> Buy a sword -> Shop”); a choice without one goes on after the choices. “# Name” starts a part that’s only reached that way: the lines before it end there. A row “-> Name” goes there by itself, and “-> End” ends. A row can start with tags in square brackets: “[if Flag]” or “[if not Flag]” says it (offers the choice, follows the go-to) only when the flag is set or isn’t; “[set Flag]” and “[clear Flag]” set and clear one, and “[send Message]” sends a message, when the line is said or the choice picked. A row of tags alone just does them. Flags are kept in the game’s save data, so they’re still set next time. “Name: …” is said by the Speaker called Name, and “Name (happy): …” with that expression (see Expression). Modules add tags of their own: a visual novel stage’s “[show Ava left happy]”, “[hide Ava]”, “[move Ava right]” and “[background Park fade]”. Start a row with “\” to say it as it is, “>”, “#”, “[” and all. (Lines of talk, one a row: “Name: …” said by a speaker, “> …” a choice (“-> Part” at its end goes there), “# Part” starts a part, “-> Part” or “-> End” goes there, and tags first: [if Flag], [if not Flag], [set Flag], [clear Flag], [send Message]. The Dialogue Editor (Entity > Edit Dialogue) builds each line from lists.) (Field: its own editor: Dialogue Lines.)box: text = “Dialogue Box”. The name of the dialogue box entity; its Text (or the first one inside it) shows the lines, and its DialogueBox, if it has one, who’s saying them. (Names an entity.) (Field: an entity’s name.)start: one of Interact, Touch, SceneStart = “Interact”. Whether the talk starts when the player presses Interact by it, or as soon as they touch it. (Field: one of its values.)layers: text = “Player”. The collision layers that can start it, e.g. “Player”. Empty lets anything with a Body. (Names collision layers: their names, separated by commas.) (Field: a name.)once: true or false = false. Only ever say it once, e.g. for a cutscene. (Field: on or off.)pauseGame: true or false = true. Stop game time while talking, so nothing moves (or gets hurt) until it’s over. (Field: on or off.)pauses: text = null. What it stops while it’s being said: empty stops the whole game; an entity’s name stops only it and everything inside it, as a PauseGroup does (the enemies, a minigame), while the rest runs on. (Only used when pauseGame is on.) (Names an entity.) (Field: an entity’s name.)message: text = null. A message sent with Game.Send when the last line is done, e.g. “TalkedToKing”. (Names a message.) (Field: a name.)prompt: text = null. The name of an entity to show only while it can be started, e.g. a “Press E” hint above someone. It’s hidden the rest of the time. (Names an entity.) (Field: an entity’s name.)
isTalking: true or false = false. True while it’s being said. Saved with the scene (with Line), so a rewind or a saved game goes back into the talk; set it in the Inspector to start the game partway through one. (Not sent in a network game: each machine has its own.) (Field: on or off.)line: a whole number = 0. The row showing, from 0, while talking. (Not sent in a network game: each machine has its own.) (Field: a number.)isDone: true or false = false. True once it has been said all the way through (or stopped: see CutShort). (Not sent in a network game: each machine has its own.) (Field: on or off.)
Actions
Section titled “Actions”What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).
Start. Starts saying it now, as if the player had pressed Interact beside it: a cutscene, a boss appearing. Not while another dialogue is being said.Stop. Ends it now if it’s being said, even partway through a line, as saying its last line would: the box hides, the game moves again, its Message is sent and Finished is raised (with CutShort true). The rows it didn’t reach aren’t said and their tags aren’t done: a “Skip” button on a cutscene or a tour.
While the game runs
Section titled “While the game runs”Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.
said: text. The line showing as it’s said, without the speaker’s name it starts with; null while only choices show.speaker: an entity with a Speaker: its name, id or path. Who is saying the line showing, or null when no Speaker is (a sign, say).expression: text. The expression the line showing is said with, from its speaker’s name (“Ava (happy): …” says it happy), or null: a visual novel’s stage shows the character that way.choices: lines of text: an array of strings, or one string with line breaks. The choices offered under the line showing, empty when there are none.picked: a whole number. The choice the arrow keys or mouse are on, from 0, while there are Choices; Interact picks it.cutShort: true or false. True when it was stopped before its end (by its Stop action or a script’s Game.EndDialogue) rather than said to the end: read it in a Finished handler to tell a skipped cutscene from one watched through. False again as it starts.startsWithScene: true or false. True for one that starts by itself as the scene starts, which needs no collider.needsNoCollider: true or false. True for one that needs no collider: it starts with the scene, or something else on its entity starts it (an adventure’s hotspot that talks when it’s used).
Scripts use it as Dialogue: its methods, events and values that aren’t saved with the scene.