Ok, the whole topic of multi-persistence has me a bit confused. I don't exactly get when and where I have to use it. So here's what I want to do: I want to make a game that has a lot of different variables to it, and release it to players. I then want to make more of that game, more features, more elements to it. The second version would not be a sequel to the first, it would be more of an expansion pack. What I want is for people to be able to download the second one, run it, and either start from scratch, presenting an experience just like the first one, only with more options, or to just load up existing saves from the first version, and they will work, carrying over any variables and progress they have made allowing them to continue as if they'd been playing the second version the entire time.
So how does that work? Do I need to use multi-persistent variables? If I have a ton of different variables used to check various things, such as:
$ Playername = "Hero"
$ P_Income = 10
$ P_HP = 0
$ P_XP = 0
$ P_Lvl = 0
$ P_Traits = []
Do I have to always list those things as "$ mp.P_Lvl = 0" or something every time they're used? does this screw up the ability to swtich between saves? Does this screw up the ability to start from scratch if you want, save, and then revert to a previous save with different stats? I'm just not sure how this is meant to work.
Multi-Persistence and mutliple versions
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: Multi-Persistence and mutliple versions
Pretty sure that's not going to work on base Renpy. As you pointed out, multipersistent (or persistent, for that matter) is not per save file, it's per game, so if you used multipersistent, you would effectively only be able to have one save per game. You can get around starting from scratch by having a mechanism to return all multipersistent variables to default, but still one save. Using regular save files and variables doesn't seem like it would fly either, since the expanded game would have variables that don't exist in the save file.
I mean, maybe the one thing I could think of is having an after_load label that sets all variables to a default value if they don't exist (e.g., something like the following http://stackoverflow.com/questions/8432 ... -in-python ), but I don't know how feasible that would be once you go beyond simple variables.
I mean, maybe the one thing I could think of is having an after_load label that sets all variables to a default value if they don't exist (e.g., something like the following http://stackoverflow.com/questions/8432 ... -in-python ), but I don't know how feasible that would be once you go beyond simple variables.
Re: Multi-Persistence and mutliple versions
Hmm, so could I maybe add an "import/export" function to the game? Add an "export" function that players can click on in game 1, which would pass all the current variables to multi-persistent, and then when they open the second game they could click "import" and it would move all those mp versions back to local, while also keeping all the new variables exclusive to the new version?