Let the music play after the game is finished?

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
Sheridan
Regular
Posts: 77
Joined: Sat Nov 03, 2012 9:18 am
Completed: Tea & Sympathy, 51 cards
Contact:

Let the music play after the game is finished?

#1 Post by Sheridan » Thu Dec 06, 2012 5:50 am

Is there a way to keep the music playing after the game is finished and you return to the menu? I don't want to start the piece over, since it's rather long; I just want it to continue playing after the end of the credits.

Thanks!

User avatar
saguaro
Miko-Class Veteran
Posts: 557
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Projects: ?
Organization: Lucky Special Games
Tumblr: saguarofoo
itch: saguarofoo
Location: USA
Contact:

Re: Let the music play after the game is finished?

#2 Post by saguaro » Thu Dec 06, 2012 8:49 am

There is no pause/resume for music that I am aware of. If you know exactly how long the music plays during the credits, you could set up the main menu to play a shortened version that picks up where the credits version leaves off after the game is beaten. You'd need a persistent variable to trigger this.

User avatar
Sheridan
Regular
Posts: 77
Joined: Sat Nov 03, 2012 9:18 am
Completed: Tea & Sympathy, 51 cards
Contact:

Re: Let the music play after the game is finished?

#3 Post by Sheridan » Thu Dec 06, 2012 9:09 am

Bummer. I can't do something based on how long the credits are, since it's the same piece playing through the whole game (it's a long piece of music and a very short kinetic novel). But I think I can work something out. Thanks!

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: Let the music play after the game is finished?

#4 Post by Levrex » Thu Dec 06, 2012 10:52 am

Use Play function with if_changed=True, maybe?
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

User avatar
Sheridan
Regular
Posts: 77
Joined: Sat Nov 03, 2012 9:18 am
Completed: Tea & Sympathy, 51 cards
Contact:

Re: Let the music play after the game is finished?

#5 Post by Sheridan » Thu Dec 06, 2012 10:49 pm

Levrex wrote:Use Play function with if_changed=True, maybe?
I'm not sure how to do this. What I worked out so far is:
if persistent.ending == "End":
config.main_menu_music = "[music]"
Where [music] is a bit of the BGM that I've chopped off and saved as a separate file. But that only plays the music upon restarting the game, not upon returning to the menu after the end credits.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: Let the music play after the game is finished?

#6 Post by Levrex » Fri Dec 07, 2012 4:21 am

Sheridan wrote:
Levrex wrote:Use Play function with if_changed=True, maybe?
I'm not sure how to do this. What I worked out so far is:
if persistent.ending == "End":
config.main_menu_music = "[music]"
Where [music] is a bit of the BGM that I've chopped off and saved as a separate file. But that only plays the music upon restarting the game, not upon returning to the menu after the end credits.
If it is stored in init python hide part, then of course.
Well, it's pretty understandable that you don't know, it ain't documented nowhere.

It's the same as this, just can be put into screens as an action.
http://www.renpy.org/wiki/renpy/doc/ref ... music.play

Code: Select all

    on "show" action Play("music", NAMEOFYOURMUSICGOESHERE, loop=True, fadeout=0.5, if_changed=True)
    on "replace" action Play("music", NAMEOFYOURMUSICGOESHERE, loop=True, fadeout=0.5, if_changed=True)
So, what basically ye'll possibly need to do (success isn't guaranteed) is:
1) Change your main menu upon completion as read here:
http://www.renpy.org/wiki/renpy/doc/coo ... g_the_game
(The step isn't required if your main menu music is not changed, whether you complete the game or not.)
2) Put the above actions in that one main menu screen which will the player see when he completes the game.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

User avatar
Sheridan
Regular
Posts: 77
Joined: Sat Nov 03, 2012 9:18 am
Completed: Tea & Sympathy, 51 cards
Contact:

Re: Let the music play after the game is finished?

#7 Post by Sheridan » Fri Dec 07, 2012 6:18 am

Thank you so much! This isn't exactly what I envisioned but it's very, very close.

Post Reply

Who is online

Users browsing this forum: Google [Bot]