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.
I have a volume bar permanently displayed on the screen as part of the interface to make it more convenient for the player to change the volume at any time without having to go to the preference screen.
bar value Preference("music volume") range (80) xmaximum 80 ymaximum 10 thumb "soundbarthumb" thumb_shadow None thumb_offset 5 left_bar "soundbar_full" right_bar "soundbar_empty"
The problem is, it works for either only music or only sound effects and I want the player to be able to change the overall volume of the game (anything that makes a sound) with this slider (those who want more precise control could still access music and sound effects separately from the preferences screen).
Is there a way to have 'Music Volume' and 'Sound Volume' controlled by the same slider (setting two values to one bar)? Or is there some kind of an overall 'Volume' preference that affects all channels? Or some other method to achieve this?
Last edited by rinrin on Thu Jun 28, 2012 6:42 am, edited 2 times in total.
Update:
A strange bug occurs from time to time ever since I implemented that code. I can't reproduce it every time and have no idea what triggers it, so I'll just describe it: sometimes when I start the game, the volume bar (the one on the picture in the first post) is set to maximum, but no sound can be heard. If I move it a bit to the left, sound "activates" and works normally (doesn't stop if I pull the slider back to maximum).
It happened at least 3 times so far (not in the same session).
Does anyone have an idea what could be causing this and how to fix it?
Here's the code, just in case I implemented it wrong: