Hm, I know some sounds are specified with a volume as well, my
guess would be that if it's not specified it defaults to 1 (or 100%), so if you were to use the data.raw to access where those sounds are defined and add a volume of less than 1 (or whatever the current is for that sound) it
might work...
so data.raw accesses are done in the following form:
data.raw["type"]["name"]["property"], if they do not contain a '-' then you can use a '.' instead of the full ["index_key"] syntax (ie: data.raw.type.name.property)..
Hopefully there aren't too many that you find too loud because it'd be a fairly boring process...
A full example (for the fast transport belt, from volume of 0.4 to 0.2) and for the assembling machine mk 2:
Code: Select all
data.raw["transport-belt"]["fast-transport-belt"].working_sound.sound.volume = 0.2
data.raw["assembling-machine"]["assembling-machine-2"].open_sound.volume = 0.65
data.raw["assembling-machine"]["assembling-machine-2"].close_sound.volume = 0.55
data.raw["assembling-machine"]["assembling-machine-2"].working_sound.sound[1].volume = 0.4
data.raw["assembling-machine"]["assembling-machine-2"].working_sound.sound[2].volume = 0.4
data.raw["assembling-machine"]["assembling-machine-2"].working_sound.idle_sound.volume = 0.3
Note how the assembling-machine's working_sound.sound has 2 unnamed tables in it, as they are unnamed they can only be accessed with it's full indexing syntax using a 1 for the first, a 2 for the second, etc. (or a for loop)
Of course you only change the ones that you actually want to change, it may be unnecessary to change all of the sounds.
Also note that working_sound has an apparent_volume property, it's possible that changing that to a lower value would decrease all of the sounds specified within working_sound (but I haven't tested).
Also, you could just as well change the filename(s) so that it points towards "__your-mod-name__/mod-sound-directory/filename.ext" (with the quotes), if you've edited the sound files to be a lower volume. Obviously replace the your-mod-name and such properly, and it's two '_' characters (not just one) on each side of the mod name
If there are a lot to change maybe tweaking this would be easier
Code: Select all
function soundFinder(table)
for name, values in pairs(table) do
if type(values) == "table" and name:find("sound") then
if values.filename then
if values.volume then
values.volume = values.volume*0.7
else
values.volume = 0.7
end
else
soundFinder(values)
end
end
end
end
so the obvious intent here is that you'd pass a table from data.raw (probably by looping over a type) and it "tries" to find all sound properties and lower it's volume by 30%. It's likely going to miss some since I wrote it very quickly and haven't tested it
and if there's only a few sounds that are too loud it's definitely overkill to employ such an approach
Well, I hope you find that at least a bit helpful (btw, you're welcome for the indirect help with adding coal liquefaction's recipe to the production module allow list, anytime!)