Godot Version
4.3.stable
Question
G’day!
I’m working on a simplified open-world system for my project, and I’m aiming to use custom Resources to save data about the world in chunks. This way, instead of needing to load PackedScenes with hundreds or thousands of nodes for things off in the distance I can just use a resource to tell me what data I should send to the RenderingServer directly. The problem is that I don’t know much about Resources.
I want to write a script to create and edit these chunk Resources in the editor, but I’m struggling to find good documentation on exactly how this works. All the examples I can find just use exported variables that are changed in the editor. For my purposes I’ll need something like an array that I can append other resources to, and I’ll need to be able to edit this data and overwrite a specific saved resource that already exists on the disk.
Is that how resources work? When I make my custom resource class (extends Resource) can i just make a non-exported array a property of that class, write a function that appends to that array, then in code load the resource and call the appending function? Will that change the .tres file and the data it stores? Or am I going about all this the wrong way and should just use a .json file or something?
Any and all help would be greatly appreciated, thank you!