How can I have multiple terrain interactions with autotiles?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SteeveDroz

I am creating a map that is going to use auto-tile tilemapping. I have 6 different types of terrain (counting) and I’d like interactions with all of them.

For now, I have 6 tilesets for terrain types, using a 3x3 (minimal) bitmask. They represent “water”, “grass on water”, “mountain on water”, “sand on water”, “snow on water” and “forest on water”.

If I want to use those to create “mountain on grass”, “snow on mountain”, etc.

Is there an easy way to do that or should I create a painful 21 different tilemaps? (again, if I add but one terrain, I’m good to add 7 more tilemaps).

:bust_in_silhouette: Reply From: exuin

You can check what kind of tile a tile is with its ID. You’ll need to use the world_to_map and get_cell functions of TileMap. If you want to check which autotile it is specifically, you can use get_cell_autotile_coord. You can hold “alt” in the TileSet editor to see a tile’s ID.

Thanks! I accept your answer as it may help others, but I ended up having multiple layers of tilemaps, which worked for me. It’s nice to know that you can do the thing you propose, though!

SteeveDroz | 2021-03-04 05:27