Solarus-Games English Forum

Solarus => Bugs & Feature requests => Topic started by: Lucifer on May 23, 2018, 07:59:24 PM

Title: Feature Request : Change the attack sound
Post by: Lucifer on May 23, 2018, 07:59:24 PM
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 ?
Title: Re: Feature Request : Change the attack sound
Post by: Diarandor on May 23, 2018, 09:26:13 PM
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.
Title: Re: Feature Request : Change the attack sound
Post by: Lucifer on May 24, 2018, 12:57:10 PM
Thank you !