Cumbersome in this use case, but it isn’t actually ever used.
My game creates all the character data before we get into game mode / grid manager, so when loading player units, it loads from the save file. In the picture I linked above, that is the false side of a branch checking for that save data. And in early development, I just load a few characters as if they were placed on the grid.
So since I have to save each stat individually, I iterate over the arrays of the save file data and create the characters. Granted yes, the stats will likely be generated by the items the character has equipped, this is more just a proof of concept.
I create Starter Tile objects that are placed in the grid manager, and use their locations to map starting locations for the loaded character units. I select, from the top of the saved character list, one by one to place on those tiles. For example, if I have 2 starting grid locations, I pull the top two character’s save data and load them onto the map on those two tiles. In the same way, If I had N starting tiles, I select first N characters to place on those tiles. A simple Is Valid() check on the retrieved character data array avoids any problems trying to fill a character start tile with an invalid character.
Do note, that Skills are still not saving since I have not remedied the array of arrays issue, but i’ll look more into the structs. Or maybe i’ll do a list of Boolean values for “know skill” for each skill in the game, and if they know the skill add it to their list of skills here.
My desired result:
Save character data if it doesn’t exist
Load desired battle map / game manager
Load character data/skills/items
place units on grid
do the battle
Save experience gains / new items acquired for all player units
I also need to keep in mind if I make/want multiplayer (which I will probably wait for your implementation) I will have to change both the save data with game state. I haven’t researched it much yet.