Trouble adding music to 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.
Trouble adding music to Main Menu
Hey, lovely people! I'd really appreciate if someone could help me with adding music to the main menu of my project.
I believe I followed all of the instructions I've seen online. In the options.rpy screen, like instructed, I've uncommented the main menu music line and replaced the title in quotes with the title of my music file. The line in options.rpy looks like this:
config.main_menu_music = "lazyafternoons.mp3"
The file itself is in the game folder, is titled exactly lazyafternoons, and is definitely an .mp3 file. Yet, when I try to Start the project I get this:
"Parsing the script failed.
File "game/options.rpy", line 63: expected statement.
config.main_menu_music ->= "lazyafternoons.mp3"
^
Ren'Py Version: Ren'Py 6.99.11.1749"
I've tried adding and deleting a space before the equals sign in case that was the problem. I've retyped the line myself in case there was a typo in formatting. I even replaced "lazyafternoons.mp3" with the name of another music file in the game folder to see if the problem was with the file. But nothing changes.
Also, I have this same track play in the game proper. When I comment this line so I can get back into the game, the music file plays absolutely fine in game when called to by "play music "lazyafternoons.mp3" "
Does anyone have any ideas for what I can try?
I believe I followed all of the instructions I've seen online. In the options.rpy screen, like instructed, I've uncommented the main menu music line and replaced the title in quotes with the title of my music file. The line in options.rpy looks like this:
config.main_menu_music = "lazyafternoons.mp3"
The file itself is in the game folder, is titled exactly lazyafternoons, and is definitely an .mp3 file. Yet, when I try to Start the project I get this:
"Parsing the script failed.
File "game/options.rpy", line 63: expected statement.
config.main_menu_music ->= "lazyafternoons.mp3"
^
Ren'Py Version: Ren'Py 6.99.11.1749"
I've tried adding and deleting a space before the equals sign in case that was the problem. I've retyped the line myself in case there was a typo in formatting. I even replaced "lazyafternoons.mp3" with the name of another music file in the game folder to see if the problem was with the file. But nothing changes.
Also, I have this same track play in the game proper. When I comment this line so I can get back into the game, the music file plays absolutely fine in game when called to by "play music "lazyafternoons.mp3" "
Does anyone have any ideas for what I can try?
- 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: Trouble adding music to Main Menu
Have you lost the 'define' that the line should start with?Zalsburry wrote: ↑Mon Jul 22, 2019 11:00 amHey, lovely people! I'd really appreciate if someone could help me with adding music to the main menu of my project.
I believe I followed all of the instructions I've seen online. In the options.rpy screen, like instructed, I've uncommented the main menu music line and replaced the title in quotes with the title of my music file. The line in options.rpy looks like this:
config.main_menu_music = "lazyafternoons.mp3"
---
Does anyone have any ideas for what I can try?
define config.main_menu_music = "lazyafternoons.mp3"
- Andredron
- Miko-Class Veteran
- Posts: 535
- Joined: Thu Dec 28, 2017 2:37 pm
- Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
- Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
- Location: Russia
- Contact:
Re: Trouble adding music to Main Menu
Code: Select all
screen main_menu():
python:
renpy.music.play("menu.mp3", fadeout=10.0, fadein=15.0)
frame:
....
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Help me to register in QQ International
Honest Critique
Help me to register in QQ International
Honest Critique
Re: Trouble adding music to Main Menu
Oh my goodness, thank you so much!! I don't know where along the line I lost "define" but I know I never would have realized it on my own, thank you. I added in "define" and now it works perfectly.
Thank you <3
Thank you <3
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Trouble adding music to Main Menu
If you go to options.rpy, there is a line that you can comment out that sets the music for the main menu
You don't need to add a command to the menu screen directly
Code: Select all
# define config.main_menu_music = "main-menu-theme.ogg"Who is online
Users browsing this forum: No registered users