Hi,
I'm trying to figure out (to no avail) how can I add an option to the options menu, specifically an option to choose which track a player would like to use for the main menu theme. I do not know how to add an option in general so I'm kinda puzzled right now.
Any help is appreciated.
Sincerely,
Joe
Adding a main menu music option to options screen
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.
Adding a main menu music option to options screen
Quandale Dingle Supremacy
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Adding a main menu music option to options screen
joehair wrote: ↑Sun Mar 13, 2022 11:36 pm Hi,
I'm trying to figure out (to no avail) how can I add an option to the options menu, specifically an option to choose which track a player would like to use for the main menu theme. I do not know how to add an option in general so I'm kinda puzzled right now.
Any help is appreciated.
Sincerely,
Joe
I take it that you are talking about preferences.
So you go to the screen.rpy file
Find
'screen preferences():'
go down to
## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
and you can add something like this
Code: Select all
vbox:
style_prefix "radio"
label _("Main Menu Music")
textbutton _("Track 1") action NullAction()
textbutton _("Track 2") action NullAction()
textbutton _("Track 3") action NullAction()
textbutton _("Track 4") action NullAction()
Changing the main menu music will have some complications depending on what you want to do.
Typically the player don't spend much time at the main menu, so this might not be a good thing to put too much work into.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Adding a main menu music option to options screen
I just do it this way:
Then you just set the value of the variable "m_music" in the usual ways (as an action or by setting it with python) to the name of the audio you want to use.
You may need to use a persistent variable if you want to set/change the music permanently (until it is changed again, at least)
Code: Select all
default m_music = None
screen main_menu():
tag menu
on "show" action Play("music", m_music)
You may need to use a persistent variable if you want to set/change the music permanently (until it is changed again, at least)
Last edited by Imperf3kt on Tue Mar 15, 2022 3:32 am, edited 2 times in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Adding a main menu music option to options screen
thanks guys! I'll report results after testing.
Quandale Dingle Supremacy
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]