Have your game generate a password to import multiple game-info into one game

The question whether or not it is possible to import multiple games into one has been asked a few times.

So far it is not possible to import two separate save files, but here’s a bit of code that let’s you generate a password people can put into a game alongside a loaded save to have your characters meet:

Questions:

Gender:
*fake_choice
   #male
      *set gender 1
   #female
      *set gender 2
   #non-binary
      *set gender 3

Race:
*fake_choice
   #human
      *set race 1
   #cat
      *set race 2

Eyes:
*fake_choice
   #blue
      *set eyes "blue"
   #green
      *set eyes "green"
   #red
      *set eyes "red"

I used the above questions to set things. In your game the source for the generating below would, of course, be the various variables.

Now onto the generating:

*if (gender =1)
   *set password "1"
   *goto passnext1
*elseif (gender =2)
   *set password "2"
   *goto passnext1
*else
   *set password "3"
   *goto passnext1

*label passnext1
*if (race =1)
   *set password "${password}1"
   *goto passnext2
*else
   *set password "${password}2"
   *goto passnext2

*label passnext2
*if (eyes ="blue")
   *set password "${password}1"
   *goto passnext3
*elseif (eyes ="green")
   *set password "${password}2"
   *goto passnext3
*else
   *set password "${password}3"
   *goto passnext3

*label passnext3
Your password is $!{password}

This is the subroutine you can have running in game 1.

Let’s say you then have game 3, which is a sequel to game 2 (which is not a sequel to game 1)
You’d load a save from game 2, and game 3 would then prompt the player to enter their password from game 1 if they have one:

Enter password
*input_text password2

*label check1
*if ("${password2#1}" =1)
   *set gender2 1
   *goto check2
*if ("${password2#1}" =2)
   *set gender2 2
   *goto check2
*if ("${password2#1}" =3)
   *set gender2 3
   *goto check2

*label check2
*if ("${password2#2}" =1)
   *set race2 1
   *goto check3
*if ("${password2#2}" =2)
   *set race2 2
   *goto check3

*label check3
*if ("${password2#3}" =1)
   *set eyes2 "blue"
   *goto check4
*if ("${password2#3}" =2)
   *set eyes2 "green"
   *goto check4
*if ("${password2#3}" =3)
   *set eyes2 "red"
   *goto check4

This can be used to set all the variables for game1’s MC AND their continuity. the player would only have to enter names manually.

(below is ‘check4’ which I used to make sure everything works as intended)

*label check4

You were a @{gender male| female| non-binary} @{race human| cat} with ${eyes} eyes.

Now you are a @{gender2 male| female| non-binary} @{race2 human| cat} with ${eyes2} eyes.

*ending

For variable with more than 10 or 11 possibilities, you can have the game generate a two digit number: 01 (equalling first option) 11 (equalling 11) etc:

*if ("${password2#4}" =0)
   *if ("${password2#5}" =1)
      *set thing2 "firstoption"

etc

you can also add dashes into the password for easier readability, like
12301-567
and continue the positioncheck at

*if ("${password2#7}" =1)
   *set thisthing "this"

while it’ll take a while to code a subroutine, this way you can carry over all info about an MC AND their continuity even if you cannot load a save from their game.

Enjoy.

15 Likes

Neat :+1::grinning:

I’ve played around with this topic a little bit and have built two working demos for saving and sharing data.

Not sure if you’ll find them useful for your endeavour but linking them so you can peruse the code if you’re interested.

The first generates a string to pass between games. This was for a multiplayer game but can easily be used to port information between different games. As noted in the thread, converting the information to number codes (as you have done) will make the code simpler.

The second has a working example of saving and loading data.

2 Likes

I’ve been thinking about this kind of mechanic system for a while but never fully finished it. Damn, thanks mate!
I see this as an alternative from default Password-based save system that already existed before in Choicescript, but more specific to certain variable.

1 Like

@Sinnie @N4MI

Those are interesting (good work sinnie) but I dare say as much a hassle as my system can be it allows for something these methods don’t (yet?)

thoroughness. Like, the passwordsystem that’s build in doesn’t allow for variables to have the same name.
So, if game 2 and game 1 use the same variable names, there’ll be an issue.

Also, I just realized… I think what I typed up there allows for an even bigger number of games to come together D=

This is a work of genius!
The concept is so simple and elegant.
I wonder if the Sergeiverse would be brought together as a whole by this method.

1 Like

Credit where it’s due, the speculation about if it would have been possible to do what a lot of people hoped/expected is what brought us to this.

And I’d say: Yes, but it’d need some smoothing out of the code before that, to even out variables and continuity. But I’d say it’d be possible.

1 Like