Ren'Py Making a Season 2

monkeyposter_7

Thirsty for my Guest
Game Developer
Nov 23, 2018
330
1,180
So i want to split my game into season 2. So that the saves (all the variables) from season 1 work. A new folder that doesnt require you to have season 1, just the save files.
Is this possible in renpy? I don't even know what to search for a guide on making such a thing.

EDIT: nevermind, figured it out
 
Last edited:

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,198
3,674
" EDIT: nevermind, figured it out "

If you have some time, I'm sure other developers (or those who want to be) would like to hear what solution you found.
 

monkeyposter_7

Thirsty for my Guest
Game Developer
Nov 23, 2018
330
1,180
Well, actually, it wasn't me. I hired a coder to do this haha
It's like you make a save at end of game, and import save at the start of "new game" aka season 2
In season 2 (a completely new game, new folder, new save location etc etc) instead of "new game" button, you have import, and you just import your save.

I suck at coding, don't know anything besides the basic things i need to code dialog and such. Things i need for the game. So I'm sure some coders could explain this and get into it more. It's something about transferring/exporting your variables and such
 
  • Love
Reactions: osanaiko

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,278
15,108
Well, actually, it wasn't me. I hired a coder to do this haha
It's like you make a save at end of game, and import save at the start of "new game" aka season 2
In season 2 (a completely new game, new folder, new save location etc etc) instead of "new game" button, you have import, and you just import your save.

There's easier way to do than this. Either you want to clean the variables to keep only the more significant one, and then you can use the designed especially for this. Or you want to keep it as simple as possible, and you just need to end one season in a particular label, then have a label with the same name as starting point for the next season :
[season 1]
Code:
label ToContinue:
    "It's the end, save here please, and see you soon."
    return
[season 2]
Code:
default someVariableFromSeason1 = [Some average value for those who haven't played the game]
[Repeat for all the variables you want to keep from the season1]

label start:
    "Welcome to 'Thirsty For My Guest'."
    "Too bad, you haven't played the first season of our game."
    jump season2Start

label ToContinue:
    "Welcome back, faithful player."
    "We hope that you'll like the season 2 as much as you like the first one."
    [Here potentially clean some variables]
    jump season2Start

label season2Start:
   [the game effectively start here]
If the player start a new game, he'll pass through the start label, and play with what you decided to be the generic values for the season1 variables.
If the player load from a game, he'll pass through the ToContinue label, and play with the values present in the save file.

The only constraint is to ensure that the value of config.save_directory, which is defined in the "options.rpy" file, is the same for the two games.


Splitting a game between more than one Ren'py entity isn't more complicated than this.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,567
2,192
I was going to say the same... Use .

Include this code in both games...

Python:
init python:
    tfmg_mp = MultiPersistent("thirsty4myguest.f95zone.to")
The name used only has to be unique. Using one that looks like a domain name is the recommended style.

Then at the end of season one, have something that "saves" the variables you care about to the shared space...
(variables picked at random).

Python:
label end_of_season1:

    if renpy.variant("pc"):
        python:
            tfmg_mp.s1_player = player
            tfmg_mp.s1_day9laurensdaddy = day9laurensdaddy
            tfmg_mp.s1_day11vanessaprivacyissues  = day11vanessaprivacyissues
            # etc

            tfmg_mp.save()
As far as I know, multi-persistence doesn't work on either Android or iOS. Which is why I've coded it to only work with "pc" (which covers Windows, Mac and Linux).

Unlike normal variable spaces, multi-persistence isn't automatically saved. So you have to do it with code.

Then at the beginning of season 2, copy the values from the shared space, back into variables used by the new game.
(Keep in mind, you may end up with players who only play season 2, without playing season 1).

If the mp variables haven't been set, they have a value of None (a bit like True or False).

So, within your "season 2" game, you'd have something like...

Python:
default player = None

# set values, making "best" assumptions for players who haven't played season 1.
default s1_day9laurensdaddy = True
default s1_day11vanessaprivacyissues = False

# etc

label start:

    if tfmg_mp.s1_day9laurensdaddy != None: # if one mp variable exists, chances are they all do.
        python:
            s1_day9laurensdaddy = tfmg_mp.s1_day9laurensdaddy
            s1_day11vanessaprivacyissues = tfmg_mp.s1_day11vanessaprivacyissues
            # etc

    # some more code....

    if tfmg_mp.s1_player != None:
        menu:
            "Would you like to continue to use the name [tfmg_mp.s1_player] for Season 2 too?"
            "Yes":
                $ player = tfmg_mp.s1_player
            "No":
                pass


    if player == None:
        $ player = renpy.input("Enter your name: {i}(The default is James){/i}", length=20)
        $ player = player.strip() or "James"

    # onward...
I've copied the values from the multi-persistent space instead of using them directly purely to cope with those players who won't have played season 1. It also makes it easier to reference variables from this game, rather than checking if multi-persistent variables exist all the time.
 
Last edited: