All automap rules stop working if I have a rulefile with 2 input layers

All my rules work perfectly, but now I have a situation where I want to automatically create a wallshadow in a corner depending on what surface is in my back_default layer. This means I need 2 input layers. A default input layer which has the wall tiles, then a back_default layer with a surface behind 1 of the walls. After creating a rulefile like this, all other rules stop working as well. The paths in the rules.txt file are correct. I’ll show a few pictures of my rulefile.

regions layer:

input_default layer:

input_back_default layer:

output_edging layer:

The result is that it adds shadows based on the surface:

Is there a way to achieve what I want? Thanks in advance.

Did you try setting the index?

EDIT: Example: input1_default and input1_back_default, where layers are called “default” and “back_default”, where 1 is the index

EDIT2: You probably can also work around this using inputnot and two indexes.
If background tile is blue and NOT Brown, use corner A (index 1)
If background tile is brown and NOT blue, use corner B (index 2)

I didn’t test any of those examples!
They may not work but hopefully shed a light.

PS. Keep in mind ruleset stop working if layers or tilesets are named differently on the map you are trying to use the rules. I always have this issue when I try to mix my icecave and normal cave rulesets >.<

1 Like

Thanks for the response! I will try this out once I get home.

The second suggestion will probably not work, considering I’m going to have countless different tiles that could be placed next to the wall. In the example I only used blueish grass and dirt, but I’ll also add other colors of grass, maybe gravel, sand etc. etc. As my tileset’s size increases, it would slowly become a very tedious and unmaintainable job to have to change every previous rule as well, instead of just having to set the new one.

As for your last note, that won’t be an issue. All my maps have the same layers.

I think the problem is because there are empty tiles on input_back_default that are within the region. When there is no “inputnot” layer then the empty tiles have the special meaning of matching “any other tile than those used within the input region”, which includes the empty tile itself.

So if that’s the case, there may any of these options:

  • Setting a boolean StrictEmpty input layer property to true, to change the meaning of the empty tile to require the back_default layer to be empty at that location.

  • Adding an inputnot_back_default layer, that requires some tiles not to be there. It doesn’t really matter which tiles as long as you won’t actually want those tiles, because adding this layer is just to avoid the default matching behavior on the empty tile.

  • Placing any other tile than the empty tile and the ground tile used in the input_black_default rule layer on the back_default layer in your map, at the location of that empty tile in the input rule layer.

This treatment of the empty tile is a stumbling block for many people. It exists because without it, it would require setting up a lot of inputnot layers to get this behavior, and sometimes it is what you want. It should probably be at least prominently mentioned in the documentation though…


Ah yes that works, thanks! I think the inputnot layer is the best option, as StrictEmpty means I can’t just quickly fill the entire back_default layer with sand, as it won’t be empty in the spot where I place a wall in this case.