How it works
How logic runs
Lines, conditions and outcomes: the order logic runs in, what changes what runs next, where it lives.
Everything that happens in an adventure, from going to a scene to changing a tag, is done by logic. Logic is made of lines, and every line has the same two parts:
- Conditions: when the line runs. A line with no conditions always runs.
- Outcomes: what the line does, one after another.
You write lines in the logic editor: a line is the Result window, and each condition or outcome is picked one column at a time.
A list of lines runs top to bottom
Most logic is a list of lines. When it runs:
- The first line's conditions are checked. If they hold, its outcomes run, in order. If they don't, the line is skipped.
- Then the next line, and so on to the end. Every line gets its turn: the list doesn't stop at the first line whose conditions hold.
Each line is checked when its turn comes, so a line sees what the lines above it changed. That's why Remember what the player did can give a word its usual text in one line, then change it in the next.
Several conditions
Each condition after the first says how it joins the others: AND (both must hold) or OR (either may). AND binds first: "A AND B OR C" means "A and B both hold, or C holds".
What changes what runs next
Some outcomes change where the player is, and with it what logic runs:
| Outcome | What happens to the rest of the list |
|---|---|
| Navigation › Start Scene | The player goes to the scene. Lines and outcomes after it don't run: the logic editor shows them in another color |
| Actions › End Adventure | Play ends and the title screen comes back |
| Go To Text, Go To Choices, Go To Page, Go To Input (in a conversation) | They choose the next card, and the change happens once the logic has finished. If several run, the last one wins |
| Actions › Stop Logic Thread | Stops the rest of the logic that's running |
Some outcomes make the logic wait without stopping the game, such as Wait (Milliseconds) and Wait Until.
Where logic lives
| Logic | Runs when |
|---|---|
| The Start Adventure card (Adventure start logic) | A new playthrough starts |
| A scene's Start Scene card | The player goes to the scene with Start Scene |
| An event's Start Event card | The event starts |
| A line's On Tap Logic | The player clicks to go on from the line |
| A choice's Prerequisite and Outcomes | The Prerequisite decides whether the choice shows; the Outcomes run when it's picked |
| Text logic (Text that reads tags) | The line with it is shown |
| A logic block's Logic To Trigger | Other logic runs it with Navigation › Run Logic |
| A trigger's logic | What the trigger watches for happens (below) |
A logic block runs in place: its lines run there and then, before the rest of the line that ran it.
Triggers
A trigger runs its logic when something happens in the game, wherever the player is. Drag Trigger from the Adventure Builder's Add panel to make one. Its Trigger type is Logic event, such as a tag changing (Property Changes), a timer ending or the player going into a scene, or On Key Action, a key the player presses, set up on the Key Map page.
A trigger on the adventure's view watches all the time. A trigger inside a scene watches only while that scene is the current one. A trigger fires at once, in the middle of the logic that set it off.