Changing Shotgun Sound. But how?

Place to get help with not working mods / modding interface.
M.Colcko
Inserter
Inserter
Posts: 21
Joined: Sun Dec 04, 2016 7:23 am
Contact:

Changing Shotgun Sound. But how?

Post by M.Colcko »

I think we can all agree that the current shotgun sound (0.15.33) is really dull and has no punch to it whatsoever. So I looked for a mod that changes the sound. But I couldn't find any.
So I decided to look for the sound file and replace that with a proper sound. But I can't find the sound for a shotgun firing. Every other weapons sound (e.g. the maschine pistol firing) is there.

So is it even possible to change this? I really wanna have a more satisfiying feeling when blasting biters full with metal.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by Bilka »

The currently used file is "__base__/sound/pump-shotgun.ogg".

To change it, make your own file, place it into your mod and add the following code to your data.lua (modify the file destination to fit you).

Code: Select all

data.raw.gun.shotgun.attack_parameters.sound.filename = "__you-mod__/shotgun.ogg"
data.raw.gun["combat-shotgun"].attack_parameters.sound.filename = "__you-mod__/shotgun.ogg"
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
M.Colcko
Inserter
Inserter
Posts: 21
Joined: Sun Dec 04, 2016 7:23 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by M.Colcko »

I'm having a problem:
When i want to load up Factorio im gettung the error message below.

The data.lua looks like this:

Code: Select all

data.raw.gun.shotgun.attack_parameters.sound.filename = "__shotgunsoundReplacer_0.1.0__/shotgun-fire-reload.ogg"
data.raw.gun["combat-shotgun"].attack_parameters.sound.filename = "__shotgunsoundReplacer_0.1.0__/shotgun-fire-reload.ogg"
This is the directory:
Factorio/mods/shotgunsoundReplacer_0.1.0.zip\shotgunsoundReplacer_0.1.0\data.lua, info.json, shotgun-fire-reload.ogg

Can you help me?
Attachments
The error message
The error message
Unbenannt.png (5.62 KiB) Viewed 3990 times
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by Bilka »

M.Colcko wrote:I'm having a problem:
When i want to load up Factorio im gettung the error message below.

The data.lua looks like this:

Code: Select all

data.raw.gun.shotgun.attack_parameters.sound.filename = "__shotgunsoundReplacer_0.1.0__/shotgun-fire-reload.ogg"
data.raw.gun["combat-shotgun"].attack_parameters.sound.filename = "__shotgunsoundReplacer_0.1.0__/shotgun-fire-reload.ogg"
This is the directory:
Factorio/mods/shotgunsoundReplacer_0.1.0.zip\shotgunsoundReplacer_0.1.0\data.lua, info.json, shotgun-fire-reload.ogg

Can you help me?
Remove the mod version from the file path:

Code: Select all

data.raw.gun.shotgun.attack_parameters.sound.filename = "__shotgunsoundReplacer__/shotgun-fire-reload.ogg"
data.raw.gun["combat-shotgun"].attack_parameters.sound.filename = "__shotgunsoundReplacer__/shotgun-fire-reload.ogg"
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
M.Colcko
Inserter
Inserter
Posts: 21
Joined: Sun Dec 04, 2016 7:23 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by M.Colcko »

Ok. Now i am getting a very diffrent error message saying:

"Audio clip sample "__shotgunsoundReplacer__/sounds/shotgun_fire.ogg" not loaded!"

I have uploaded the mod to the portal so you can check any errors yourself:
https://mods.factorio.com/mods/M.Cocko/ ... ndReplacer
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by Bilka »

The error occurs in the sound loading phase, which suggests that your audio file is broken in some way, however VLC is able to play it. I would suggest you to try a different file or to de- and encode the audio again, maybe that will fix it. I was able to load the mod by replacing the sound file with another one from one of my mods, and that worked, so it's definitely a problem with you file.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
M.Colcko
Inserter
Inserter
Posts: 21
Joined: Sun Dec 04, 2016 7:23 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by M.Colcko »

OK thanks. I will try that. I did just change the file type (retype .mp3 to .ogg) so that sure is the issue.
M.Colcko
Inserter
Inserter
Posts: 21
Joined: Sun Dec 04, 2016 7:23 am
Contact:

Re: Changing Shotgun Sound. But how?

Post by M.Colcko »

It works just about perfect now. Thank you very much!
Post Reply

Return to “Modding help”