Godot 4 set_cell without atlas_coords

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

I’m trying to migrate my game to Godot 4, but I have massive problems with procedurally generated tilemaps.

In Godot 3, set_cell was pretty straight forward. All you needed was the destination coords and the tileID. I named all my tiles like “grass”, “water” or “mountain”, so I worked a lot with find_tile_by_name to get the IDs.

In Godot 4, you need the atlas_coords on top. While tiles still can be named, there is no way to find right the atlas_coords, even if the atlas has only one “active” tile.

What is the best way to address single tiles if I don’t know the atlas coords?

:bust_in_silhouette: Reply From: Rochambeau

Well, as a workaround, I split my tileset.png into single 16x16 images. So when importing them to the 16x16 tileset, the atlas coords are always 0,0.

Not very convenient, but it works.

:bust_in_silhouette: Reply From: Monkstar

I use single tiles, and for me the atlas coords are all (0,0). I can see that when I hover over them in the tileset with my mouse (the base tiles or alternative tiles). So I just use that. It works for me. But I’m also still figuring everything out.

:bust_in_silhouette: Reply From: Rochambeau

I was given a tip to use custom data layer and it works for me.