edit_map
Modify RPG Maker maps by filling layers, setting display names, reorganizing the editor tree, connecting maps with bidirectional transfers, or configuring random encounters.
Instructions
Modify existing maps; the affected map files / MapInfos.json are written immediately. action selects the edit: "fill_layer" overwrites an ENTIRE tile layer with one tile ID (destructive, not undoable; layers: 0-1 ground, 2-3 upper, 4 shadow bits 0-15, 5 region IDs 0-255; tileId 0 clears; find valid IDs with get_project_context detail "tileset"); "set_display_names" sets the player-visible displayName of several maps at once (entries whose map file is missing are reported in skipped, not errors); "organize_tree" re-parents maps in the editor tree (purely organizational, gameplay unaffected); "connect" creates a bidirectional pair of transfer events between two maps so the player can walk both ways; "set_encounters" sets the map's random-battle list so enemies appear while walking — encounters is [{troopId, weight?, regionSet?}] (weight default 5; regionSet [] = whole map; troopId must exist) plus optional encounterStep. WITHOUT encounters set, a map has no random battles. Returns a per-action summary. Fails with an error if a referenced map does not exist (except set_display_names, which skips). For event-level work use manage_map_event.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Which edit to perform; see the tool description | |
| mapId | No | action "fill_layer": map to modify | |
| layer | No | action "fill_layer": layer index 0-5 | |
| tileId | No | action "fill_layer": tile ID to write into every cell (0 = clear) | |
| names | No | action "set_display_names": [{mapId, name}] — name is what the player sees on map entry | |
| folders | No | action "organize_tree": [{mapId, parentId}] — parentId 0 means root level | |
| mapIdA | No | action "connect": first map ID | |
| mapIdB | No | action "connect": second map ID | |
| posA | No | action "connect": transfer event position on map A {x, y, trigger} (trigger 1=walk-on default, 0=action button for doors) | |
| posB | No | action "connect": transfer event position on map B {x, y, trigger} | |
| encounters | No | action "set_encounters": [{troopId, weight?, regionSet?}] random-battle entries; troopId must exist (create via create_database_entry "troops") | |
| encounterStep | No | action "set_encounters": average steps between random battles (default 30) |