Using the automap output as a second set of Rules

I am trying to do what Adam Cyouns does at the minute 31:43 of this video
seconde set of Rules
This is what I did
The first set of rules (autoMapRules.tmx) works as expected. The second(autoMapRules_2.tmx), as you can see(hopefully) have the same layers but I called the input one “input_terrain” (instead of input_base as in the first rules). So when Tiled sees 3 consecutive grass tiles with air on top, it will change it by the pink ones.
The rules.text is (since it is not very clear in the .gif):


Can anyone see what I am missing here?


I can’t be certain, but I suspect the problem is that you’re using old-style (Tiled 1.8 or older) rules in what is probably new Tied (1.9+), so the tile above your input is actually being parsed as “non-empty other tile” rather than being ignored like you want it to.

Deleting the regions layer to use 1.9+ automapping mode should be enough to fix this. If you’re using an outdated version of Tiled that requires regions layers, then you’ll need separate input and output regions, so that the input doesn’t look at irrelevant tiles.

I didn’t know about that, thanks. I have updated Tiled to the last version and updated the rules accordingly.
So I removed the regions and used the empty built-in Tile for the sky.

Still missing what I am doing wrong in the second set of rules. Unless I misinterpreted what he does in the video, his second rules map takes as input the output of the first rules map, that is why he calls the input layer “input_ground”.

I 'll have a look again tomorrow.

ps: I am using your move tool. It’s pretty cool.

I think I might know what the problem is: you’re using those blue tiles to represent empty space like in the tutorial, but those are only in the base layer, you’re presumably not outputting them to “terrain”. Your second rule map’s input is looking for them in the terrain though, and not finding them, so the output doesn’t get applied.

You should remove the “air” tiles from your second rule map.

In fact, I recommend not using such tiles at all, anywhere - they are a weird quirk of that tutorial you linked, but are not a very good technique. In 1.9+, you can use the built-in Automapping Rules tileset (add it through the Map menu) to refer to Empty tiles directly, and even in older versions of Tiled, it is possible to check for empty tiles using StrictEmpty. So, your working map should use empty tiles instead of the blue tiles, your first rules map should use the MatchType “Empty” tile instead of the blue tiles, and your second rules map can either use the MatchType “Empty” tile, or can simply not look at those tiles at all, since the previous set of rules already made sure there was empty space above those tiles.

That was it!!! all working as expected now.
Thansks eishiya.

1 Like