edit_map
Edit RPG Maker MV maps in place: paint tiles, fill layers, set encounters, connect maps, rename display names, and organize the tree.
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). "paint" writes one tile into cells or a rect of one layer; an autotile is written as its kind and the painted cells and their neighbours get the shapes the editor would give them, so shorelines and walls join up, while the rest of the map keeps its saved shapes. "repair_autotiles" fixes only autotile cells whose shape the engine cannot draw (analyze_project validate reports them as invalid-autotile). For event-level work use manage_map_event.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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} | |
| rect | No | action "paint": {x, y, width, height} rectangle to paint (or give cells) | |
| cells | No | action "paint": [[x, y], ...] cells to paint (or give rect) | |
| layer | No | actions "paint", "fill_layer": layer 0-3 tiles, 5 regions (fill_layer also 4) | |
| mapId | No | actions "paint", "repair_autotiles", "fill_layer": map to modify | |
| names | No | action "set_display_names": [{mapId, name}] — name is what the player sees on map entry | |
| action | Yes | Which edit to perform; see the tool description | |
| mapIdA | No | action "connect": first map ID | |
| mapIdB | No | action "connect": second map ID | |
| tileId | No | actions "paint", "fill_layer": tile ID (0 = clear); on layer 5 a region id 0-255 | |
| folders | No | action "organize_tree": [{mapId, parentId}] — parentId 0 means root level | |
| 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) |