I have a resource called Inventory and that resource has an array of items, each of team is a resources.
export(Array, Resource) var items = [null, null, null, null]
The resource that i use for items has a lot of info: textures, strings, booleans...
I'm implementing a save/load data script that uses JSON. My problem is that when i save, my json looks like this.
{"inventory":{"items":["[Resource:1370]","[Resource:1395]","[Resource:1395]","[Resource:1395]"]}}
That means when i load i don't get the resource that i want but instead the literal String "Resource:XXXX".
A solution i have for this is save using an unique identifier like and id (int) or a string instead of the whole resource, then use a Match statement and load the corresponding resource.
Is there another straightforward way to do this? I feel like my solution is not flexible at all, if i want to add a lot of items i have to keep updating the paterns of the match .