Edit: Solution found with fishy's help, despite the wiki currently not mentioning it, TileSetSource allows changing .texture. See answers for details.
I've been prototyping a game that would need to have alternate styles for each placed tile, so none of the tile properties change except for the texture.
Imagine the maps of 2D harvest moon games that mostly stay the same, but tiles change their design each season.
Or games where the same scene is playable in different weathers/daytime, making some changes to the tile sheet.
So far I haven't found a reasonable way to do this
- separate tilesets/atlases means I'd have to give properties like collision and custom data, which becomes pretty unrealistic to keep consistent and avoid mistakes for large tilesets
- I also looked into tile proxy and
take_over_path, but neither seems to fix this issue far as I can see - only thing I can think of is to have the alternate tilesets generated on launch to copy all properties from the original except the texture, then iterate over the tilemap whenever something changes to swap out all tiles to the corresponding ID on the other sheet. But that's a lot of relatively slow GDScript code so I'm not really happy with this option either.
- Godot 3 had
tile_set_texturewhich seems like it would've worked, but that no longer exists in Godot 4 by the looks