Page 1 of 1

Question on SoundPath

Posted: Wed Mar 27, 2019 6:04 pm
by ProfoundDisputes
Just trying to play some sounds. I don't understand the documentation on SoundPath:

"It can be either the name of a sound prototype defined in the data or a path in the form "type/name". Supported types are."

Where are these sounds defined in the data? Where are the sound prototypes? I also don't know what "types" there are. I know its something like:

game.players[1].play_sound({path="SoundPath"})

I just don't understand how to know where these files are. I am trying to play this sound:

"Factorio\data\base\sound\programmable-speaker\bass-01.ogg"

Thank you in advance.

Re: Question on SoundPath

Posted: Wed Mar 27, 2019 6:21 pm
by Bilka
Moved to modding help.

The base game doesn't define sound prototypes.

The sounds that you can access with sound path are defined in a lot of different places. The utility sounds are defined in the utility sounds, the ambient sounds in the ambient sounds, any entity or tile sound in the individual tile or entity. Accessing those is what the type is for, you can find the available types in the documentation: https://lua-api.factorio.com/latest/Con ... #SoundPath. Here it becomes obvious that the sound that you want to play is not available via a sound path, because it is not under the listed categories. You could make a modding interface request to have the programmable speaker sounds added to the sound paths. Or you can create a sound prototype with the sound that you want.

Re: Question on SoundPath

Posted: Wed Mar 27, 2019 6:39 pm
by ProfoundDisputes
[...]You could make a modding interface request to have the programmable speaker sounds added to the sound paths. Or you can create a sound prototype with the sound that you want.
I don't know what it means to create a sound prototype. This concept of "prototype" is really confusing me. I see it mentioned all the time but I don't know what is meant by this and how these relate to the game. Is there a written summary of what a prototype is in relation to the game engine?