Assorted scripts for Tiled Map Editor, written by eishiya.
Usage instructions are in the comments at the top of each script. Feel free to use these scripts as you wish. Credit appreciated but not required.
If you're new to using Tiled scripts and don't know how to install them, please see the Tiled docs on scripting. Check out more scripts from the Tiled community in mapeditor/tiled-extensions.
Brief descriptions of the scripts in this repo:
An alternative Terrain Brush that lets you paint with Mixed Terrains as if they were edge terrains, making it easier to draw thin paths, rivers, etc without making separate Edge Terrains for them.
Draws large tiles spaced out so they don't overlap each other. Right-click to sample tiles.
Allows you to move selected tiles by dragging them instead of cut+pasting, similar to image editors' Move tools. Hold shift when starting to move to copy instead of cut. Also allows nudging with the keyboard. Click to commit the move.
Replaces a tile with your current brush tile, either in your selected layer(s) or everywhere in the map. Unlike Select Same Tile + Bucket Fill, it reconciles the existing flips with the new ones. If you need to replace a large number of tiles and/or replace tiles across many maps, see the Mass Replace Tiles script.
Draws a rectangle using the currently selected terrain. Allows drawing large rectangles using Terrain sets that don't include concave corners and confuse the regular Terrain tools. Ctrl to ignore existing terrains in the map.
Lets you choose any action in Tiled and run it on every open document. Useful for mass-applying scripted actions without making a separate "apply to all" action for all of them.
A collection of several actions to make automapping less tedious.
Useful to temporarily give layers unique names even when Automapping requires them to be the same, to aid copypasting in multiple layers at once.
Creates multiple input or output layers at once, optionally filling them with tiles from your brush.
Takes your brush and prepares it for pasting to the Selected Layers, either by renaming the layers of a multi-layer brush to match the selected layers, or (for single-layer brushes) by moving each tile to its own layer, named to match the selected layers. This action makes it possible to multi-layer paste to different layers.
Adds or removes //
to/from selected layers' names, either individually or based on the comment state of the bottom layer. Hotkey this to quickly mark layers as ignored for Automapping in Tiled 1.8+.
Centres the current map view on the map, useful to quickly go back to a map after panning around a large World.
Copies/pastes tile animations. It can copy the frames exactly, or adjust the frames relative to the destination tile(s).
Copies/pastes tile collisions in the Tileset Editor, makes it easier to copy complex collisions across groups of tiles.
Copies/pastes entire layers, including their properties along with the content. Can copy/paste multiple layers at once, regardless of layer type.
Copies/pastes objects, but remembers the names of the layers they came from and pastes them and pastes them to layers of those names, enabling multi-layer copy+paste similar to that for tiles.
Copies/pastes terrains from/to selected tiles. Includes actions to copy/paste terrains exactly, as well as to copy/paste the arrangement of a particular terrain, so you can paste it as a different terrain.
Counts the tiles used in a map, useful for e.g. GB Studio where the unique tiles allowed per map are limited, but tilesets may be large. Counts both by ID and by flips.
Deletes collision shapes from selected tiles in a Tileset.
Finds instances of specific tiles across all the maps in your Project.
Flips the tiles in your current brush stamp without flipping the stamp itself.
Generates a TileMap based on a source image by matching colours from the image to tiles, using user-defined color: tileID pairs. Useful for turning schematic map sketches into TileMaps.
Builds Terrain data for a metatileset by using the Terrain data from the source Tileset. Useful for speeding up Terrain creation for metatilesets, as the source tiles are usually fewer in number and easier to label. Only tested with orthographic tiles.
Replaces tiles en masse, according to a guide map that specifies the tile to replace in an "old" layer and the replacements in a "new" layer. Includes actions to run the replacer on all open maps, or on all maps in a Project. Useful for when you need to rearrange the tiles in a tileset, replace an old tileset with a new one that's arranged differently, or create multiple sets of similarly structured Automapping rules.
Expands and contracts (erodes) selections in maps.
Enables additional syntax in Automapping rules.txt to apply random rules and apply rules conditionally based on earlier selections. Can be useful for procedural generation.
Renames selected layers by doing a search and replace in their name. Supports regular expressions.
Recursively selects the child layers of all selected groups.
Selects all the non-empty cells in a layer, letting you use a layer as a selection.
Inserts and deletes rows and columns in your map, making it easier to expand and contract your map. Can also shift Objects over to match.
Generates a heatmap of your tileset, making it easy to find over- and under-used tiles.