Automatic layers depending on the tileset you select

Hello!

Im doing a map with many different tilesets each with the type of image collection and I have 2 layers to determine if it’s the ground of something above it, like a tree. My question is it possible to configure a layer for each tileset? sometimes I’m making my map and for mistake I paint something in the wrong layer, so I need to erase it and redraw it in the corret layer, if there’s a way to determine a layer for tilesets this would be very helpful, so things like that will never happen again

thanks!

1 Like

Hi,

this is somewhat related to this request:

Regards,
Ablu

Or it could be more like this?

Yes! your answer to his topic is what I would like to feature in mapeditor, that would be perfect for my project, sometimes I put a tile in a wrong layer for mistake while making the map and I need to erase it and recreate in the right layer, with that autolayer function this ‘problem’ would be solved :wink:

There is no way to do this right? Just wanted to make sure I’m not missing something.

All of my tilesets and layers are 1-to-1 (except for 4 sprites I used for the collision layer - on my buildings tileset). Have been looking to share a stripped-down map for my players to try their luck at suggesting areas for my game. I am concerned they will not be as anal about picking the correct layer.

You can use Automapping or scripting to achieve this, though neither is a perfect solution.

Automapping: Can immediately move newly placed tiles to the correct layer and can deal with edits consisting of tiles from multiple tilesets at once, but cannot recover any tiles that were replaced by these incorrect edits. Unfortunately every single tile in every single rotation in every single wrong layer will need its own rule, so this will be very tedious to set up.

Scripting: Requires programming skills. Can be simpler to set up, as you can write the script to use custom properties on each tileset that determine what layer it goes on, so you don’t need dedicated rules for each individual tile, and if you set up a script that just switches to the correct layer based on which tiles are selected, you won’t have to worry about overwriting tiles. This Github issue should have some guidance for you for writing a script that automatically selects a layer based on the selected tile(s). You may also want to write a similar script that reacts to Terrains, if those are used in your game. You should also consider what this script should do in the case that the user uses a stamp that consists of tiles from multiple tilesets.

It’s also possible to write a script that reacts to the map being edited and moves the newly placed tiles to the correct layers, just like Automapping and with the same downside of not being able to catch the edits before they happen, but with the benefit of also being able to do this based on custom tile properties instead of requiring rules for every single tile. This approach could also easily deal with edits consisting of tiles from multiple tilesets.