Page 1 of 1

play_sound missing type

Posted: Wed Jan 09, 2019 12:31 pm
by Handelfix
TL;DR
The modding API missing type of sound to play which results in mods throw alerts use audio config of effect-sounds.

What ?
Suggestion is just to add "type" to the api call (player.play_sounds not sure if game.play_sounds require it too, as there it all might be alerts?) to specify an enum what type of audi it is (gui, effect, walk, environment, alert).
Why ?
Having a mod which throw alerts (turrets nearly dead like endgame combat does) can be very annoying and makes the audio option menu a little bit senseless.
With the above type mods could specify the type and map to correct option of sound volume.

Re: play_sound missing type

Posted: Wed Jan 09, 2019 3:22 pm
by Rseding91
You can play any sound you want and it just plays the sound. It doesn't care what it was originally meant for. The audio category is defined in the prototype so you can't specify a new category runtime.

Re: play_sound missing type

Posted: Sat Jan 12, 2019 10:30 am
by Handelfix
It doesn't care what it was originally meant for.
Yep and this is why I ask for addition of type. It would be enough to specify of the existing ones. As said if a mod plays alerts it would be nice to use play_sound(type=alert, .... ) to map to volume of alerts of audio settings. No new categories - this maybe would be done in mod settings but if it's already exist like alert sound level would it be wise to move the level to mods - maybe 1,2,3,... however this would spread the setting in copy to many other places while it exist already.

Another solution would be: how to access the set volume level? So mods could read it and calculate against volume_modifier=.


And why this all? Well having mods play alerts without care what it was meant for removes the reason of separate sliders in audio menu. Just one slider main volume would do it else?

Re: play_sound missing type

Posted: Sat Jan 12, 2019 8:54 pm
by Rseding91
The audio category is defined in the prototype so you can't specify a new category runtime.

Re: play_sound missing type

Posted: Mon Jan 14, 2019 8:34 pm
by Handelfix
so the preferred solution here would be create an mod option soundlevel_for_alerts [1 100] and do something like

play_sounds(... volume_modifier=(factor * soundlevel_for_alerts / 100))

instead of suggested:

play_sounds(type=alert, ...) -- tells the call use alert audio level of main settings

correct?