Match any tile from one tileset in Automapping

Hi. Briefly, my current situation: I have multiple tileset with automapping set up for each one to accomplish autotiling paths. I use one key tile as the “brush”, which is then automapped into the final path on a separate output layer. This works reasonably well, but it would be more convenient if the replacement were to happen on the same layer. However, for that I would need to be able to declare an entire tileset, or an array of tiles, as the potential replacement.

For example, if I draw a 3x1 path, it turns into a left end, a middle, and a right end when automapped. As such, these 3 tiles won’t match the brush-tile anymore and they stop being part of the automapping. If Tiled were to consider every tile of that tileset as a candidate for replacement though, you’d be able to continuously automap on the same layer.

Is this possible? I did read the documentation, and I know there’s the “NonEmpty” tile type, but that matches any tile, regardless of tileset, which is a problem because I have multiple tilesets that need to be automapped. I guess what I’d need is that type, but limited to the singular tileset used in the rules map.

As I’m writing this, I realize there’d be some ambiguity here, as you’d have to communicate to Tiled which tileset it should match in its entirety, but perhaps there is a way :sweat_smile:

This is possible only by enumerating every single tile in the tileset, in as many layers as there are tiles. My Automap Helper script makes this sort of monstrosity actually practical: you can create as many input_whatever layers as you have tiles in the tileset using the Generate Automap Layers action, then select all the tiles in the tileset (by right-clicking in the Tileset and clicking “Select All Tiles”), select the newly created layers (all possibly hundreds of them; you can right-click any layer and click Select All Layers, and then deselect your output layers by Ctrl+clicking them), and then you can use the Convert Brush to Layers action to place the tileset tiles in your brush into layers like the ones you selected, which will then allow you to stamp those tiles as a stack into all those layers. I do this sort of thing regularly, though usually with 10-40 tiles at a time, not a whole tileset’s worth xP

Oof. Considering that I also want to support automapping on multiple map layers, that would indeed create hundreds if not thousands of automapping layers :sweat_smile: I think I’ll stick with the separate output layer approach for now. Thanks for the answer!

1 Like