demo-sounds.lua should be a bunch of functions that return fresh copies of the respective sound presets.
Why?
Currently all prototypes share a reference to the same table, thus changes to one prototype inadvertently affect all prototypes.
A heavily simplified example that changes "sounds.generic_impact":
Code: Select all
for _,s in pairs(data.raw['electric-pole']['substation'].vehicle_impact_sound) do
s.filename = "__core__/sound/cannot-build.ogg"
s.volume = 1
end
--Oops, i just made almost every impact in the game sound annoying!