Get music volume from ACS

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Kzer-Za
Posts: 521
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Get music volume from ACS

Post by Kzer-Za »

Music volume can be set with SetMusicVolume, but how can I get it? I want to first save the initial music volume to a variable, and only after that change the volume, so that later I can return the volume to its initial level.
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: Get music volume from ACS

Post by Logan MTM »

There is no "GetMusicVolume" in ACS. Perhaps ZScrip.
Kzer-Za
Posts: 521
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Get music volume from ACS

Post by Kzer-Za »

I think I figured out how to do it. Admittedly it won't detect changes made by SetMusicVolume, but I want to detect only the initial volume, which is set by game settings, so for this goal it would be enough:

Code: Select all

InitialMusicVolume = GetCVar("snd_musicvolume");
Post Reply

Return to “Scripting”