Automap Rule - How to get output when 2 different layers match the input layers?

(Tip) #1

I’ve read the automapping documentation but I’m a bit confused. I’m trying to get a certain output when there are 2 tiles next to each other. But these tiles are from seperate layers. How would I go about doing this/is it even possible? This is what I’ve tried thus far (ignore the group folder):

input_ground contains the wall corner tile in the picture. input_background contains the green tile. output_wallshadow contains the small shadow in between the 2 tiles. Now this clearly doesn’t work. I’ve also tried using input with an index, but that causes a bunch of other issues as well.

If this is not possible, then there might be something else I can do to still make everything efficient. I would need a tile in input_ground, but then when the automapping happens, the tile that got placed in the ground layer gets removed immediately and the tile in output_background gets placed. Is this possible to do? I know about the DeleteTiles functionality but I haven’t gotten it to work and I’m not sure if it’s even what I’m looking for.

Thanks!

(Thorbjørn Lindeijer) #2

The problem here is that empty tiles within your region match “any tile that isn’t one of the tiles in the input region”, and the empty tile is also part of the list of “tiles in the input region”, so the rule fails.

One alternative supported behavior is the “StrictEmpty” mode (a custom input layer property), which makes empty tiles in the input region match only to actually empty tiles. I hope this would work in your case.

Unfortunately, there is no way to set up a “wildcard” in multi-layer mode. With a single input layer, a wildcard is simply any tile that isn’t part of the input region. But once you have multiple input layers, you get into trouble because the input region is shared. Possibly there should be another option, or potentially support for defining per-layer input regions (actually deriving the input region from whatever tiles are set is something I’d still like to add - and maybe it should work per-layer).

1 Like
(Tip) #3

Thanks for the fast reply, I will definitely have to test this out when I get home.

(Tip) #4

Alright, that worked perfectly. Thanks Bjorn! I appreciate the fact that you’re helping anyone with a question. You barely see that anymore.

1 Like
(Thorbjørn Lindeijer) #5

I’m glad to hear that helped, @Tipsi!

I wouldn’t have time for it if it weren’t for my generous patrons on Patreon and those who choose to pay for Tiled on itch.io. :slight_smile:

2 Likes