Music playing from splash to mainmenu?

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
Dizzydude
Regular
Posts: 58
Joined: Mon May 26, 2014 8:40 pm
Projects: 「To Be Announced」
Location: U.S.A
Contact:

Music playing from splash to mainmenu?

#1 Post by Dizzydude »

How would I set it up so that the music plays from the splashscreen to the main menu without pausing or stopping? The way I have it now, it plays during the splashscreen, and then stops at the main menu.

Code: Select all

label splashscreen:
    play music "shosholoza.mp3" fadein 1.0
    scene bg black
    with Pause(1)

    show splash1 with fade
    with Pause(1)
    show splash2
    with Pause(1)
    show splash3
    with Pause(3)
I'm trying to complete this game as a gift before the end of today, and all that's left is the music. Help would be greatly appreciated! :D

User avatar
Ormgair
Newbie
Posts: 18
Joined: Sat Dec 27, 2014 9:42 am
Location: Saint-Petersburg,Russia
Contact:

Re: Music playing from splash to mainmenu?

#2 Post by Ormgair »

Not sure, but try this

Code: Select all

label splashscreen:
scene bg black
with Pause(1)
show splash1 with fade
with Pause(1)
show splash2
with Pause(1)
show splash3
with Pause(3)

label start:
play music "shosholoza.mp3"
fadein 1.0
#here is your splashscreen 
stop music 
#the moment when you need to stop music

User avatar
shivanshs9
Regular
Posts: 54
Joined: Sun Jul 20, 2014 1:59 pm
Projects: The Destiny(http://thedestiny-cxz.blogspot.com)
Organization: Cyber-X-Zone
Location: India
Contact:

Re: Music playing from splash to mainmenu?

#3 Post by shivanshs9 »

Well, it's kinda simple for the effect you want to generate... I will talk in terms of Ren'Py wiki for now...
"The play statement is used to play sound and music. If a file is currently playing, it is interrupted and replaced with the new file."
But, it was also written somewhere that if you provide the same filename, which is currently playing, the file will continue to play without pausing or stopping...
So, in terms of code now:

Code: Select all

label splashscreen:
    play music "shosholoza.mp3" fadein 1.0
    scene bg black
    with Pause(1)

    show splash1 with fade
    with Pause(1)
    show splash2
    with Pause(1)
    show splash3
    with Pause(3)
This was your original code... Now, in an init block, add:

Code: Select all

init -1 python:
    config.main_menu_music = "shosholoza.mp3"
You can find this option in options.rpy for setting Main Menu music...
Hope it helps!
"Destiny is a no matter of chance
It is a matter of choice
It is not a thing to be waited for
It is a thing to be achieved..."

-William Jennings Bryan
If you can dream and not make dreams your master;
If you can think and not make thoughts your aim,
If you can meet with Triumph and Disaster;
And treat those two impostors just the same,
Only then can you ever win against yourself...

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 playing from splash to mainmenu?

#4 Post by Donmai »

It works! Hahahahahahahahahahahaha! Thank you, shivanshs9. I've been scratching my head for months, trying to figure out how to do it, and the solution (as it often happens when using Ren'Py) was so simple! Thank you again. :)
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
shivanshs9
Regular
Posts: 54
Joined: Sun Jul 20, 2014 1:59 pm
Projects: The Destiny(http://thedestiny-cxz.blogspot.com)
Organization: Cyber-X-Zone
Location: India
Contact:

Re: Music playing from splash to mainmenu?

#5 Post by shivanshs9 »

Yeah, I can understand your emotions... It often happens with me too, you know. :lol:
So, I have simply come to accept it as a part of computer programming...
"Destiny is a no matter of chance
It is a matter of choice
It is not a thing to be waited for
It is a thing to be achieved..."

-William Jennings Bryan
If you can dream and not make dreams your master;
If you can think and not make thoughts your aim,
If you can meet with Triumph and Disaster;
And treat those two impostors just the same,
Only then can you ever win against yourself...

User avatar
Dizzydude
Regular
Posts: 58
Joined: Mon May 26, 2014 8:40 pm
Projects: 「To Be Announced」
Location: U.S.A
Contact:

Re: Music playing from splash to mainmenu?

#6 Post by Dizzydude »

Ah, thanks. Already completed the game gift-wise, but this is useful info ^^

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]