Changing the links on the Main Menu
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.
Changing the links on the Main Menu
Okay, the newbie’s back again… I tried to look up how to do this stuff on the site, but I couldn’t find everything I needed, and a lot of it was confusing, so… help?
I want to change the stuff on my main menu. I know how to change the looks with the image map (sort of), but I want to change the actual links. I want to keep Load, Start, Quit, and Preferences, but I want to add About (which would lead to a screen with options to see about the game, about renpy, and about the company/creator), Extras (CG Gallery, a couple 'deleted scenes' from the game, probably a few other things, like character bios- and a lot of these would have conditions to unlock), and a Help that doesn’t lead to the site, but to a game help screen I’ll create.
I know how to do… none of this, basically. Help?
I want to change the stuff on my main menu. I know how to change the looks with the image map (sort of), but I want to change the actual links. I want to keep Load, Start, Quit, and Preferences, but I want to add About (which would lead to a screen with options to see about the game, about renpy, and about the company/creator), Extras (CG Gallery, a couple 'deleted scenes' from the game, probably a few other things, like character bios- and a lot of these would have conditions to unlock), and a Help that doesn’t lead to the site, but to a game help screen I’ll create.
I know how to do… none of this, basically. Help?
-
- Veteran
- Posts: 284
- Joined: Fri Dec 28, 2007 5:47 am
- Location: Where the Dragons rule!
- Contact:
Re: Changing the links on the Main Menu
In options.rpy, do your main menu:
This is example from my kinetic novel. Let me explain:
- you can add as much buttons as you need this way
- "story1_ch0" was something I did to clarify where the game starts (usually it would just be "start" instead)
- the second line, I conditioned the showing of this button by asking if there's a savegame file present. If not, the button will not be shown (this is when you run the game for the first time)
- so, you get it: first part is the name of the button, then second part is a link to it, and third is a condition under which the button is shown, otherwise it's hidden.
I know it's not using imagemaps, I actually haven't dabbled with them, this works just fine for me.
Code: Select all
config.main_menu = [
(u"Start", "story1_ch0", "True"),
(u"Continue", "_continue", "True", 'renpy.can_load("1")'),
(u"Preferences", _intra_jumps("preferences_screen", "main_game_transition"), "True"),
(u"Exit", ui.callsinnewcontext("quit_prompt"), "True")
]
- you can add as much buttons as you need this way
- "story1_ch0" was something I did to clarify where the game starts (usually it would just be "start" instead)
- the second line, I conditioned the showing of this button by asking if there's a savegame file present. If not, the button will not be shown (this is when you run the game for the first time)
- so, you get it: first part is the name of the button, then second part is a link to it, and third is a condition under which the button is shown, otherwise it's hidden.
I know it's not using imagemaps, I actually haven't dabbled with them, this works just fine for me.
Angels of paradise, angels of sacrifice
Please let me be under your wings...
Please let me be under your wings...
Re: Changing the links on the Main Menu
I tried to modify my code, but I got an error.
Here's what I used:
Here's the traceback:
Aside from the obvious question of what I did wrong (I did create labels for 'extras' and 'about'), what's a tuple?
Here's what I used:
Code: Select all
config.main_menu = [
(u"New Game", "start", "True"),
(u"Load Game", _intra_jumps("load_screen", "main_game_transition"), "True"),
(u"Preferences", _intra_jumps("preferences_screen", "main_game_transition"), "True"),
(u"Extras", "extras", "True"),
(u"About", "about", "True")
(u"Quit", ui.jumps("_quit"), "True")
]
Code: Select all
I'm sorry, but an exception occured while executing your Ren'Py
script.
TypeError: 'tuple' object is not callable
While executing init code:
- script at line 10 of C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\Test/game/options.rpy
- python at line 150 of C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\Test/game/options.rpy.
-- Full Traceback ------------------------------------------------------------
File "C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\renpy\bootstrap.py", line 247, in bootstrap
File "C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\renpy\main.py", line 253, in main
File "C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\renpy\execution.py", line 199, in run
File "C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\renpy\ast.py", line 554, in execute
File "C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\renpy\python.py", line 880, in py_exec_bytecode
File "C:\Users\Laura\Desktop\Renpy\renpy-6.8.0\Test/game/options.rpy", line 150, in <module>
TypeError: 'tuple' object is not callable
While executing init code:
Ren'Py Version: Ren'Py 6.8.0f
- PyTom
- Ren'Py Creator
- Posts: 16088
- 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: Changing the links on the Main Menu
You left out a comma at the end of the line containing About.
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?)
Software > Drama • https://www.patreon.com/renpytom
Re: Changing the links on the Main Menu
*facepalm*
Figures it's something like that...
Okay, that just leaves the Extras. How can I put unlocking conditions on things? Not just the CG gallery (although I need help there too...) but other things, like character bios or deleted scenes?
If this is too off from my first problem, just say so and I'll make a new topic for it.
Thanks.
Figures it's something like that...
Okay, that just leaves the Extras. How can I put unlocking conditions on things? Not just the CG gallery (although I need help there too...) but other things, like character bios or deleted scenes?
If this is too off from my first problem, just say so and I'll make a new topic for it.
Thanks.
-
- Veteran
- Posts: 284
- Joined: Fri Dec 28, 2007 5:47 am
- Location: Where the Dragons rule!
- Contact:
Re: Changing the links on the Main Menu
The last part of the tuple is the condition which must be True to show the button. Say, if you put a variable x there (just for an example), then when in script you say x=True, the button will show up.
Angels of paradise, angels of sacrifice
Please let me be under your wings...
Please let me be under your wings...
Re: Changing the links on the Main Menu
Thanks; that clears a few things up. (I wonder why it's called that, though...?)
-
- Veteran
- Posts: 284
- Joined: Fri Dec 28, 2007 5:47 am
- Location: Where the Dragons rule!
- Contact:
Re: Changing the links on the Main Menu
What, tuple?
Angels of paradise, angels of sacrifice
Please let me be under your wings...
Please let me be under your wings...
Re: Changing the links on the Main Menu
Yeah. I'm sure there's a reason for it, but 'tuple'? To my uneducated eyes, it sort of looks like a pokemon name... though at least that means I'll hopefully remember it.
- PyTom
- Ren'Py Creator
- Posts: 16088
- 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: Changing the links on the Main Menu
Two thing are a pair.
Three things are a triple.
Four things are a quadruple.
Five things are a quintuple.
Six things are a sextuple.
Seven things are a septuple.
Eight things are an octuple.
n things are an n-tuple, so we call any ordered collection of things with finite size a tuple.
(That being said, it would make a good name for a pokémon that could break into multiple parts.)
Three things are a triple.
Four things are a quadruple.
Five things are a quintuple.
Six things are a sextuple.
Seven things are a septuple.
Eight things are an octuple.
n things are an n-tuple, so we call any ordered collection of things with finite size a tuple.
(That being said, it would make a good name for a pokémon that could break into multiple parts.)
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?)
Software > Drama • https://www.patreon.com/renpytom
Re: Changing the links on the Main Menu
That makes more sense. Thanks!
Who is online
Users browsing this forum: Ahrefs [Bot]