[Solved] How do I upload a sound to use when pressing a button?
Posted: Wed Jul 23, 2025 12:02 pm
Hello, today I wanted to use a sound that comes with Factorio, but it is not available for use in mods. So I am trying to load it myself and then call it.
It is not working for me.
Help
The following is the code I am using.
I'm using what I found in the documentation and some code from Factorio itself, but I must admit that I don't know what I'm doing.
It is not working for me.
Help
The following is the code I am using.
Code: Select all
---> data-final-fixes.lua <---
data.raw["utility-sounds"]["default"]["gui_tool_click"] = {
filename = "__core__/sound/gui-tool-button.ogg",
aggregation = { max_count = 3, remove = true }
}
---> control.lua <---
Player.play_sound({ path = "utility/gui_tool_click" })