Page 1 of 1

Help with sound effects

Posted: Fri Dec 15, 2017 11:46 pm
by mizzuk
For the past few days, I've been trying to no avail to get sound effects to play when I select the buttons on the menu, and have gotten nothing but errors. My latest attempt was met with yet another error:
File "game/options.rpy", line 68: end of line expected.
style button.activate_sound = "select.wav"
^
I'm not sure what I've been doing wrong. Could someone more experienced help me out? I've tried so many different codes, but none of them have worked for me. I'm pretty sure that it isn't a problem with the audio file itself: it's in the right place, and I tried the same code with sounds that I already have working, and they don't do anything, either.

Thank you so much!

Re: Help with sound effects

Posted: Sat Dec 16, 2017 5:58 am
by xavimat
Styles can be tricky to find.
Try:

Code: Select all

style button:
    activate_sound "select.wav"  ## This means that the wav file is in the "game" folder
EDIT: There was an error with the sign =

Re: Help with sound effects

Posted: Sat Dec 16, 2017 11:44 pm
by mizzuk
Hm... got another error.
File "game/screens.rpy", line 33: expected 'simple_expression' not found.
activate_sound = "select.wav"
^
I copied this error from the 'screens' script, but I also got the same error in the 'options' script, and the 'gui' script, which I tried just to be sure.

Re: Help with sound effects

Posted: Sun Dec 17, 2017 3:35 am
by Ocelot
Drop the '=':

Code: Select all

style button:
    activate_sound "select.wav" 
Just FYI, there in no difference if particular piece of code is in specific file or not. Likewise names of files does not mean anything to RenPy itself. You can just copy-paste content of all files into new file, delete originals, and it still will work.

Re: Help with sound effects

Posted: Sun Dec 17, 2017 3:14 pm
by mizzuk
Ah, it finally worked! Thank you so much! :)