I have a very simple texture atlas for my puzzle game, and I am adding a system to allow unlockable skins for the game, it’s as easy as changing a variable in the script to the ID of the tileset I want to use but some of my playtesters wanted to make their own skin for the game after seeing how simple the texture file is, so without having to rebuild the game every time they want to try out a skin they made (and i’d like to make this a feature for users too), I’d like to just have the game look for a file called tileset.png beside the binary and load it in as a new tileset using the same region settings as the other atlas’s, but I can’t seem to figure out how to load a texture into a tileset specifically. Ideally i’d like to set a ‘custom’ tileset that’s on id 99 and that’s where I load an external png to.
AH okay I got it working, turns out I was being a dork and trying to do this on a scene that doesn’t have any of my tilesets I defined on it. I just grabbed a tilemaplayer reference and added .tile_set to pass it in, looks like
func load_custom_skin():
var tss := bg_layer.tile_set.get_source(99)
tss.texture = ResourceLoader.load("res://tileset.png")
After making a tile source at id 99.
Probably cleaner ways to do it but it works, thanks!