set_tile_flags
Edit tile flags for passability, terrain, and behaviors (star, ladder, bush, counter, damage) in RPG Maker MZ tilesets, merging changes while preserving unrelated settings.
Instructions
Edit a tile's passability/terrain/behaviour flags in a tileset's flags[] array (the write side of get_tile_flags). Only the fields you pass change — everything else on the tile is preserved (a non-destructive merge onto the current flag word). passage is walkability (down/left/right/up, true = a character can walk off that way). Also settable: star ([*] overlay), ladder, bush, counter, damage (damage floor), and terrainTag (0–7). For an autotile id (A1–A4) the change is applied to all 48 shape slots of its kind by default (set applyToAutotileKind:false to touch only the exact id) so painting any border shape keeps the same passability. Writes data/Tilesets.json through the commit choke point (dry-run/diff). Returns { tilesetId, tileId, appliedTileCount, before, after }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bush | No | ||
| star | No | [*] overlay: tile drawn above the character. | |
| damage | No | Damage floor (standing on it hurts). | |
| dryRun | No | Preview only: return a diff of what would change without writing to disk. | |
| ladder | No | ||
| tileId | Yes | The raw tile id whose flags to edit | |
| counter | No | ||
| passage | No | Walkability per direction (true = walkable). Only the given directions change. | |
| tilesetId | Yes | Tileset id (from Tilesets.json / the map) | |
| terrainTag | No | Terrain tag 0–7 (0 = none). | |
| applyToAutotileKind | No | When the tile is an autotile (A1–A4), apply the change to all 48 shape slots of its kind (default true). Ignored for flat tiles. |