A list of endings
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.
-
Smobey
A list of endings
Well, what I basically want is a list of endings seen that you can access through the main menu. I can create the button in the main menu and such alright, but basically, I have two questions:
1. I want that the actual names of the endings aren't visible until you've gotten them. How do I do this?
2. I have an overlay with the character's status and various menu buttons, showing them all at the bottom of the screen. It wouldn't be good if you could see them in the ending list screen. How would I go about making them invisible?
Thanks for your advice.
1. I want that the actual names of the endings aren't visible until you've gotten them. How do I do this?
2. I have an overlay with the character's status and various menu buttons, showing them all at the bottom of the screen. It wouldn't be good if you could see them in the ending list screen. How would I go about making them invisible?
Thanks for your advice.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: A list of endings
Do you want a list of endings, or do you want the endings to be buttons that, when pressed, bring the user to that ending?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- EvilDragon
- Veteran
- Posts: 284
- Joined: Fri Dec 28, 2007 5:47 am
- Location: Where the Dragons rule!
- Contact:
Re: A list of endings
I think he needs only text names, which will be shown only after the player got the certain ending. Like in Tsukihime, for example.
Angels of paradise, angels of sacrifice
Please let me be under your wings...
Please let me be under your wings...
-
Smobey
Re: A list of endings
I was thinking about the buttons at first, but simple text would probably be better. I intend to list all the bad endings too, so it's a pretty long list, probably spanning multiple pages.
Oh, and I figured out how to hide the overlays and such by myself.
Basically, what I want, would be something like...
ENDINGS:
???
???
???
???
???
???
???
???
???
???
-> To page 2
-> Return to title
Oh, and I figured out how to hide the overlays and such by myself.
Basically, what I want, would be something like...
ENDINGS:
???
???
???
???
???
???
???
???
???
???
-> To page 2
-> Return to title
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: A list of endings
First, the common code. Since I'm lazy, I put the code to display an ending in a function, and call that repeatedly.
The code for the first ending list pages.
Finally, this code would have to occur at each ending.
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()
# This shows a single ending, as necessary.
def show_ending(number, name):
if name in persistent.endings:
ui.text("% 2d. %s" % (number, name))
else:
ui.text("% 2d. ---------------------------------" % (number,))
# Add a button that brings people to the ending list to the main menu.
config.main_menu.insert(2, ("Endings", "endings_1", "True"))
# Jump here to return to the main menu.
label endings_return:
return
Code: Select all
label endings_1:
scene bg endings_1
$ ui.vbox()
$ show_ending(1, "True Ending")
$ show_ending(2, "False Ending")
$ show_ending(3, "Best Ending")
# ...
$ show_ending(12, "Etcetera.")
# $ ui.textbutton("Previous Page", clicked=ui.jumps("endings_0")
$ ui.textbutton("Next Page", clicked=ui.jumps("endings_2")
$ ui.textbutton("Return", clicked=ui.jumps("endings_return")
$ ui.close()
$ ui.interact(suppress_overlay=True)
Code: Select all
label true_ending:
$ persistent.endings.add("True Ending")
".:. True Ending"
return
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: A list of endings
I would think that the main label, having so many Python calls, should be replaced with a label that just calls a Python routine giving those commands. (Also... the ui.interact line at the end is improperly indented, which will give an error. I expect that PyTom is going to edit that as soon as he finds out.)
(EDIT: It was indentation, not justification. Also, PyTom did fix it.)
Also, if there's a way to give dynamic text or string variables in standard menus, perhaps that would be an easier and safer way to do it. Personally, that's one thing I wanted to do with one of my projects. There could be a multi-choice menu, with one or more having a string variable for a weapon name, such as "Pick Up Dead Guy's Sword". I'd been getting errors, but that was before I was getting string declarations in script correct in the first place.
The way this one would work would be to set up a series of if statements that would set string variables for the ending names to either the ending's name or "???". After that, call a menu using those variables instead of just the ending's names. At the end of each page, give the Next Page, Prev Page, and Main Menu options.
Alternatively, you could use the Menu If. For each ending, there would be two lines in the menu. One would be if the ending was gotten, and one would be if the ending hasn't yet been.
Of course, if you decide to use graphical menus, everything I just typed is moot, except possibly the first paragraph. The best way is through Python.
Oh, and could someone tell me whether this reply was actually usable? I don't mean "Someone took it and implemented it," but rather "This makes sense, I could do this simple enough." Thanks. I'd like to know whether or not I'm making an impact when I post or if I just crater myself.
(EDIT: It was indentation, not justification. Also, PyTom did fix it.)
Also, if there's a way to give dynamic text or string variables in standard menus, perhaps that would be an easier and safer way to do it. Personally, that's one thing I wanted to do with one of my projects. There could be a multi-choice menu, with one or more having a string variable for a weapon name, such as "Pick Up Dead Guy's Sword". I'd been getting errors, but that was before I was getting string declarations in script correct in the first place.
The way this one would work would be to set up a series of if statements that would set string variables for the ending names to either the ending's name or "???". After that, call a menu using those variables instead of just the ending's names. At the end of each page, give the Next Page, Prev Page, and Main Menu options.
Alternatively, you could use the Menu If. For each ending, there would be two lines in the menu. One would be if the ending was gotten, and one would be if the ending hasn't yet been.
Of course, if you decide to use graphical menus, everything I just typed is moot, except possibly the first paragraph. The best way is through Python.
Oh, and could someone tell me whether this reply was actually usable? I don't mean "Someone took it and implemented it," but rather "This makes sense, I could do this simple enough." Thanks. I'd like to know whether or not I'm making an impact when I post or if I just crater myself.
Last edited by Formedras on Sat Nov 15, 2008 2:35 am, edited 2 times in total.
-
Guest
Re: A list of endings
Thanks PyTom, that worked well for me. There was something wonky with the buttons, but I brutalized it a bit and got it working.
Formedras, I understood that only partly. I'm not familiar with Ren'Py yet at all, and all the python is gonna take some time to get used to. Though, the menu if part made sense, and I would have probably made it that way if not for PyTom.
Formedras, I understood that only partly. I'm not familiar with Ren'Py yet at all, and all the python is gonna take some time to get used to. Though, the menu if part made sense, and I would have probably made it that way if not for PyTom.
Who is online
Users browsing this forum: Bing [Bot], Ocelot, Sergei Falcon
