dialouge transition 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
battlecomics700
Newbie
Posts: 6
Joined: Sat Jun 20, 2020 3:54 pm
itch: battlecomics700
Contact:

dialouge transition sound effects?

#1 Post by battlecomics700 » Sun Jun 28, 2020 12:30 pm

i wanted there to be a sound whenever i click and go to a new piece of dialogue in my game. does anyone know of a way to do this?

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: dialouge transition sound effects?

#2 Post by isobellesophia » Mon Jun 29, 2020 6:17 pm

Have you ever tried using "play" perchance?

Code: Select all

label start:
"A dialogue"
pause 2.0
scene school
play sound "sounds/bell.ogg" fadein 1.0
"A new dialogue here blah blah"
return
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
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: dialouge transition sound effects?

#3 Post by Donmai » Mon Jun 29, 2020 10:18 pm

Someone may have a better solution, but here's my answer, anyway. :)

In "The One in LOVE" we can hear a computer sound every time the character Lady Lovelace talks. That's because Lady Lovelace is in fact a computer. To achieve that effect I used a python routine and the character callback statement. Here's how I did it:

The routine that plays the sound:

Code: Select all

init:
        
    python:
        def lady_voice(event, interact=True, **kwargs): # lady_voice is the name I gave to the event. You can give it any other name
            if not interact:
                return
            if event == "show_done":
                renpy.sound.play("sfx/computer.OGG") # the sound computer.OGG is inside a subfolder named sfx
To play the sound every time that character talks, simply add a callback statement to the character definition:

Code: Select all

define lady = Character('Lady Lovelace', callback = lady_voice)
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]