Okay, I’ll run a test:
Filled in some values (Before saving). Currently selected slot: a
After saving. Slot a didn’t change, but an entirely new field of parameters appeared in the Saves structure instead of saving to a specific slot. It even grabbed the “CurrentSlot” value and put that in there. If I change to a different slot, it simply changes the “CurrentSlot” value in saves.
After shutting down the preview and booting it back up again. The values from before are still saved in those parameters, but not loading in properly. Loading and deleting does absolutely nothing to any of the code or stored values.
Here’s all the code again, with all the updates:
I have a feeling that simply storing it in Saves isn’t going to work as intended. Do I need to add an expression to specify which slot to save it to?
Edit: Here’s the global variable structure too if it helps:
--------------------UPDATE--------------------
I’ve changed the code to look like this now:
As a result, saving now works! It now properly saves to the selected slot!
However, as you can see in the screenshot above, the CurrentSlot value is added as a child of the structure, which ideally I don’t want. Will I need to move it outside of the GameState variable?
Also, loading is still kind of finicky…
Here I have all 3 slots filled up with something. When I restart the scene, everything stays loaded in their slots:
But once I close the preview and relaunch it:
Only slot a has it’s values stored. Slot b and c were wiped.
In fact, slot a literally stole the values from slot c???
Deleting still doesn’t work properly, but it’s likely because I still have some of it’s code disabled for now. We’ll cross that bridge when we get there.
I’ll keep tinkering, but do you have any pointers?