Page 1 of 1

Main Menu Video breaks when trying to add music

Posted: Wed Apr 04, 2018 1:45 pm
by Geckos
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() 
    
   

Re: Main Menu Video breaks when trying to add music

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

Code: Select all

config.main_menu_music = "music/mainmenu.ogg"

Re: Main Menu Video breaks when trying to add music

Posted: Wed Apr 04, 2018 4:29 pm
by rayminator
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() 

Re: Main Menu Video breaks when trying to add music

Posted: Tue May 01, 2018 9:46 am
by Geckos
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.