About using custom resource types dynamically during gameplay

Godot Version

4.7.2

Question

hey all! I’ve been wondering how to use custom resources during gameplay, such as pulling a resource randomly from a certain group, eg: pulling a resource with the exported enum rarity of Uncommon or an object with a SingleUse attribute.

I’ve thought of loading all resources from the home directory via DirAccess and reading their types and then caching it for later use instead of reading the entire directory on every pull, but I feel like there’s a simpler solution I just don’t know about. have any of you tried a similar approach like this instead of creating dictionaries you have to update on every new created resource? I’d love to hear some ideas on this. much love​:growing_heart:

I’ve used Godot Resource Groups - Godot Asset Library and was very happy with it. Loading with DirAccess/FileAccess at runtime usually breaks because filenames change during export.

just looked at it, I believe this is what I’m looking for. thank you so much!!!:growing_heart: