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.
-
Yuuji
- Regular
- Posts: 96
- Joined: Tue Jan 20, 2015 3:08 am
- Location: Russia, Perm
-
Contact:
#1
Post
by Yuuji » Wed Apr 08, 2015 7:35 am
Hello! I've written the following code:
Code: Select all
init:
$renpy.music.register_channel('voice', loop = False, file_prefix = 'voice/', file_suffix = '.ogg', mixer = 'voice')
$renpy.music.register_channel('se1', loop = False, file_prefix = 'se/', file_suffix = '.ogg', mixer = 'se')
init python:
def SEVolume(chanNumber, newValue, t):
renpy.music.set_volume(newValue, t, channel = 'se' + str(chanNumber))
def playVoice2(character, file):
store.current_voice = character + '/' + file
if persistent.voice_on:
if (character == 'sac'):
if persistent.sac_on:
renpy.music.set_volume(persistent.sac_volume, channel = 'voice')
renpy.music.play(character + '/' + file, channel = 'voice')
def playGameSE(file, channel_number, isLooped = False):
if persistent.se_on:
renpy.music.set_volume(1.0, channel = 'se' + str(channel_number))
renpy.music.play(filenames = str(file), channel = 'se' + str(channel_number), loop = isLooped)
label start:
$playGameSE('se120b', 1, True)
$SEVolume(1, 0.1, 0)
"Говоря это, я повернул вентиль крана."
yuu "«Кто-то пользовался этой комнатой до моего прибытия?»"
$playVoice2('sac', 'op_039')
sac "«Нет. В ней никто не жил по меньшей мере четыре месяца.»"
So, file 'se120b' begins to play in 'se1' channel looped, then 'se1' channel's volume is set to 0.1. It works. After that I go to yuu's phrase and then to sac's phrase. And when ren'py begins to play 'op_039' file in 'voice' channel, 'se1' channel begins to play that looped file with 'voice' channel's volume(1.0). And I absolutely don't understand why. Maybe you have any ideas?
Last edited by
Yuuji on Wed Apr 08, 2015 10:06 am, edited 1 time in total.
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.
-
Yuuji
- Regular
- Posts: 96
- Joined: Tue Jan 20, 2015 3:08 am
- Location: Russia, Perm
-
Contact:
#2
Post
by Yuuji » Wed Apr 08, 2015 10:06 am
I've found the answer for my question myself. I just assigned config.emphasize_audio_channels with empty list and now it works as I wish.
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.
Users browsing this forum: No registered users