Page 1 of 1

How can I replace vanilla sounds with custom ones?

Posted: Wed Jan 08, 2025 4:33 am
by Rioma
I'm trying to replace the electric beam sound by a custom one but I can't make it work.

This is the code I used

Code: Select all

data.raw.beam["laser-beam"] = {
	{
		filename = "__BetterSounds__/sounds/beam.ogg",
		volume = 1
	}
}

Re: How can I replace vanilla sounds with custom ones?

Posted: Wed Jan 08, 2025 2:35 pm
by IsaacOscar
Rioma wrote: Wed Jan 08, 2025 4:33 am I'm trying to replace the electric beam sound by a custom one but I can't make it work.

This is the code I used

Code: Select all

data.raw.beam["laser-beam"] = {
	{
		filename = "__BetterSounds__/sounds/beam.ogg",
		volume = 1
	}
}
Well according to https://github.com/wube/factorio-data/b ... s.lua#L175,

the sound is actually in "working_sound.sound", moreover there are other fields there, so instead of discarding them I suggest merging them:

Code: Select all

require("util")
table.merge(data.raw.beam["laser-beam"].working_sound.sound, {
		filename = "__BetterSounds__/sounds/beam.ogg",
		volume = 1 })