Sound effect for custom buttons [SOLVED]

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
User avatar
Snowflower
Bishie Fangirl
Posts: 814
Joined: Sat Jan 01, 2011 11:24 pm
Completed: Idol Crush
Projects: Shugojin!, RockRobin (openmodewriter), your highness
Soundcloud: jenna-yeon
Location: Orange County, CA
Contact:

Sound effect for custom buttons [SOLVED]

#1 Post by Snowflower »

Hi guys!
I'm more of a writer so I'm a complete noob at coding. I'm trying to add sound effect to all clicking in the game, but the replacing in the options script only allows the non-customized buttons have a sound. Therefore, my quick menu by textbox & yesno prompts do not have a sound. Any way to fix this?? :3 thanks!
Last edited by Snowflower on Thu Aug 07, 2014 6:40 am, edited 1 time in total.
Image
Completed: Idol Crush | WIP: your highness | Hiatus: Shugojin!| Follow Me on Twitter | Subscribe to YouTube
your highness @ 102k as of 2/13

User avatar
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Re: Sound effect for custom buttons

#2 Post by stwkun »

Have you tried to put this in options.rpy

Code: Select all

    style.button.activate_sound = "sound/beep3.wav"
    style.imagemap.activate_sound = "sound/beep4.wav" 

    config.enter_sound = "sound/switch2.wav"
    config.exit_sound = "sound/lp10.mp3"

User avatar
Snowflower
Bishie Fangirl
Posts: 814
Joined: Sat Jan 01, 2011 11:24 pm
Completed: Idol Crush
Projects: Shugojin!, RockRobin (openmodewriter), your highness
Soundcloud: jenna-yeon
Location: Orange County, CA
Contact:

Re: Sound effect for custom buttons

#3 Post by Snowflower »

stwkun wrote:Have you tried to put this in options.rpy

Code: Select all

    style.button.activate_sound = "sound/beep3.wav"
    style.imagemap.activate_sound = "sound/beep4.wav" 

    config.enter_sound = "sound/switch2.wav"
    config.exit_sound = "sound/lp10.mp3"

yup that's exactly what i have currently.
But my customized hotspots aren't clicking with sounds. all the renpy default buttons do though
Image
Completed: Idol Crush | WIP: your highness | Hiatus: Shugojin!| Follow Me on Twitter | Subscribe to YouTube
your highness @ 102k as of 2/13

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Sound effect for custom buttons

#4 Post by Donmai »

Are you using image maps? This code should do the trick. Change the name of the files as needed.

Code: Select all

hotspot (1150, 443, 105, 32) action Start() hovered Play ("sound", "click_sound.ogg")
Just adapt it for each button. The sound will play when the button is hovered.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: Sound effect for custom buttons

#5 Post by Tayruu »

style.hotspot.hover_sound will also work. If you want to customise sounds for individual items, the above would be want you want, if you want to change a sound for a certain style, you just need to put hover_sound and activate_sound in the block for those styles.

User avatar
Snowflower
Bishie Fangirl
Posts: 814
Joined: Sat Jan 01, 2011 11:24 pm
Completed: Idol Crush
Projects: Shugojin!, RockRobin (openmodewriter), your highness
Soundcloud: jenna-yeon
Location: Orange County, CA
Contact:

Re: Sound effect for custom buttons

#6 Post by Snowflower »

Tayruu wrote:style.hotspot.hover_sound will also work. If you want to customise sounds for individual items, the above would be want you want, if you want to change a sound for a certain style, you just need to put hover_sound and activate_sound in the block for those styles.
you are a genius! :3 thanks a bunch!!
Image
Completed: Idol Crush | WIP: your highness | Hiatus: Shugojin!| Follow Me on Twitter | Subscribe to YouTube
your highness @ 102k as of 2/13

Post Reply

Who is online

Users browsing this forum: Dark12ose, Sugar_and_rice