Expose "pick_sound" and "drop_sound" to item prototypes retrieved at runtime

Things that already exist in the current mod API
bunshaman
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri May 24, 2024 3:14 am
Contact:

Expose "pick_sound" and "drop_sound" to item prototypes retrieved at runtime

Post by bunshaman »

Howdy,
I am requesting that "pick_sound" and "drop_sound" are accessible from an item prototype that was retrieved at runtime.

Here is how it pertains to my use case. I have several entities (plants) which are not plantable by any item, however they are spawned depending on the quality of a seed that was planted. This means that I cannot pipette the plants like usual to get seeds, so some scripting workarounds are required. Not difficult, however this means that sounds are not played unless I use `play_sound`. However there is no way to play the correct sound outside of hardcoding the filepaths to a list of seeds etc.

With how many fields of an ItemPrototype are visible, it feels odd that the sounds are not something we can access.

EDIT: This is possible via SoundPaths. I will leave this up just because it may still be an idea that benefits someone else
Bilka
Factorio Staff
Factorio Staff
Posts: 3697
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Expose "pick_sound" and "drop_sound" to item prototypes retrieved at runtime

Post by Bilka »

The only intended way to access sounds at runtime is via the soundpath, so since it's available there this already exists.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Already exists”