Persistent Data for Multiple Playthroughs
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 for Multiple Playthroughs
Essentially, I'm looking for a way to activate a "switch" (I'm using true/false statements) in the first playthrough of my game that will be effect the game the second time it is loaded and played from the main menu.
I want to add in a bonus ending that is only available after all other endings have been found.
I have seen it in practice in the game DeIz, so I know it's possible, I just haven't found any info on it.
Thanks in advance!
I want to add in a bonus ending that is only available after all other endings have been found.
I have seen it in practice in the game DeIz, so I know it's possible, I just haven't found any info on it.
Thanks in advance!
- Sorakun
- Regular
- Posts: 103
- Joined: Sun Oct 20, 2013 10:02 pm
- Completed: Techno Titans, Blood Metal Exorcism, Tom Cruiser, Mechadin, UPlay
- IRC Nick: Sorakun
- Skype: sora.ch4n
- Contact:
Re: Persistent Data for Multiple Playthroughs
There are a lot of ways to do this,
Using true/false statements is one way of doing it,
you could also create a variable that would change its value depending on what ending you finished
There is no correct way of doing it.
Also by your statement it sounds like you have the solution so may i ask what it is exactly that you haven't figured out yet?
Using true/false statements is one way of doing it,
you could also create a variable that would change its value depending on what ending you finished
There is no correct way of doing it.
Also by your statement it sounds like you have the solution so may i ask what it is exactly that you haven't figured out yet?
- xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Contact:
Re: Persistent Data for Multiple Playthroughs
You can use persistent variables that remain when the game is closed.
At the end of an ending:
when you want to check:
or if you want to present it when every end has been played:
At the end of an ending:
Code: Select all
$ persistent.ending_1 = TrueCode: Select all
if persistent.ending_1:
jump bonus_contentCode: Select all
if persistent.ending_1 and persistent.ending_2 and ...more endings...:
jump bonusComunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: Persistent Data for Multiple Playthroughs
That's the method I tried. I keep coming up with this error whenever it reaches the "If" line (114):
I have "$ end01 = True" during one of the endings.
It seems like the problem is that once the game reaches the If statement, it has an error because 'end01' isn't defined yet. I can't pre-define it, because then it'd just reset every time a new game started. Is it necessary to name it 'persistent.ending'?
Lines 114-115 are:File "game\script.rpy", line 114, in script
File "game\script.rpy", line 114, in python
NameError: name 'end01' is not defined
Code: Select all
if end01:
jump bonus_endingIt seems like the problem is that once the game reaches the If statement, it has an error because 'end01' isn't defined yet. I can't pre-define it, because then it'd just reset every time a new game started. Is it necessary to name it 'persistent.ending'?
Last edited by Taylor on Sun Nov 03, 2013 8:14 pm, edited 2 times in total.
Re: Persistent Data for Multiple Playthroughs
Yeah, persistent variables need to be declared as such. It should be
and
Code: Select all
if persistent.end01:
jump bonus_endingCode: Select all
$ persistent.end01 = TrueRe: Persistent Data for Multiple Playthroughs
I just made the edit and everything seems to be working fine now. Thanks!
Who is online
Users browsing this forum: Bing [Bot]