Opening fanfare with sound and animated scene, making sounds stop by clicking?

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
sonictoad
Regular
Posts: 30
Joined: Tue Mar 12, 2019 10:39 pm
Projects: It's Different When It's Your Own
Organization: Sonic Toad Media LLC
itch: nyhcmaven84
Location: Bronx, NY
Contact:

Opening fanfare with sound and animated scene, making sounds stop by clicking?

#1 Post by sonictoad » Wed Aug 26, 2020 11:27 pm

Here's the code I currently got in script.rpy before start:
#The "splashscreen" label automatically plays before the main menu.
label splashscreen:
play sound "STFANFARE.ogg"
scene splashph
with dissolve
pause (14.0) #Fanfare sound file is 14 seconds
return
I'm just using a placeholder image for now, splashph.png. Would it be better to use a GIF, MP4, or just a couple manual frames for the final animated image?

Next up, how do I make sounds...skippable by clicking?

for instance, if I just click past the fanfare, the image goes away and jumps straight to the main menu, but the sound keeps playing over the main menu music.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: Opening fanfare with sound and animated scene, making sounds stop by clicking?

#2 Post by hell_oh_world » Wed Aug 26, 2020 11:37 pm

you cant use gifs inside renpy, videos would work, but there are certain video formats/containers that can only work https://www.renpy.org/doc/html/movie.html.
try putting `stop sound` at the end before the return to stop the sound, also better to play long tracks in music channel, so play music 'music.mp3', then stop music

User avatar
sonictoad
Regular
Posts: 30
Joined: Tue Mar 12, 2019 10:39 pm
Projects: It's Different When It's Your Own
Organization: Sonic Toad Media LLC
itch: nyhcmaven84
Location: Bronx, NY
Contact:

Re: Opening fanfare with sound and animated scene, making sounds stop by clicking?

#3 Post by sonictoad » Wed Aug 26, 2020 11:50 pm

hell_oh_world wrote:
Wed Aug 26, 2020 11:37 pm
you cant use gifs inside renpy, videos would work, but there are certain video formats/containers that can only work https://www.renpy.org/doc/html/movie.html.
try putting `stop sound` at the end before the return to stop the sound, also better to play long tracks in music channel, so play music 'music.mp3', then stop music
thanks! I'll try the stop sound command and experiment with it in other scenes, since I had the same issue with a phone ringing sound that was on the longer side. can also just change it to a music command.

hmm, based on the supported movie file types, I think displaying it as an animated background might be easiest. It's just a couple simple frames I can delay at certain points to make it fit the full 14 seconds.

User avatar
sonictoad
Regular
Posts: 30
Joined: Tue Mar 12, 2019 10:39 pm
Projects: It's Different When It's Your Own
Organization: Sonic Toad Media LLC
itch: nyhcmaven84
Location: Bronx, NY
Contact:

Re: Opening fanfare with sound and animated scene, making sounds stop by clicking?

#4 Post by sonictoad » Thu Aug 27, 2020 11:00 pm

Update: the "stop sound" command works like a charm! Makes those long sound files "clickable" :D

Post Reply

Who is online

Users browsing this forum: mold.FF