Feature Request : Change the attack sound

Started by Lucifer, May 23, 2018, 07:59:24 PM

Previous topic - Next topic
Hi everyone !
I've got a question : how can I change the attack sound in Solarus ? If in my sword.lua item, I change :
Code ( lua) Select
function item:on_using()
sol.audio.play_sound("some ogg sound")
end

I get this :
Error: Cannot find sound file 'sounds/sword1.ogg'
How can I fix this, please ?

May 23, 2018, 09:26:13 PM #1 Last Edit: May 23, 2018, 09:28:50 PM by Diarandor
By default the engine plays the sound sword.ogg (or maybe swordX.ogg with X your current sword level, but I don't remember it now). If you want a different sound, just replace that file. If you want randomized sounds, there is only 1 unclean solution: replace sword.ogg by a silent sound and then call your random sounds from item:on_using().

EDIT: you need to add the file requested by that error.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."