I return once more with familiar questions, after changing things around in my code a bit, and getting stuck again… one day I will hopefully get it into my noggin.
I have a group of resources called “item” with their own variables, all stored in a bigger variable called “inventory”. Inventory is defined in an autoload script, so it can be accessed everywhere.
I add things to the inventory with a “get_item” button, that seems to work halfway:
When “_on_get_item” is called, it appears to still hold and access all the data in the Item just fine, when doing the test print. But maybe it doesn’t carry over to the next “update” function as well, as I get an error on line 27 here:
Inventory.inventory is an array, holding the item resources.
The item resources are set up like this:
The inventory array has them added through the Resource Group addon, so I don’t have to do it manually. It’s set up in the inventory autoload like this, if it helps:
Oh! You’re right, the group is in the same folder as the items. I just tried moving it, and now I don’t get the error. Everything works, adding in the children with the correct data and all.
Thank you so much for the time to go through it for me! I was sure I had entered some code wrong, not just placed the group in the wrong place.