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.
-
Panda_nui
- Regular
- Posts: 44
- Joined: Mon Jul 02, 2012 10:48 am
- Projects: re:_night
- Location: in your closet
-
Contact:
#1
Post
by Panda_nui » Wed Jun 04, 2014 3:42 am
So right now, i've succeeded in creating a decent raining effect in my game and it's time to add the sound effect.
The thing is the sound effect for the rain only lasts for a few seconds and i have a whole rain scene.
Code: Select all
play sound "music/sfx/rain.wav" loop
This code only plays for the few seconds and I was wondering if there was any way to loop or make that sound effect continue even after that 3 seconds of sfx ended.
Thank you in advance!
Last edited by
Panda_nui on Wed Jun 04, 2014 11:22 am, edited 1 time in total.
-
Asceai
- Eileen-Class Veteran
- Posts: 1258
- Joined: Fri Sep 21, 2007 7:13 am
- Projects: a battle engine
-
Contact:
#3
Post
by Asceai » Wed Jun 04, 2014 5:37 am
Congratulations, you've found a bug.
You can get around it by using python instead.
$renpy.sound.play("music/sfx/rain.wav", loop=True)
-
Donmai
- Eileen-Class Veteran
- Posts: 1919
- 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:
#4
Post
by Donmai » Wed Jun 04, 2014 7:56 am
LRH is right. You can define an 'ambient' sound channel with sound looping enabled, exactly like the music channel:
Code: Select all
$ renpy.music.register_channel("ambient","sfx",True,tight=True)
Then you can simultaneously use the 'music' channel to play a sad piano tune, the 'ambient' channel to play the rain noise, and the 'sound' channel to play a thunder sound from time to time.

-
Panda_nui
- Regular
- Posts: 44
- Joined: Mon Jul 02, 2012 10:48 am
- Projects: re:_night
- Location: in your closet
-
Contact:
#5
Post
by Panda_nui » Wed Jun 04, 2014 11:23 am
jksdfas Q7Q <33
@Asceai I used the code you showed me and it worked perfectly!

D
thank you so much for the help everyone!!
Users browsing this forum: Google [Bot]