Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
label start:
$ persistent.gasterend = 0
$ persistent.Freshend = None
$ persistent.killerend = None
if persistent.gasterend == True:
menu:
"Reset":
$ persistent.Freshend = False
$ persistent.killerend = False
return
"return":
return
else:
jump start_2
label start_2:
scene bg room
show GF 1
GF"Hello, world."
show GF 2
GF"You've created a new Ren'Py game."
GF"Once you add a story, pictures, and music, you can release it to the world!"
if persistent.freshend == True and persistent.killerend == True:
jump c
else:
jump b
label b:
menu:
"fresh end":
$ persistent.freshend = True
$ renpy.save_persistent()
jump freshending
"killer end":
$ persistent.killerend = True
$ renpy.save_persistent()
jump freshending
label c:
menu:
"gaster end":
$ persistent.gasterend += 1
$ renpy.save_persistent()
if persistent.gasterend == 1:
jump gasterending
if persistent.gasterend > 1
jump gasterending2
"fresh end":
$ persistent.freshend = True
jump freshending
"killer end":
$ persistent.killerend = True
jump freshending
label gasterending:
"gaster end"
return
label gasterending2:
"gaster end2"
return
label freshending:
"fresh/killer end"
return
So what I'm trying to do is once you get all the endings you have the option to choose gasters end, once you get gasters end you can do a restart except for gaster, gasters ending cannot be reset
Last edited by BreathingColors on Wed Jan 09, 2019 5:08 pm, edited 2 times in total.
# Define all variables before the start label with default
define persistent.gasterend = 0
define persistent.Freshend = None
define persistent.killerend = None
label start:
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Persistents work the same way with default and define, so both are correct. I think "default" is probably the better one to use, since it's semantically closer to what's happening.
Supporting creators since 2004 (When was the last time you backed up your game?)
Thanks for the info PyTom, the Changelog seemed to imply that persistent variables should use define...knowing that I can use default for everything makes my life easier. The difference between default and define isn't very clearly articulated in the documentation.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
It's possible it's an older changelog. Define came first, and default second.
Generally, nowadays, if something can change, use default. If something can't (a character or constant), use define. In fact, changing something that's been defined can lead to problems, as Ren'Py is willing to optimize variables set using define.
Supporting creators since 2004 (When was the last time you backed up your game?)