Preferences Screen Not Affecting the Volume of Custom Channels

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
parttimestorier
Veteran
Posts: 429
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
Projects: Seeds of Dreams
itch: janetitor
Location: Canada
Contact:

Preferences Screen Not Affecting the Volume of Custom Channels

#1 Post by parttimestorier »

I created two custom music channels for my project so that I could have one song fade out while another one is already starting and things like that. I defined them like this:

Code: Select all

init python:
    renpy.music.register_channel("music1", loop=True)
    renpy.music.register_channel("music2", loop=True)
They work fine, but I've just realized that turning down the music volume in the preferences doesn't seem to affect those channels - presumably because it's configured to affect only the default "music" channel and not "music1" and music2". As far as I can figure out, the relevant part of the preferences screen is in screens.rpy and looks like this (it might be different than what it normally is in the default GUI since I'm using a premade creative commons one):

Code: Select all

bar pos (900, 155) value Preference("music volume") style "pref_slider"
Can I alter it to make that slider affect the volume of both "music1" and "music2"? I've tried just changing the ("music volume") part to things like ("music1 volume") to see what happens, but that doesn't seem to work.

Edit: Managed to figure this out myself actually! I just needed to add this:

Code: Select all

init python:
    renpy.music.register_channel("music1", mixer="music", loop=True)
    renpy.music.register_channel("music2", mixer="music", loop=True)
ImageImageImage

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Vamp-sama