So I’m working on my current project and reading up on the easiest or rather more reliable way to save data without it being tampered with. Now for the most part I’m not worried about tampering because most of my projects are literally played locally with friends. But I wanted this one to be more in depth. So I started up my project and started adding assets and now I’ve reached the coding part.
So after reading and watching videos I find I start to pick up on how to save information and then load information to an extent. But the part that stumps me is I guess array style of information. I start to think about how to do what I need and then I get myself confused and end up starting from scratch re-reading what I’ve already read or watching what I’ve already watched.
What I’m trying to do is determine in the menu (which is the first thing that pops up) whether the player has any characters, and if so it pulls up the male or female model with the corresponding character stats, skills, and most of all, character design (hair, face, and eye color). If the player does not have a character, then it gives the option to create one. So the issue I’m having is how to set up not only the ability to detect if the player has a character, but how many, allow selection, allow creation, and get each ones info when selected in menu.
So what I was hoping is someone would help me understand what it is I need to do to achieve this. I’m trying to do this in C# as my past projects were mixed in coding between JS and C#. So i’m trying to get in the habit of making it all C#.
It depends on how much you want to show about each character, but I use arrays to make it more managable, just search the store for playerprefsplus, it’s free.
Say you want to allow 3 save files, and you have 10 stats for each one, I would just make an array for each file and call them array+number or something like that. You could store the number of arrays in an int. You probably want to use different types of arrays but just do the same for the others. So each save file will be tied to a number or a string.
Ah that’s a good idea. Limit it to 3 and save each one as it’s own. That’s a better idea than what I was thinking.
For some reason I was thinking about saving the number of characters into and array and then somehow saving their information in there as well. But the idea of pulling specific info from that sounded like a nightmare on finding the right stuff. Keeping each character separate is a better idea and probably easier to fall back on.