Skip to reading
The Dialogue Designer

22. Add a simple variable condition

Edition 0.86.3.4

Build branching conversations with choices, conditions, actions, timed responses, voices, portraits and custom windows.

Download PDFView illustrations

Select the dialogue record, open the Inspector’s Raw JSON (Advanced) tab and locate the desired response inside its Choice node’s options array. Add a condition object to that response.

Code example
{
  "id": "ask_key",
  "text": "May I borrow the archive key?",
  "next": "give_key",
  "enabled": true,
  "repeatable": false,
  "condition": {
    "variable": "archive_key_given",
    "equals": false
  }
}

Figure 17. A condition belongs to one option. Keep the surrounding dialogue and nodes intact when editing the record.

Apply the JSON changes, return to the graph and save the project. Do not paste this small object over the entire dialogue record: it is one entry inside topics → options.

Use the Boolean false, without quotation marks. The native check compares the variable value with equals. It does not evaluate a script expression, a greater-than test or an arbitrary natural-language condition.

Page 26 of 77Permalink
Go to page