In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
-
[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:
#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.
-
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:
#2
Post
by NineBells » Wed Nov 15, 2017 11:04 am
Try adding
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.
-
[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:
#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!
-
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:
#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.
-
[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:
#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.
I hope you could help me out on this one. Thank you in advance!
-
Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
-
Contact:
#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.
Current project:
GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
-
[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:
#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!
Users browsing this forum: No registered users