Help with sound effects

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
mizzuk
Newbie
Posts: 4
Joined: Fri Dec 15, 2017 11:30 pm
Contact:

Help with sound effects

#1 Post 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!

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Help with sound effects

#2 Post 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 =
Last edited by xavimat on Sun Dec 17, 2017 6:20 am, edited 1 time in total.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

mizzuk
Newbie
Posts: 4
Joined: Fri Dec 15, 2017 11:30 pm
Contact:

Re: Help with sound effects

#3 Post 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.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Help with sound effects

#4 Post 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.
< < insert Rick Cook quote here > >

mizzuk
Newbie
Posts: 4
Joined: Fri Dec 15, 2017 11:30 pm
Contact:

Re: Help with sound effects

#5 Post by mizzuk »

Ah, it finally worked! Thank you so much! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]