Hi there,
Is there any simple way to create a patch that will change a certain variable from all the saves?
What I am thinking about is to have a script that will run in the MainMenu and if we have the path to set a certain variable to true for all the saves, however if the patch is not there to set every variable to false.
Thank you
Comments
{
if (File.Exists (saveFile.fileName))
{
StreamReader r = File.OpenText (saveFile.fileName);
string _info = r.ReadToEnd ();
r.Close ();
_data = _info;
int divider = saveFileContents.IndexOf ("||");
string mainData = saveFileContents.Substring (0, divider);
string roomData = saveFileContents.Substring (divider + 2);
SaveData saveData = (SaveData) Serializer.DeserializeObject <SaveData> (mainData);
Debug.Log ("Saved variables data: " + saveData.mainData.variablesData);
}
}
You can then make the necessary change to variablesData (see the SaveSystem script's AssignVariables method on how this string is extracted normally), and then update the original save file:
string mainData = Serializer.SerializeObject <SaveData> (saveData, true);
string allData = mainData + "||" + roomData;
SaveSystem.SaveFileHandler.Save (saveFile, allData);
So what I need is a simple file that placed inside the game folder will make the difference between someone who paid 5$ and someone who paid 1$
That's the main idea.
I'm not sure if it's a thing I did or it's the way AC is created. I created a first episode for my game, made the release and then I came with a second one(added new variables, made new quests etc), however some of the players told me that they had problems if they continue with a previous save. The problems that they were describing sounded like some new variables where not set. So my question is. "Do you think it's the AC, maybe the system does not allow me to create new things and then continue, or I did something wrong with my variables? Maybe I didn't set them correctly. Should I do a script like the one you showed me above to set all the new variables on default values for each previous save?w