Athena's Owl
Member
I'm doing some research right now on how to take my inventory system that uses a ds_grid and saving it properly using JSON (as I will be using cross platform eventually so not wanting to use ini). From what I've learned thus far is that I need to convert my ds_grid into a ds_map eventually to then save using json_encode. I'm fairly new to saving with JSON so I just wanted to ask the community more directly about the process.
One question I have about the process is whether I need to directly convert my ds_grid into a ds_map? ds_maps seem disorganized in nature, so should I first put my ds_grid into a ds_list? This way my data is organized in a particular order as my input and so that when I need to create and pull from my saved file I have the order just the same as I put it in.
I've also noticed through my research that I cannot use ds_grid_write as it doesn't support array data which I do have in regards to my inventory item stats that are assigned uniquely to each item.
What I imagine I must do is create a ds_list (17 values) and nest inside of it ds_maps (17 keys) with each map being a key of: (name, amount, description, object, sprite, etc.) then the map has a value of a nested ds_list in the specific order I want for input/output 0 = itemName00, 1 = itemName01, etc. From tutorials I watched it seems that nested ds_maps and ds_lists are appropriate and fine to do.
Thanks for any and all feedback
One question I have about the process is whether I need to directly convert my ds_grid into a ds_map? ds_maps seem disorganized in nature, so should I first put my ds_grid into a ds_list? This way my data is organized in a particular order as my input and so that when I need to create and pull from my saved file I have the order just the same as I put it in.
I've also noticed through my research that I cannot use ds_grid_write as it doesn't support array data which I do have in regards to my inventory item stats that are assigned uniquely to each item.
What I imagine I must do is create a ds_list (17 values) and nest inside of it ds_maps (17 keys) with each map being a key of: (name, amount, description, object, sprite, etc.) then the map has a value of a nested ds_list in the specific order I want for input/output 0 = itemName00, 1 = itemName01, etc. From tutorials I watched it seems that nested ds_maps and ds_lists are appropriate and fine to do.
Thanks for any and all feedback