play_sound missing type

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Handelfix
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Jan 09, 2019 12:23 pm
Contact:

play_sound missing type

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: play_sound missing type

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Handelfix
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Jan 09, 2019 12:23 pm
Contact:

Re: play_sound missing type

Post 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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: play_sound missing type

Post by Rseding91 »

The audio category is defined in the prototype so you can't specify a new category runtime.
If you want to get ahold of me I'm almost always on Discord.

Handelfix
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Jan 09, 2019 12:23 pm
Contact:

Re: play_sound missing type

Post 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?

Post Reply

Return to “Modding interface requests”