Ren'Py In-game SFX is still playing on [Main Menu]

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Ren'Py In-game SFX is still playing on [Main Menu]

#1 Post by [Admin-C] » Wed Nov 15, 2017 10:56 am

Hello everyone,

I may need some help today regarding SFX. Apparently, whenever I head over to the Main Menu, the current SFX that is being played in the story is still playing even if you are no longer in the story mode.

I heard that there is a stop play script but I don't know any commands on where to put it.

This is the code that I currently have at the start of the game.

Code: Select all

 scene black with Pause(1)
    play sound ("SFX/chirpingBirds.wav") fadeout 1.0
    scene Gym with fade
    show sample
I was wondering if there is a way that I can end the SFX if ever a player or myself decide to go to the Main Menu regardless if the sound that is being played is over or not.

Any help would be very much appreciated.

User avatar
NineBells
Newbie
Posts: 9
Joined: Mon Jun 05, 2017 9:01 am
Projects: https://ninebells.wordpress.com/current-projects/
Location: Some place where it's GMT+8
Contact:

Re: Ren'Py In-game SFX is still playing on [Main Menu]

#2 Post by NineBells » Wed Nov 15, 2017 11:04 am

Try adding

Code: Select all

Stop("sound")
into the action of the button you use to go to the main menu.
Hi. I'm a programmer. I'm currently available for short or simple projects. Check out my thread here.

Want to see how I work? Check out my blog!

One of my teams also has a blog here. Check it out for updates on our game TLH: Freud Was Right.

User avatar
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Re: Ren'Py In-game SFX is still playing on [Main Menu]

#3 Post by [Admin-C] » Wed Nov 15, 2017 12:02 pm

Hello NineBells,

Thank you for your reply, I have tried your suggestion but I only end up receiving an error. I don't know if the exact codes were right or if I placed the codes correctly. Regardless of this, kindly see the following codes below and let me know the error(s) that is in my script.

From screens.rpy

Code: Select all

screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing

        if main_menu:

            textbutton _("Start") action Start()
            Stop("SFX/chirpingBirds.wav")
I am guessing that I might have placed it in the wrong part of the scripts but please show me an example of where to put it.

Thank you in advance!

User avatar
NineBells
Newbie
Posts: 9
Joined: Mon Jun 05, 2017 9:01 am
Projects: https://ninebells.wordpress.com/current-projects/
Location: Some place where it's GMT+8
Contact:

Re: Ren'Py In-game SFX is still playing on [Main Menu]

#4 Post by NineBells » Wed Nov 15, 2017 12:07 pm

Try this:

Code: Select all

textbutton _("Start") action [Stop("sound"), Start()]
Hi. I'm a programmer. I'm currently available for short or simple projects. Check out my thread here.

Want to see how I work? Check out my blog!

One of my teams also has a blog here. Check it out for updates on our game TLH: Freud Was Right.

User avatar
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Re: Ren'Py In-game SFX is still playing on [Main Menu]

#5 Post by [Admin-C] » Wed Nov 15, 2017 1:30 pm

NineBells wrote:
Wed Nov 15, 2017 12:07 pm
Try this:

Code: Select all

textbutton _("Start") action [Stop("sound"), Start()]
Hello NineBells,

I am very pleased to let you know that this part has worked!

I can now able to stop ongoing sounds that are still playing when heading back to the Main Menu. However, the sounds are already being cut-off during the confirmation dialogue box (asking you to confirm your decision to go to the Main Menu). As for that, I cannot find the codes for the confirmation box in any of my scripts. I tried tracing the confirmation dialogue but I couldn't find it.

Below is the sample of the confirmation dialogue box that I am talking about.
Image

I hope you could help me out on this one. Thank you in advance!

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1948
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Ren'Py In-game SFX is still playing on [Main Menu]

#6 Post by Imperf3kt » Wed Nov 15, 2017 4:15 pm

It might be better to stop the sounds using the "on show" command withing the main menu?

I can't think of a way right now, but the documentation may have some clues.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Re: Ren'Py In-game SFX is still playing on [Main Menu]

#7 Post by [Admin-C] » Sun Dec 10, 2017 11:47 am

Imperf3kt wrote:
Wed Nov 15, 2017 4:15 pm
It might be better to stop the sounds using the "on show" command withing the main menu?

I can't think of a way right now, but the documentation may have some clues.
Hello Imperf3kt,

I apologize for the late reply as I was so caught up with my irl job. I find the documentation to bear less information on what I need I'm afraid. However, upon checking some of the recently solved threads related to my concern, I found some helpful tips for fixing my problems. Regardless, thank you for your reply and I appreciate it very much!

Post Reply

Who is online

Users browsing this forum: No registered users