Persistent Data across multiple games.
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.
Persistent Data across multiple games.
The current project I'm working on is released in very small installments. However, since they are starting to have multiple endings, I need a way to keep the continuity intact. How can I make it so that someone's persistent data in a previous visual novel could be checked by a new visual novel and determine what story they get?
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: Persistent Data across multiple games.
That should be it, thank you. But I'm a bit confused about how to use it exactly. Is it an automatic thing? Or does the player have to load something?
Re: Persistent Data across multiple games.
I admit that I haven't quite figured it out yet either. Maybe someone can help me with the MultiPersistent Data.
Here is what I want to do: I'm working on a visual novel with different branches, depending on the users choices.
I split the novel into chapters. So, let's say the user gets to make a first choice in chapter one. Chapter one is released in January. The second chapter is released one month later but the game should "remember" what choice the user made in chapter 1. Depending on the choice, the storylines will be different, so it's important that chapter 2 picks it up right.
As I understood, the MultiPersistent Data is the right thing for that. I checked out the Ren'Py Wiki, but I'm not quite sure how to apply the feature.
So, here is my Chapter 1 game:
Chapter 2 game
Okay, I copied the persistent-variables from the wiki, but I don't really understand how to use them. So I'm almost certain that a code like that wouldn't work. Could anyone help me out here?
Here is what I want to do: I'm working on a visual novel with different branches, depending on the users choices.
I split the novel into chapters. So, let's say the user gets to make a first choice in chapter one. Chapter one is released in January. The second chapter is released one month later but the game should "remember" what choice the user made in chapter 1. Depending on the choice, the storylines will be different, so it's important that chapter 2 picks it up right.
As I understood, the MultiPersistent Data is the right thing for that. I checked out the Ren'Py Wiki, but I'm not quite sure how to apply the feature.
So, here is my Chapter 1 game:
Code: Select all
init:
character block
background images block
$ mp = MultiPersistent("chapter1_game.org")
label start:
# code for game
# ...
# First choice to be made:
"Greg" "Will you help me?"
menu:
"Yes"
Jump yes
"No"
Jump no
label yes:
$ accepted = "positiv"
"Greg" "Awesome!"
jump epilog
label no:
$ notaccepted = "negativ"
"Greg" "What a pity."
jump epilog
$ mp.beat_part_1 = True
$ mp.save()
label epilog:
"I wonder if I made the right choice".
return
Chapter 2 game
Code: Select all
init:
character block
background images block
$ mp = MultiPersistent("chapter1_game.org")
label start:
if mp.beat_part_1:
"Since I help Greg everything turned out just fine for me."
else:
"Why didn't I help Greg? My life has become a nightmare ever since."
Re: Persistent Data across multiple games.
Okay, thanks to the help of someone, I think this is solved.
Game 1:
Game 2:
I tested it and it worked
.
Game 1:
Code: Select all
init:
$ mp = MultiPersistent("insertnamehere.com")
label start:
# Code for game
menu:
"Yes.":
jump yes
"No.":
jump no
label yes:
$ mp.yes1 = True
$ mp.no1 = False
$ mp.save()
$ accepted = "positiv"
"Greg" "Awesome!"
jump to newlocation
label no:
$ mp.yes1 = False
$ mp.no1 = True
$ mp.save()
$ notaccepted = "negativ"
"Greg" "What a pity!"
jump to newloaction
label newlocation:
# more Code
$ mp.beat_part_1 = True
$ mp.save()
return
Game 2:
Code: Select all
init:
$ mp = MultiPersistent("insertnamehere.com")
label start:
if mp.yes1:
jump yes
else:
jump no
label yes:
#Storyarch A
"Since I help Greg everything turned out just fine for me."
#jump to another location or return to main menu
label no:
# Storyarch B
"Why didn't I help Greg? My life has become a nightmare ever since."
#jump to ...
Who is online
Users browsing this forum: Bing [Bot], TioNick