Detached gun sound

Place to get help with not working mods / modding interface.
Post Reply
Mr.YaR
Inserter
Inserter
Posts: 26
Joined: Fri Jan 22, 2016 9:17 am
Contact:

Detached gun sound

Post by Mr.YaR »

The naming convention is "gunsound-"..gun.name.
Looping sounds are also supported but have a -begin_sound, -middle_sound, and -end_sound suffix.
...
game.player.surface.create_entity{name="gunsound-shotgun", position=game.player.position}
The only sound related line seems to live inside "attack_parameters"... Pretty sure all this has to be used somewhere else!
Any details on all this please?

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Detached gun sound

Post by Klonan »

Mr.YaR wrote:
The naming convention is "gunsound-"..gun.name.
Looping sounds are also supported but have a -begin_sound, -middle_sound, and -end_sound suffix.
...
game.player.surface.create_entity{name="gunsound-shotgun", position=game.player.position}
The only sound related line seems to live inside "attack_parameters"... Pretty sure all this has to be used somewhere else!
Any details on all this please?
You are probably looking for the gunshot explosions, which are in demo entities
They are created by the attack parameters, and create the sound

Or are you asking about something else?

Mr.YaR
Inserter
Inserter
Posts: 26
Joined: Fri Jan 22, 2016 9:17 am
Contact:

Re: Detached gun sound

Post by Mr.YaR »

While understanding how detached gun sound works(phantom explosion playing the sound) - how exactly to use it.... is still a mystery for me.

For exemple, got an entity(custom "car", a custom gun item...) with a line of code for the firing sound(custom .ogg) path and the volume.

Where do i exactly put the "gunsound-"? For the sound to be hearable every time the "car fires, no matter is there a player inside or no

Post Reply

Return to “Modding help”