(SOLVED)Scene variable not saving to storage

I can not for the life of me figure out why my scene variable (which contains inventory data) is not saving to storage. i’m trying to make the inventory of my player save and persist through game restart, and be loaded automatically on game start.

*What is the expected result

when i press the save and quit button, the saveInventory variable should have its configuration changed so that it is included in “mainSave” profile. then the inventory “inventory” should be saved to that variable, then a save state should be made with the key “mainSave” under the “mainSave” profile, which should include that variable. Then after 3 seconds the game quits, as it’s supposed to.

then, at the beginning of the scene, after some initialization stuff unrelated to my issue, the save should be loaded, including that variable, and then the inventory should be loaded from that variable.

What is the actual result

Saving supposedly works, then the game quits. upon game boot-up, the inventory never loads.

Related screenshots

save code:


load code:

Project files (optional)

Insert a minimal game showing your issue in a .zip or .rar.

I feel bad posting this post and then not needing it two hours later, but i got it figured out. if anyone else wants to know how i did it, it’s explained in the gdevelop documentation for saving and loading inventories

1 Like

Don’t feel bad!
All posts on the GDevelop Forum are helpful, as people can look back on them later and find solutions to their problems!

1 Like