I have music volume slider in the game's GUI but it's always set to the max volume. How can I change it? I consulted manual and found it can be done manually. I want the slider to be in the middle position by the default so I put:
System.Volume = 50;
in the first room load code. But it doesn't change the slider. It's still set on max.
And this is my slider code:
function sldMusic_OnChange(GUIControl *control)
{
// SetMusicMasterVolume(sldMusic.Value);
Game.SetAudioTypeVolume(eAudioTypeMusic, sldMusic.Value, eVolExistingAndFuture);
Err, none of your examples show how you set the slider itself. Slider is not magically bound to some system values.
You should have something like:
sldMusic.Value = System.Volume;
or
sldMusic.Value = 50;
You should also update the slider every time sound volume is changed by other means (e.g. from script); or, alternatively, when options GUI is about to show up.
E: I want to also point out that "System.Volume" is not the same as "music volume", it's rather "master volume".
Thanks for the help CW!