I actually just spent a while beating my head against this exact same problem. I'm no coding pro, and someone else will probably have a better answer for you, but I made it work using ArachneJericho's solution in
this thread.
To make it work, in your script file you need
Code: Select all
init python:
# If persistent.endings is None (the first pass through the game), then make it a set.
if persistent.endings is None:
persistent.endings = set()
which, to my understanding, basically gives your end flags a place to go. Then, for each of your endings, you need to add a persistent flag alike-so:
Code: Select all
$ persistent.endings.add("Name Of Ending")
Then, in your screens.rpy, you need to add this block:
Code: Select all
screen endings:
tag menu
use navigation
$ all_endings = [(1, "Ending 1 Name"), (2, "Ending 2 Name")]
### you can put in as many endings as you need to, just keep this same format (#, "Name"),
frame:
style_group "pref"
vbox:
##I added these three lines of spacing and a title so the text would be centered and spaced out, mostly because my game had a high resolution and not a ton of endings, so it looked weird all squished in the upper left corner
spacing 10
xalign 0.5
yalign 0.5
text("Unlocked Endings")
###The really important part is down here vv
for ending in all_endings:
$ ending_number = ending[0]
$ ending_name = ending[1]
$ ending_string = "% 2d. ---------------------------------" % (ending_number,)
if ending_name in persistent.endings:
$ ending_string = "% 2d. %s" % (ending_number, ending_name)
text ending_string
The bit at the bottom basically takes all your information (the endings the player has gotten, the ending number, and the ending name) and puts them all in the proper order in the proper place. It's a really basic, simple text formatted list (with a #---------------- for endings the player hasn't gotten yet), but it gets the job done. Oh, and you also need to add a button to navigate to this screen in the first place. I just added an extra button to the main menu:
Code: Select all
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Endings") action ShowMenu("endings")
##^^ Like this. It will direct to "screen endings:"
textbutton _("Help") action Help()
textbutton _("Quit") action Quit(confirm=False)
Hope this helps!