Main Menu Video breaks when trying to add music

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Main Menu Video breaks when trying to add music

#1 Post by Geckos » Wed Apr 04, 2018 1:45 pm

Hello!
This is the first time I've tried using a video for the background of the main menu for my game. It worked great until I tried adding music to the main menu using

Code: Select all

#config.main_menu_music = "music/mainmenu.ogg"
The moment I turn that line on, my game starts and 1) No music plays, 2) my menu buttons aren't there, and 3) the game doesn't have a cursor.

My menu is a 16s loop and the main menu theme is 1 minute 40 seconds, so I don't want to just add music to the video to fix it if I don't have to.

I've also taken a short recording of the game working, then closing and opening the game again with the new code and it doesn't work.
https://youtu.be/fK4JA4vahOI

Code for my main menu:

Code: Select all

screen main_menu():

    # This ensures that any other menu screen is replaced.
    tag menu

    add Movie(size=(1920, 1080))
    on "show" action Play("movie", "movies/potd2_menu.webm", loop=True)
    on "hide" action Stop("movie")
    on "replace" action Play("movie", "movies/potd2_menu.webm", loop=True)
    on "replaced" action Stop("movie")


    imagebutton auto "ui/play_%s.png" xpos 870 ypos 800 focus_mask None action Start()
    imagebutton auto "ui/load_%s.png" xpos 1180 ypos 850 focus_mask None action ShowMenu('load') 
    imagebutton auto "ui/options_%s.png" xpos 500 ypos 830 focus_mask None action ShowMenu('preferences') 
    imagebutton auto "ui/credits_%s.png" xpos 150 ypos 800 focus_mask None action ShowMenu('load')
    imagebutton auto "ui/quit_%s.png" xpos 1600 ypos 820 focus_mask None action Quit() 
    
   
Image ImageImage

salceous
Newbie
Posts: 19
Joined: Sun Apr 09, 2017 12:12 pm
itch: shuttt
Contact:

Re: Main Menu Video breaks when trying to add music

#2 Post by salceous » Wed Apr 04, 2018 4:05 pm

I'm not good at coding but try removing the # so

Code: Select all

config.main_menu_music = "music/mainmenu.ogg"

User avatar
rayminator
Miko-Class Veteran
Posts: 510
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

Re: Main Menu Video breaks when trying to add music

#3 Post by rayminator » Wed Apr 04, 2018 4:29 pm

salceous wrote:
Wed Apr 04, 2018 4:05 pm
I'm not good at coding but try removing the # so

Code: Select all

config.main_menu_music = "music/mainmenu.ogg"
when he removes the # sign his buttons disappears when he adds it back his buttons reappear
usually by putting the # it's suppose to cancel one line only not the other way around there might an error in renpy

maybe be best to show hole code

but here idea put the image buttons
in it own box

this only a guess

Code: Select all

screen main_menu():

    # This ensures that any other menu screen is replaced.
    tag menu

    add Movie(size=(1920, 1080))
    on "show" action Play("movie", "movies/potd2_menu.webm", loop=True)
    on "hide" action Stop("movie")
    on "replace" action Play("movie", "movies/potd2_menu.webm", loop=True)
    on "replaced" action Stop("movie")
    
    hbox:
	
    imagebutton auto "ui/play_%s.png" xpos 870 ypos 800 focus_mask None action Start()
    imagebutton auto "ui/load_%s.png" xpos 1180 ypos 850 focus_mask None action ShowMenu('load') 
    imagebutton auto "ui/options_%s.png" xpos 500 ypos 830 focus_mask None action ShowMenu('preferences') 
    imagebutton auto "ui/credits_%s.png" xpos 150 ypos 800 focus_mask None action ShowMenu('load')
    imagebutton auto "ui/quit_%s.png" xpos 1600 ypos 820 focus_mask None action Quit() 
when I try to help someone I point them into 2 direction what's right and wrong so they can learn how to

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: Main Menu Video breaks when trying to add music

#4 Post by Geckos » Tue May 01, 2018 9:46 am

No luck with that, so I think I'm just going to add a short version of the song to the video. I'm not sure what the issue is, and it's possible it's because my overall code is fairly old, but oh well!
Better luck next time and thanks for the help.
Image ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users