Is it impossible to add new utility/sounds?
Posted: Sat Feb 17, 2018 5:49 pm
OK. So this is really weird and i'm 90% sure this has to be some kind of freak bug.
I'm trying to add a new utility sound to use with surface.play_sound(). But all attempts at this have failed so far.
For adding the prototype i vertabitm copied the function body from /core/prototypes/utility-sounds.lua
This raises no errors during startup so it looks like it works fine... (I've added print() to see that the file is really actually loaded, and i've even tried to add both the .ogg file and the code directly to /core/protoypes/ulitity-sounds.lua. I've used serpent.block() to check that the table looks exactly like every other table in utility-sounds...
But:
Every time i try to use the sound with surface.play_sounds() i get an <Unknown utility sound "warp"> error.
It works fine with other utility sounds i've tried. And warp.ogg plays fine if i use it as a click sound in a button style. So. Like...WTF is wrong with this.
Any help would be greatly appreciated. Has anyone else successfully added new utility sounds?
I'm trying to add a new utility sound to use with surface.play_sound(). But all attempts at this have failed so far.
For adding the prototype i vertabitm copied the function body from /core/prototypes/utility-sounds.lua
Code: Select all
data.raw["utility-sounds"]["default"]['warp'] =
{
{
filename = '__er-waypoints__/assets/warp.ogg'
}
}
But:
Every time i try to use the sound with surface.play_sounds() i get an <Unknown utility sound "warp"> error.
Code: Select all
wp.entity.surface.play_sound{
-- path = 'utility/axe_mining_ore',
path = 'utility/warp',
-- path = "entity-build/wooden-chest"
position = wp.entity.position,
volume_modifier = 0.8,
}
Any help would be greatly appreciated. Has anyone else successfully added new utility sounds?