Music in Main Menu from Splashscreen (Solved!)

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
Heiden
Regular
Posts: 140
Joined: Sat May 11, 2013 3:20 pm
Completed: Elvine, The Life Threads, Helena's Flowers, Dr. Frank's Build-A-Boyfriend, Beyond the Deep, The Bog's Heart, The Girl With the Gray Hair Awakens, The Far Rings, NB107A
Projects: The Town Pages, Kill the Prince?! [Nano 2020]
Tumblr: heidengames
itch: Heiden
Contact:

Music in Main Menu from Splashscreen (Solved!)

#1 Post by Heiden »

Hi!

Is there a way to start a music track within the splashscreen that then rolls over into the main menu?

Ideally I'd like for the main menu screen to check to see if there is already a song playing and if yes then continue to play that song (without missing a beat), but if not, then it would start playing a song.

I wanted to do something like:

if renpy.music.is_playing(channel='music') == False:
play music ["music/folkinstrumental.mp3"] fadein 5.0

But the only way I know to fiddle with the music options in the main menu is through the define config.main_menu_music section in the Options file.

Thank you!
Last edited by Heiden on Sun Jan 28, 2018 12:16 pm, edited 1 time in total.
Completed: Elvine (GxB), The Life Threads, Helena's Flowers (GxG)(As Writer, Coder), Dr. Frank's Build-A-Boyfriend (BxB), Beyond the Deep (GxB)(As Artist), The Bog's Heart, The Girl with the Gray Hair Awakens, The Far Rings, NB107A.

All available to play on my itch.io page!

expenseroso
Regular
Posts: 28
Joined: Tue Mar 14, 2017 7:15 pm
Contact:

Re: Music in Main Menu from Splashscreen

#2 Post by expenseroso »

If your main menu music is the same file as the music you start in the splash screen it should simply continue without interruption--no need to do anything. Don't know if there's a way to test for music playing, but I believe using 'queue' instead of 'play' would work for the purposes you describe.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Music in Main Menu from Splashscreen

#3 Post by Donmai »

expenseroso is right. (Examples are from my game "The Other Question") You simply define your main menu song as usual.

Code: Select all

config.main_menu_music = "bgm/yeah.OGG"
Then you play the same song in your splash screen

Code: Select all

label splashscreen:
    scene black
    show logo:
        truecenter
    with Dissolve(1.0)
    play music "bgm/yeah.OGG" #same song played on the main menu
    scene black
    with Dissolve(2.0)
    return
Ren'Py will keep playing the song when reaching the main menu screen.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Heiden
Regular
Posts: 140
Joined: Sat May 11, 2013 3:20 pm
Completed: Elvine, The Life Threads, Helena's Flowers, Dr. Frank's Build-A-Boyfriend, Beyond the Deep, The Bog's Heart, The Girl With the Gray Hair Awakens, The Far Rings, NB107A
Projects: The Town Pages, Kill the Prince?! [Nano 2020]
Tumblr: heidengames
itch: Heiden
Contact:

Re: Music in Main Menu from Splashscreen

#4 Post by Heiden »

It worked! Thank you so much! :D
Completed: Elvine (GxB), The Life Threads, Helena's Flowers (GxG)(As Writer, Coder), Dr. Frank's Build-A-Boyfriend (BxB), Beyond the Deep (GxB)(As Artist), The Bog's Heart, The Girl with the Gray Hair Awakens, The Far Rings, NB107A.

All available to play on my itch.io page!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Sugar_and_rice