A trigger is a simple rule for your story: when something happens (an event), if certain things are true (conditions), do these things (actions). With triggers you can add game rules on top of AI narration, like a /bribe command that only works when the player has enough gold, a storm that grows every few turns, or a confession scene once affection is high enough.
How A Trigger Works
Every trigger reads like a sentence in three parts.
When Triggers Are Checked
- When the player sends a message or a /command: triggers with a Player inputs custom command, Turn Count or Variable status event, all before the narrator writes that turn.
- When the player picks an option in one of your selection menus: triggers with a User makes menu selection or Variable status event.
- Once at the start of a new play-through: triggers with a Game Initialization event.
- The moment a Set Variable action changes a value: triggers whose Variable status event watches that variable.
- After the narration: triggers that hold a Check Story Context action.
- Whenever something runs a trigger by name: a Run/Modify Trigger action, a Story Progression node, an In-Game Images/Video answer or a Check Story Context answer. Its events are skipped, but its conditions still have to pass.
Triggers are checked top to bottom in the order of your Triggers list, and each one finishes before the next starts. Folders only keep the list tidy; they don’t change anything in play.
Variables
A variable is a named value your story remembers while it’s played, like gold, affection or whether the player has found the key. Triggers check variables in their conditions and change them with actions. Create one in the editor’s Variables section with New Variable: pick a name, a type and a starting value. Every play-through starts from that value and keeps its own copy.
| Type | What it’s for |
|---|---|
| INT · Whole numbers | Counting things like gold, affection or days left. Compare it, do math with it, show it in text. |
| FLOAT · Decimal numbers | Like INT, but with decimals, such as 0.5 or 72.5. |
| BOOL · True or false | An on/off switch, such as has_key or met_mina. |
| STRING · Text value | A bit of text, like a nickname or a clue, to drop into your texts. It can’t be compared. |
| IMAGE · Uploaded image | A JPG, PNG, WEBP or AVIF to show with Show Media to player, In-Game Images/Video or an image menu. |
| VIDEO · Uploaded MP4 video | An MP4 clip that loops with sound when it’s shown. |
| MENU · Player choice menu | A popup with up to 20 choices, opened by Show Selection Menu to player. |
| COMMAND · Slash command | A /command players can type, like /hint, with a short description. |
| OBJECTIVE · Title + optional subtext | One quest goal, like Find the Lighthouse Keeper. |
| LIST · Objective or character list | A quest log of objectives, or a list of characters like Your Party. Up to 50 items. |
Type a variable’s name in double curly braces, like {{gold}}, in any text box (an Inject instruction, a Story/System text, a failure screen) and Mana fills in its current value when the action runs. Names use letters, numbers, _ and -, and start with a letter or _.
Build Your First Trigger
- Open the editorIn your story setup, open the Mana Game Engine tab, switch it to Enabled and press Create New, or Edit Triggers once something is saved. See Turning It On.
- Make your variablesUse the section menu at the top of the editor’s left panel to switch to Variables, then press New Variable. For the example above, make an INT named gold that starts at 100 and a COMMAND named bribe.
- Create the triggerSwitch to Triggers and press New Trigger. It starts with a name like Untitled Trigger 1; press the pen next to the name to rename it.
- Add an eventPress Add New Event and pick Player inputs custom command, then choose /bribe. Every Add menu has a Search... box at the top.
- Add a condition (optional)Press Add New Condition, pick Variable check and set it to gold, greater than or equal to, 50.
- Add actionsPress Add New Action for the first one, then Add Another Action for each one after it. Drag a row by its grip to change the order.
- SavePress Save at the top of the editor.
The Master List
Every event, condition and action in the editor’s Add menus, each with an example.
Events
Events decide when a trigger fires. If a trigger has several events, any one of them is enough, and the trigger still runs only once. Events are optional: a trigger without one runs only when something runs it by name.
Game Initialization
EventRuns once at the very start of a new play-through, so you can set the stage: hand out starting gold, add the first quest, open a menu, or tell the narrator how the story begins.
Pick game initialization to run it as soon as a new game loads, before the player’s first turn. Pick after player finish reading starting prompt to wait until the player has clicked past the last page of your opening; that choice is for visual stories only.
If the trigger has an Inject command to narration LLM action, the first narration starts right away and follows your instruction, without the player typing anything. A play-through that already has turns won’t run a Game Initialization trigger you add later.
Turn Count
EventFires on a steady rhythm as the story goes on. Every 1 runs on every turn; Every 5 runs on turns 5, 10, 15 and so on. A turn is one player message plus the narrator’s reply.
It’s checked when the player sends a message, before the narrator writes, so an Inject command to narration LLM in the same trigger shapes that very turn. It isn’t checked when the player picks from a menu.
Instead of a number you can type a whole-number variable like {{storm_every}} (it must start above 0), so other triggers can speed the rhythm up or slow it down. Great for weather that worsens, a hunger meter or a reminder every few turns.
Player inputs custom command
EventGives players their own slash commands, like /hint, /rest or /quests. When a player types / in the message box, your commands show up with their descriptions. Picking one adds it to the message as a badge, and the trigger fires when they send it.
Choose prohibit to make the command the whole turn: the text box locks until the player removes the badge, and only your trigger’s instructions reach the narrator. Choose allow to let the player type their own action next to the command, and both are sent together.
Create the command first as a COMMAND variable: a name of up to 12 letters, dashes or underscores, plus a short description. A few names Mana already uses, like /summary and /context, aren’t available. The first time someone plays, a Story Commands popup lists all your commands.
Variable status
EventFires when one of your number or true/false variables reaches a value you choose, like affection reaching 10 or has_key turning true. Use it for milestones: unlock a scene, end a chapter, or play a confession once a meter fills up.
It’s checked whenever the player sends a message or picks from a menu (and along with your Game Initialization triggers at the start), and also the moment a Set Variable action changes that variable. The value can be a number, true or false, or math with other variables, such as {{max_health}} / 2.
It keeps firing on every check for as long as the comparison is true. For a one-time moment, end the trigger with Run/Modify Trigger set to Disable on the same trigger, as in the example.
Conditions
Conditions decide whether the actions may run once the trigger fires. Every condition must pass; they’re checked top to bottom, and the first one that fails stops the trigger before any action runs. A trigger with no conditions always runs.
Variable check
ConditionA gate for the trigger’s actions: a number or true/false variable has to compare the way you set, or nothing happens. Use it so a /bribe command only works when the player has enough gold, or a reunion scene only plays if the player found the locket.
It offers the same comparisons as Variable status, and the value can use math like {{price}} * 2. It reads the value at the moment the trigger runs, including changes other triggers made a moment earlier in the same turn.
You’ll also find it in the If part of the If / Then and If / Then / Else actions, to check a value partway through a trigger.
Actions
Actions are what the trigger does. They run one at a time, top to bottom, in the order shown (Action 1, Action 2...). If one action can’t run (say, the background it uses is no longer available), it’s skipped and the rest still run. Branching actions like Use RNG and If / Then hold their own lists of actions.
Actions: Story & Narration
Inject command to narration LLM
ActionSends a hidden instruction to the AI narrator, so you can steer what happens next: a storm rolls in, a rival shows up, the hero’s plan fails. The player never sees the instruction, only the narration it produces. If it clashes with what the player typed, your instruction wins.
When the trigger ran from the player’s turn, the instruction joins that turn’s narration; with a prohibit command it replaces the player’s input entirely. When it ran from Game Initialization or a menu choice, it starts a new narration right away. Instructions from triggers that run after the narration go out with the player’s next turn.
It counts for that one narration only and isn’t saved into the story. Several Inject actions in one check are combined, in order. Use {{name}} to drop in a variable’s current value, and keep it short and clear.
Show or inject Story/System texts
ActionPuts your own pre-written text into the story word for word, with no AI writing involved. You choose whether the player sees it, and whether it’s saved to story context so the narrator remembers it in later turns. Use it for chapter cards, clues, letters and notes, or quiet facts the narrator should know.
show + save: the player reads it and the narrator remembers it. show + don’t save: the player reads it but the narrator never sees it, good for tips and hints. don’t show: the narrator remembers it, but it stays out of the live story. When the same turn also gets a new narration, your text appears after it.
require makes the trigger’s remaining actions wait until the player has clicked through the text (visual stories only). Texts can be up to 5,000 characters, {{name}} fills in variable values, and in visual stories they can use the same character and background tags as your Starting Prompt.
Modify Custom Instructions
ActionChanges your story’s Custom Instructions, the standing rules the narrator reads every turn, while the story is being played. Add a rule, remove one or swap one for another, so the narrator’s behavior changes as the story moves on: tougher fights after the player picks Hard, a curse that makes a character speak only in riddles, a darker tone for the final act.
Add puts your text on its own line at the start or the end. Delete and Replace work on all of the instructions or on specific text, which has to match word for word. The change lasts for the rest of that play-through; your original story isn’t edited.
Watch out for repeats: an Add in a trigger that fires every turn adds the line again every turn.
Check Story Context
ActionLets your story notice what actually happened. After the turn’s narration finishes, the player’s decision AI (Jev by default) reads the last 3 turns and answers your questions, like “Has the player found the lighthouse keeper?” Each answer can run up to 5 of your triggers. Press the question count in the row to open the question editor.
Questions can be Yes / No (Yes when the AI is at least as sure as your setting, 50% by default), Multiple choice (2 to 20 options) or Score (2 to 10 levels, lowest first). You can add up to 50. Once a Yes / No question answers Yes, it isn’t asked again in that play-through. In the example, question 1 asks whether the player has found the hidden key (Yes runs a Key Found trigger), and question 2 asks who they suspect, with Butler and Maid each running their own trigger.
Only one per story. A trigger that holds it runs as a whole after the narration, and anything its answers inject goes out with the player’s next turn. Each check is an AI call that costs the player some coins (your In-Game Images/Video questions ride along in the same call), and it’s skipped if they can’t cover it. When the trigger’s conditions don’t pass, its questions aren’t asked that turn.
Actions: Variables & Lists
Set Variable
ActionChanges one of your variables, like gold, affection or a quest flag. The new value sticks for the rest of that play-through, so later triggers, conditions and texts all see it.
For numbers, type math using other variables: {{gold}}+10 adds 10, {{gold}}-10 takes 10 away, and ({{hp}}*2)/3 works too. Whole-number variables are rounded. For a BOOL, type true or false. For a STRING, type any text; {{name}} inside it is filled in.
Only INT, FLOAT, BOOL and STRING variables can be set here; lists change with Update List. When the value changes, triggers with a Variable status event watching it are checked straight away.
Update List
ActionChanges what’s on one of your lists. On an Objectives list you can add a new objective, which becomes a current goal, or mark one as completed or as failed. On a Characters list you can add or remove one of your story’s characters.
The change happens quietly, apart from a small “Objective Updated” badge the player sees for a few seconds when an objective changes. Add Show List after it if you want the player to see the whole list.
When marking, you can pick Last added Objective to mean whichever objective was added to that list most recently. A list holds up to 50 items.
Show List
ActionPops one of your lists up on the player’s screen, like a quest log. An Objectives list shows current goals first, then finished ones marked Completed or Failed. A Characters list shows its own title and the characters on it. The player closes it when they’re done reading.
It shows the list as it is at that moment, so put Show List after any Update List in the same trigger.
Tip: pair it with a /quests command set to prohibit and nothing else in the trigger. The player can then check the list any time without starting a new turn, because nothing is sent to the narrator.
Actions: Menus & Media
Show Media to player
ActionPuts one of your uploaded images or videos on the stage and adds it to the Story Media section of the player’s Gallery, where they can see it again later. Choose behind the story text to keep the text on top, or and hide the story text to also hide the text box until the player’s next command, so nothing covers the picture. Videos loop with sound, and you can set their volume from 0 to 300%.
Upload the picture or clip first as an IMAGE or VIDEO variable. It stays on the stage until the player closes it, even while new narration comes in. Visual stories only.
Want media to appear by itself when the story reaches a moment? Use In-Game Images / Video instead.
Actions: Characters & Scene
Move Character to Active/Inactive Roster
ActionBrings a character into the story or benches them. Active characters are the ones the narrator can use; an Inactive (benched) character stays out of the story until another trigger moves them back. It’s the same switch as Move to Active / Move to Inactive in Character Management.
The change happens before that turn’s narration is written, so a character you activate can show up in that very turn. The editor’s Characters section shows who is active and who is inactive at the start. The change lasts for the rest of that play-through.
Use background
ActionPuts the background you choose on the scene instead of leaving it to the narrator. Next turn makes the narration that’s about to be written use that background. Immediately swaps the background the player is looking at right now.
Add also puts it on your story’s list of backgrounds, so the narrator knows the place and can return to it later. Don’t Add shows it as a one-off. Day or night art follows the story’s own time of day. Visual stories only.
Change story era
ActionSwitches the era of the player’s play-through between Fantasy, Modern and Futuristic. When the narrator brings in a new place or character that isn’t in your story yet, Mana picks a matching one from its library, and the era decides what fits.
Use it when the story jumps through time or between worlds, like stepping through a portal from a medieval kingdom into a neon city. Backgrounds and characters already in the story stay. The change lasts for the rest of that play-through; your original story never changes.
Actions: Logic & Flow
Use RNG
ActionRolls a random whole number and picks a branch based on the result, so the same moment can play out differently every time. Set the range (1 to 100 by default), then give each branch a rule like is less than 30 or is between 30 and 70, and its own actions. Press + Add RNG Branch for more branches.
Branches can’t overlap: if two of them cover the same number, the editor points it out and won’t save until you fix it. Both ends of the range can be rolled. If no branch matches, nothing inside runs and the trigger moves on.
Every new turn rolls again, but Redo replays the result the player already got. A branch can hold an If / Then or If / Then / Else, but not another Use RNG.
If / Then
ActionMakes part of a trigger depend on a check, without needing a separate trigger. Put one or more Variable checks in the If box and actions in the Then box. The Then actions run only if every check passes; otherwise they’re skipped and the trigger carries on with its next action.
The difference from the Conditions panel: conditions decide whether the whole trigger runs, while If / Then only controls the actions inside it. The checks happen when the trigger reaches this action, so a Set Variable earlier in the same trigger already counts.
The editor won’t save an If / Then until it has at least one check and one Then action. The Then box can hold a Use RNG, but not another If / Then or If / Then / Else.
If / Then / Else
ActionWorks like If / Then, with a fallback. When every check passes, the Then actions run; when any check fails, the Else actions run instead. Exactly one of the two lists runs, which suits success-or-failure moments like opening a lock with or without the right code.
Like If / Then, it needs at least one check before the editor will save it. Then and Else can each hold a Use RNG, but not another If / Then or If / Then / Else.
Run/Modify Trigger
ActionLets one trigger control another. Run starts the named trigger right now: its events are skipped, but its conditions still have to pass. Disable switches a trigger off so it can’t fire, and Enable switches it back on. Then this trigger carries on with its next action.
Type the trigger’s name; the editor wraps it as {{Trigger Name}} and warns you in red if no trigger has that name. Renaming a trigger updates these references for you.
A trigger can disable itself, the usual way to make a moment happen only once. Enable is also how you switch on a trigger you set to Disabled in the Triggers list. On/off changes last for the rest of that play-through, and a trigger can’t Run itself, so it can’t loop forever.
Wait x seconds
ActionPauses the trigger for a moment before its next action, for dramatic timing like a fuse burning down. Type the seconds (decimals like 1.5 work) or a number variable like {{delay}}.
While it waits, the player can’t send another turn or pick a menu choice. Most results of a trigger appear once it has finished, so the pause shows best next to things that happen on the spot: a Story/System text set to require, a background used Immediately, or a Failure/death Screen.
Skip Remaining Actions
ActionStops the trigger right there, so none of the actions below it run. It’s most useful inside an If / Then or Use RNG branch as an early exit, and even from inside a branch it stops the whole trigger.
Only this trigger stops. Other triggers still get their turn, and if another trigger started this one with Run/Modify Trigger, that one carries on as normal.
Do nothing
ActionAn action that does nothing, on purpose. Every Use RNG branch needs at least one action, so use it to fill the quiet ones, like the “no encounter” part of a roll.
Unlike Skip Remaining Actions, it doesn’t stop anything after it. It’s also a handy placeholder while you’re still building a trigger.
Actions: Story Control
Show Failure/death Screen
ActionEnds the run with a game-over screen: a skull, your title and message, the line “Rewind to an earlier moment to continue your story.” and a Rewind Story button. The player can’t keep playing until they rewind to an earlier moment. Use it for deaths, failed missions or bad endings.
Both the title and the message are needed, and {{name}} works in both. As soon as the screen shows, this trigger stops, no other triggers run, and the player’s turn isn’t sent to the narrator. The popup can’t be closed and is still there after a reload.
Rewind to last turn
ActionUndoes the turn in progress. It stops any narration being written, removes the player’s latest turn and puts everything back the way it was after the last completed turn: variables, custom instructions, which triggers are on and which characters are active. Use it to enforce story rules, like “the hero can’t leave the castle before midnight”.
It works best in a trigger that runs after the narration, such as one run by a Check Story Context answer, so the narration that broke the rule is removed too. As soon as it runs, no other triggers run in that check.
To explain the rewind, put a Story/System text set to require right before it, as in the example. In visual stories the player reads it before the rewind happens.
Exit story progression
ActionMakes the story leave its Story Progression nodes and carry on as a normal Realism story for this play-through. Use it after a final node, or as an open-world choice, so players can keep playing freely once your planned story is done.
If the player later rewinds to before the exit, story progression comes back. In a story without progression nodes it does nothing.
Tips
Order matters. Triggers are checked top to bottom in your Triggers list, and actions run top to bottom inside each trigger.
A Variable status trigger fires on every check while it’s true. For one-time moments, end it with Run/Modify Trigger set to Disable on itself.
Each trigger’s menu in the list has Rename, Duplicate, Enable/Disable and Delete. A disabled trigger shows a red X, never fires, and its /command disappears from the player’s list.
A prohibit /command whose trigger has no Inject action doesn’t start a new narration. Use that for commands that just open a list, show a text or change a variable.
Mana stops runaway loops: a trigger can’t run itself, and chains of triggers running other triggers stop after 8 steps.
Show Media to player, Use background and the after player finish reading starting prompt timing of Game Initialization work in visual stories only.
Questions
Why does my trigger keep firing every turn?
A Variable status event fires on every check for as long as its comparison is true. To make it happen once, add Run/Modify Trigger set to Disable with the trigger’s own name as its last action, or change the variable so the comparison is no longer true.
What’s the difference between Conditions and the If / Then action?
Conditions decide whether the whole trigger runs: if one fails, none of the actions run. If / Then sits among the actions and only controls the actions inside it, so everything before and after it still runs.
Can a trigger run without an event?
Yes. A trigger with no events runs only when something runs it by name: a Run/Modify Trigger action, a Story Progression node, an In-Game Images/Video answer or a Check Story Context answer. Its conditions still have to pass, and a disabled trigger doesn’t run.
Does Redo roll the dice again?
No. Redo doesn’t run the turn’s triggers again: it reuses the same Inject instruction, so the result of the random roll stays the same. A Check Story Context trigger does run again afterwards, because it looks at the new narration.
Do triggers cost coins?
Almost everything triggers do is free. Check Story Context is the exception: each check is an AI call that costs the player some coins, and it’s skipped if they can’t cover it. Older LLM Context Check (Legacy) conditions cost coins too.