Page 1 of 1

Preferences Screen Not Affecting the Volume of Custom Channels

Posted: Wed Oct 10, 2018 11:21 am
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)