Requested: list of eligible sounds for play_sound{}

Things that we aren't going to implement
Post Reply
R.Nukem
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Feb 26, 2019 6:20 pm
Contact:

Requested: list of eligible sounds for play_sound{}

Post by R.Nukem »

I came across the play_sound method on the factorio API and was excited to add some flair to a scenario the Redmew community has been working on. I discovered, however, that the soundpath concept is not entirely user friendly. The listed examples work, but the majority of sounds in the game's data/base/sound folder are inaccessible to this method.

As it is currently written it is nearly impossible to determine which sounds can be used or how to use anything other than what is explicitly listed in the examples.

For example, "utility/wire_connect_pole" works, and is the first example in the API, but "entity-vehicle_impact/car-stone-impact" does not. The type is listed in the API, and the name was taken from the sound folder and assumed to be under that type.

I would suggest one of the following changes to the API or its documentation:
  • Ideally, make all sounds in data/base/sound accessible by the play_sound{} function by the relative path in the folder.
  • Otherwise, make an all inclusive list of available sounds and add it to the API in addition to the existing example

For those who want to quickly look the following links will take you to the function and soundpath object.

https://lua-api.factorio.com/latest/Lua ... play_sound
https://lua-api.factorio.com/latest/Con ... #SoundPath

Edit: Turns out the sounds in the data folder are not directly used. "entity-vehicle_impact/tree-01" works, because it wants an entity in name, and then goes and finds the appropriate sound for a vehicle colliding with that entity, I guess? I assume the rest of the type examples work in a similar way using an entity name, not a sound filename. This could be made more clear in the API if neither of the above are good solutions to this "problem"

Bilka
Factorio Staff
Factorio Staff
Posts: 3132
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Requested: list of eligible sounds for play_sound{}

Post by Bilka »

Moved to modding interface requests
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Requested: list of eligible sounds for play_sound{}

Post by Rseding91 »

Sorry, no. If you want every sound to be available through play_sound then you can define them all in the data stage with type="sound". Sounds are similar to sprites in that they have no name if you don't explicitly give them one. A single entity might have 15 different sounds for what ever it thinks it wants to use them for or may have none. The engine has no way to know what "name" it should associate with a sound (if any) or if a given sound has already been registered with some name.
Otherwise, make an all inclusive list of available sounds and add it to the API in addition to the existing example
That's also never going to happen. That would get outdated before the person even finished making the list.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”