[Solved] Save/Load a large amount of objects

I’m working on a game similar to a mix Stardew Valley and Slime Rancher where you grow flowers and raise different kinds of bees.

I have set up a 6x6 grid of plots where the player can plant flowers. I have assigned each an object variable called “ID” and each plot has its own ID of 1-36 corresponding to its spot on the grid. When the player plants a flower on top of a plot that plot is told the ID of the kind of flower planted on top and also stores at what growth stage the flower is (0-3, 0 Seed, 3 Fully Grown), and how many times a bee has come to collect pollen from this flower.

Is there an easy way to save all of the data (Flower ID, Growth Stage, Pollen Count) for all 36 at once, and also load it easily as well.

I know that I use can separate events to write each variable separately in a storage and to load each variable separately to a scene variable and then convert them back Into object variables but that is an incredibly large amount of work to do, especially when I plan to add larger systems (such as machines that can make candles from beeswax among other things) in the future. Before I force myself to sit here for an ungodly number of hours blocking out that wall off code, I want to make sure there’s not an easier way to do it.

I don’t know how to use JSON files at this time but if that is an easier way to to do it I definitely will learn it.

Just looking for some advice on how to tackle this, thanks for any assistance.

You can put all your variables under one big variable structure to make the loading easier, here is a vid, and that may make things a bit easier when loading/saving from what you describe :slight_smile:

That is exactly what I’m looking for, thank you very much! I am incredibly glad I asked if there was an easier way to do that didn’t waste hours doing that the hard way. Thank you very much.

2 Likes