Changing a map's directory it looks in for resources/assets?

So I’m working on a game right now, and I want to add custom map support. Of course, loading the maps on their own is easy, but I need some way to load in any assets the map maker might want in there as well. The way I have things set up, custom maps will go in user://scenes/, and I was thinking of having the resources all be put in their own subfolders for each map in user://map-resources/'. For example, if I had a map named "my-cool-map", I could set it up to have the resources be pulled from user://map-resources/my-cool-map/`.

Or… at least that’s what I want to do. But I can’t exactly figure out how to change all the resources in a scene to look in that directory, rather than res://. If there’s an easier way using .paks, that could also be an option.

How are you saving the maps in the first place?

If you are using a custom format then you’ll be in charge of loading the resources (textures, sounds,…) at runtime Runtime file loading and saving — Godot Engine (stable) documentation in English

If you are using any other method it depends. If you are using PackedScene.pack() to save the map then maybe you could make every resource the nodes use unique and save the file as a binary file (.scn) instead of a text file (.tscn) to pack all the resources inside the file itself.

I actually have things set up so you’d have to use the Godot editor to make levels, because I didn’t want to make a level editor. So I just have a map maker put their .tscn file in the custom map directory. But maybe I’ll look into giving map makers some sort of tool to pack resources into a .scn file like you said. (unless Godot can do that for you?)

Oh, in that case did you read this page of the documentation? Exporting packs, patches, and mods — Godot Engine (stable) documentation in English If you let them use the editor you could let them know how to export the mod as a pck file and everything would be packaged correctly.

Yes, save the scene as .scn instead of .tscn in the editor. Both formats can pack the resources inside them but the tscn file will save them as text so it will grow in size by a lot if you save binary resources (like textures, sounds,…) scn is a binary format and will save them as is.

I just remembered that you can pass ResourceSaver.FLAG_BUNDLE_RESOURCES as a flag to ResourceSaver.save() and it will take care of that without needing to make the resources unique manually.