Author an interactive beat in one call
make_choice_sceneBuilds an RPG Maker MZ event page script from a step list, compiling dialog, choices, branches, loops, battles, shops, and transfers with validated switches, variables, and assets.
Instructions
Write an event's whole script from a step list: dialog, choice branches (each option can carry its own when gate), if over switches, variables, items, gold and buttons, loop with break, battle with win/escape/lose branches, shop, transfers, audio, screen effects, gameOver. This is the tool for a scene rather than a person: pass a cell to place a new event, or an existing eventId and pageIndex to rewrite that page. The compiler produces the indentation and the branch markers (402/403, 411/412, 413, 601-603) the engine reads, so a body cannot land outside the branch it belongs to — the mistake that otherwise shows up as a choice that always takes the first option. Checked before writing: unknown step names, conditions or commands that name a switch, variable or database row the game does not have, audio and face files the project lacks. One transaction, map rendered back.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| name | No | ||
| when | No | Condition for the page this script goes to | |
| image | No | The event's graphic. A characterName that is not in img/characters fails the call | |
| mapId | Yes | ||
| script | Yes | The page's whole script. Each step is an object with exactly one key: `say` (a string, a list of lines, or {lines, speaker?, faceName?, faceIndex?, background?, positionType?}), `scroll` ({lines, fast?, wait?}), `comment`, `choice` ({prompt?, options: [{label, then, when?, lockedMessage?}], cancel?: steps, defaultType?, positionType?, background?}), `if` ({when, then, else?}), `loop` (steps, closed by `break` or `goto`), `break`, `exit`, `label`, `goto`, `switch` ({id, value?}), `selfSwitch` ({letter, value?}), `variable` ({id, set?|add?|multiply?}), `gold` (a number; negative takes), `item`/`weapon`/`armor` ({id, count?, take?}), `heal`, `transfer` ({mapId, x, y, direction?, fade?}), `wait` (frames), `fade` ("out"|"in"), `flash` ({color?, duration?, wait?}), `weather` ({type, power, duration?, wait?}), `se`/`me`/`bgm` (a name or {name, volume?, pitch?, pan?}), `stopBgm`, `stopSe`, `animate` ({target?, animationId, wait?}), `balloon` ({target?, balloonId, wait?}), `moveRoute` ({target?, route: [route steps], repeat?, skippable?, wait?}), `battle` ({troopId, canEscape?, canLose?, win?, escape?, lose?}), `shop` ({goods: [{id, kind?, price?, purchaseOnly?}]}), `menu`, `saveScreen`, `gameOver`, `title`, `commonEvent`, `erase`, `script` (engine code, stored as 355/655) and `raw` (verbatim {code, parameters, indent?}). `script` and `raw` are escape hatches: they come back named in the reply, and a build that leans on them is reporting a shape this layer does not cover yet. | |
| eventId | No | Rewrite this event instead of placing a new one | |
| replace | No | With `name`: rebuild the event of that name instead of adding another (default true) | |
| trigger | No | 0 action button, 1 player touch, 2 event touch, 3 autorun (fires on entering the map), 4 parallel process. 0 and 1 are checked for a cell the player can stand on; 3 and 4 are not, so an opening cutscene can sit on a wall in the corner the way the editor's own do | |
| pageIndex | No | With eventId: which page to replace (default 0) | |
| priorityType | No | 0 below tiles (default: a zone or a cutscene should not block), 1 same as tiles, 2 above |