I have taken his script, translated it into English & have added various modifications & bug fixes to it!
º active handle image on mouse button hold. º play sound/speech file accordingly depending on volume type when mouse button released (sliders) or on left click (-|+ buttons) º added various print messages to log -- comment them out if you don't want them. º quick fix to prevent slider from moving randomly (occurred when you moved mouse out of action area too fast) º translated the German comments into English as well as the variables etc & added my own comments too.
the print statements will add messages along the lines of these to the messages.txt log file:
17:08:08: volume script has been started!
17:12:22: speech volume is now set at 90 - button
17:12:23: speech volume is now set at 100 - button
17:12:25: sound volume is now set at 100 - button
17:12:26: sound volume is now set at 90 - button
17:12:28: music Volume is now set at 50 - button
17:12:29: music Volume is now set at 60 - button
17:12:56: music volume is now set at 60 - slider
17:12:59: sound volume is now set at 89 - slider
17:13:02: speech volume is now set at 100 - slider
I made it so they added "button" or "slider" after the message so you know which print is from what section of the script. º button = the plus | minus volume buttons º slider = dragging the handle across the volume bar.
quick note: if you have a config.ini file in the root folder it will automatically read/write the volume level data to & from it without you needing to add any script to do so!
# MusicVolume|SoundVolume|SpeechVolume = int value {0-100}
MusicVolume = 60
SoundVolume = 89
SpeechVolume = 100
ok so let's get on with explaining how the script works shall we
-- * the main script * --
the main script is a definition script meaning it loads the info inside when we launch the game/player [.exe] so all we need to do is call the functions from inside an object action using "execute a script" then calling a function like so: beginVolCon() which looked like "function beginVolCon()" inside of the script.
you can also write custom scripts inside of the "execute a script" action which we'll show you a bit later.
right on with deciphering the script:
-- * the editor stuff * --
-- * links & so on * --
you can get the ... main script from: here project file from: here (18.7mb approx)
& here are some refs I used: getVolume, setVolume, startAction, StartAnimation & einzelkaempfer's slider script
in other words it started the animations for the active handles on the far left of the sliders!
to prevent this I have added a new condition; "allow_btn_hold" which is set to true whenever the cursor enters a sliders object area & false on mouse out.
simple fix
uploading new version now!
links are fixed on both here & the LUA thread now.
safe