So I have started work on a save system using only a single string.
If a mission hasn't been completed then its value is 0, if it's been completed in victory then the value is 1, if its been failed then the value is 2.
So if mission one was failed, mission two, and three were completed, and the player is currently on mission four...
Then the string would look like this: 2 1 1 0
Now, once the string is made, its very easy to get the information I want. I can just use Word of String to know the past outcome of any given mission.
So if I want to know if the player failed mission three, I could just ask If Word 3 of String == 2.
The problem I am having is saving the string. It doesn't seem like there is a Word of String function to save to just one specific part of a string.
I have to load each part of the string separately from the bank, and then re-save the entire string each time I want to update a single part of it.
And I need a different trigger for every mission since it's a different word in the string for each mission.
Saving each mission to it's own key seems tedious, but my main concern is it might exceed the file size limit for banks, so I am trying to avoid that. In addition to missions I also have weapons, items, and unlocks I want to save. So it's important that it's compressed as much as possible.
There has got to be a better way. If anyone has any advice it would be very helpful. Even if it's an entirely different way to go about it. Thanks.
Just put the string together from substrings. Since you always store <value><space><value>... each mission uses two "letters" of the string. so if you want to update status of mission "x", set savestring = substring(oldSavestring, 0, x-1) +"<value x> "+substring(oldSavestring, x+2, length(oldSavestring)).
So I have started work on a save system using only a single string. If a mission hasn't been completed then its value is 0, if it's been completed in victory then the value is 1, if its been failed then the value is 2.
So if mission one was failed, mission two, and three were completed, and the player is currently on mission four... Then the string would look like this: 2 1 1 0
Now, once the string is made, its very easy to get the information I want. I can just use Word of String to know the past outcome of any given mission. So if I want to know if the player failed mission three, I could just ask If Word 3 of String == 2.
The problem I am having is saving the string. It doesn't seem like there is a Word of String function to save to just one specific part of a string. I have to load each part of the string separately from the bank, and then re-save the entire string each time I want to update a single part of it. And I need a different trigger for every mission since it's a different word in the string for each mission.
Saving each mission to it's own key seems tedious, but my main concern is it might exceed the file size limit for banks, so I am trying to avoid that. In addition to missions I also have weapons, items, and unlocks I want to save. So it's important that it's compressed as much as possible.
There has got to be a better way. If anyone has any advice it would be very helpful. Even if it's an entirely different way to go about it. Thanks.
Just put the string together from substrings. Since you always store <value><space><value>... each mission uses two "letters" of the string. so if you want to update status of mission "x", set savestring = substring(oldSavestring, 0, x-1) +"<value x> "+substring(oldSavestring, x+2, length(oldSavestring)).
I had no idea that was a way to use substrings. You just drastically improved my quality of life.