create_map_event
Create a new event on a map. Merge only fields that differ onto a blank page, with validation and dry-run preview.
Instructions
Create a new event on a map. Each page is merged onto a blank "New Event" page (trigger 0 action-button, priority 0 below characters, no graphic, empty command list, standing move type), so you only supply the fields that differ — pass e.g. { image: { characterName: 'Actor1', characterIndex: 0 }, trigger: 3, list: [...] } and the rest is filled in. Nested image/conditions deep-merge; an omitted list becomes a valid empty (code-0-terminated) list. Omit pages entirely for a bare one-page event. For the common "talking NPC" case prefer create_npc. An action-button page meant to fire from facing (doors, entrances, signs) needs priorityType: 1 — with the default 0 (below) it only fires when stood on, so on an impassable tile it can never trigger (this is refused, not written; pass force: true to override). A structurally invalid command list is refused the same way. Page fields: image { characterName, characterIndex, direction (2 down/4 left/6 right/8 up), pattern, tileId }, trigger (0 action-button/1 player-touch/2 event-touch/3 autorun/4 parallel), priorityType (0 below/1 same/2 above), moveType (0 fixed/1 random/2 approach/3 custom), conditions, list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X tile position | |
| y | Yes | Y tile position | |
| name | Yes | Event name | |
| note | No | Event note field | |
| force | No | Write even if validation finds structural problems (wrong parameter count, unterminated command list). Off by default: such a write is refused and nothing is written. Advisory warnings never block regardless. | |
| mapId | Yes | The ID of the map | |
| pages | No | Event pages; each is merged onto a blank page so you can pass only the differing fields. Omit for one blank page. | |
| dryRun | No | Preview only: return a diff of what would change without writing to disk. |