Skip to content

WIP: Additional CON commands to control music volume at runtime

Dino Bollinger requested to merge dibollinger/eduke32:music_control into master

I have experimented with some proof-of-concept commands to alter the music volume through CON scripts, in relation to issue #85:

setmusicvolume <vol>: Changes the music volume to the value in the argument, a value between 0 and 255. This is the same process as changing the volume in the options menu except that ud.config.MusicVolume is not altered. The intent for this command is to be able to temporarily lower the volume of music when specific sounds, most importantly character speech, needs to be audible. To prevent abuse, the music volume cannot be raised above the player's chosen music volume in ud.config.MusicVolume.

resetmusicvolume: Intended for use after lowering the music volume in a previous step. This sets the volume back to ud.config.MusicVolume, which may vary depending on the player's configuration.

I've tagged this as a WIP merge request as I would like to hear some feedback and thoughts on these potential CON commands first, and whether there are any potential problems or concerns. I've tested them both ingame and they seem to work, attached is a small example script to test it. Pressing alt-fire will change the music volume and back using the above commands.

musictest.con

Merge request reports