Simulate an event
simulate_eventDry-runs a map event page against a hypothetical game state, returning messages and changes without modifying the project or running the game.
Instructions
Dry-runs one map event page against a hypothetical game state and returns what it would do, without touching the project or running the game. Supported commands: Show Text (101/401), Show Choices (102/402/403/404), Conditional Branch (111/411/412: switch, variable, self switch, gold, item), Loop/Break (112/113/413), Exit Event Processing (115), Common Event (117, nested up to 8 deep), comments, Control Switches (121), Control Variables (122: constant, variable and random operands), Control Self Switch (123), Change Gold (125), Change Items (126), Transfer Player (201, ends the run) and Plugin Command (356, listed in changes as 'plugin: ...'). Battle Processing (301) is not fought: the branch picked by battleResult runs (win, escape or lose; default win) and the others are skipped; a missing branch adds 'battle: no branch' to changes. A Battle Processing without branches (what the editor writes when neither Can Escape nor Continue when Loss is on) is a single command: nothing is skipped and the next command runs. Label (118) and Jump to Label (119) work: a jump goes to the first label of that name in the current command list and counts as a step, so a label loop ends 'stepLimit'; a missing label is listed in unsupported and the run continues. Presentation commands (Set Movement Route 205, animation and balloon 212/213, screen fades, tint, flash and shake 221-225, wait 230, show/move/erase picture 231/232/235, weather 236, play/fade audio 241/242/245/246/249/250/251, 505 route rows) are ignored and only counted in cosmetic, not listed in unsupported; the one exception is the switch ON/OFF steps of a Set Movement Route, which do change the simulated switches (changes: 'switch N → ON (move route)'; only the first 1000 route entries are scanned, each costing one step, and a longer route adds an unsupported note). A battleResult of escape or lose on a battle that cannot be escaped or lost still runs the branch but adds a note to changes. Everything else (script 355, other condition types, game-data operands, party and scene commands, ...) is listed in unsupported with its index and skipped; an unsupported condition follows unknownCondition: stop (default) ends the run with ended 'unsupported', then/else takes that branch. Message text is returned verbatim, control codes unexpanded. Limits: 10000 steps (ended 'stepLimit'), integer variable math (results are floored like the engine, so -7 / 2 gives -4; division or modulo by zero leaves the variable unchanged; a random or variable operand is evaluated once per command). A command that changes several switches or variables adds one changes entry for the whole range. messages, changes and unsupported are each capped at 2000 entries; omitted counts what was dropped (present only then) and finalState stays exact. State inputs default to everything OFF/0/empty: switches and variables are keyed by id, selfSwitches by letter A to D, items by item id. choices lists the answers to Show Choices in the order they are asked (0-based; a missing answer is 0, an out-of-range one takes the cancel branch). page is a 0-based page index; when omitted the highest page whose conditions hold under the supplied state is used (the actor condition counts as met). The random operand is seeded (default seed 0), so runs repeat exactly. Returns {messages, changes, transfers, unsupported, cosmetic, ended, finalState, pageUsed}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gold | No | Party gold (default 0). | |
| page | No | 0-based page index; omit to pick the page that would be active under the supplied state. | |
| seed | No | Seed for the random operand (default 0). | |
| items | No | Items held by id, e.g. {"4": 1}. | |
| mapId | Yes | Map id. | |
| choices | No | Answers to Show Choices, in the order they are asked. | |
| eventId | Yes | Event id on that map. | |
| switches | No | Switch states by id, e.g. {"12": true}. | |
| variables | No | Variable values by id, e.g. {"3": 10}. | |
| battleResult | No | How every Battle Processing command ends, which decides the branch that runs (default win). | |
| selfSwitches | No | Self switches of this event, e.g. {"A": true}. | |
| unknownCondition | No | What to do at a condition that cannot be simulated. | stop |