Page 1 of 1

Sound replacement

Posted: Wed May 06, 2020 5:40 pm
by Alstorp
Hi, I've been trying to make a simple sound replacement mod, this is my first time modding in Lua so this might be trivial.

Here is my code

Code: Select all

data.raw.inserter["inserter"].sound = {
{
filename = "__Soundtest_1.2.1__/sound/inserter-basic-1.ogg",
volume = 0.3
},
{
filename = "__Soundtest_1.2.1__/sound/inserter-basic-2.ogg",
volume = 0.3
},
{
filename = "__Soundtest_1.2.1__/sound/inserter-basic-3.ogg",
volume = 0.3
},
{
filename = "__Soundtest_1.2.1__/sound/inserter-basic-4.ogg",
volume = 0.3
},
{
filename = "__Soundtest_1.2.1__/sound/inserter-basic-5.ogg",
volume = 0.3
}
}
I've been trial-and-error:ing this for a few hours and at this point the mod doesn't give off an error code when launched anymore, it simply doesn't work however, the sounds do not get applied. My suspicion is that the problem lies in the first line, I'm probably trying to call a dictionary that doesn't exist. But as I don't know the proper structure, I have no way of knowing.

Any and all help is appreciated!

Re: Sound replacement

Posted: Fri May 08, 2020 4:52 pm
by darkfrei
Alstorp wrote: Wed May 06, 2020 5:40 pm Any and all help is appreciated!
There is no inserter.sound:


(used this info-mod)

Re: Sound replacement

Posted: Sun May 10, 2020 6:36 pm
by Alstorp
darkfrei wrote: Fri May 08, 2020 4:52 pm
There is no inserter.sound:
Ahhh, that's very helpful, I can probably get it to work with the information from that screenshot, I had no idea info mod was a thing. Thank you!