Play looping sound effect while skipping?

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
YossarianIII
Veteran
Posts: 382
Joined: Tue Jan 13, 2015 10:26 pm
Completed: Guns & Lovers; SRRT!; Kill Your Refrigerator; Banality Man; Beretta Mondatta
Projects: Solidarity Forever
Organization: KONOL Games
Contact:

Play looping sound effect while skipping?

#1 Post by YossarianIII » Thu Jan 19, 2017 7:57 pm

What code would I use if I wanted a looping sound effect that only plays while the VN is skipping?

I was able to get a sound effect to play by just adding this code in the skip indicator section of the screens document:

Code: Select all

timer .05 action Play("sound", "fx skip", loop=True)

This is wrong, though, because the sound keeps looping after the VN stops skipping. How can I make it play the sound only while the skip indicator is visible? (Similar to the way dialogue voice blips only play while text is being displayed.)


Thanks!

Image Image

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Play looping sound effect while skipping?

#2 Post by PyTom » Fri Jan 20, 2017 1:46 am

Perhaps in the skip screen:

Code: Select all

on "show" action Play("sound", "fx skip", loop=True)
on "hide" action Stop("sound")
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
YossarianIII
Veteran
Posts: 382
Joined: Tue Jan 13, 2015 10:26 pm
Completed: Guns & Lovers; SRRT!; Kill Your Refrigerator; Banality Man; Beretta Mondatta
Projects: Solidarity Forever
Organization: KONOL Games
Contact:

Re: Play looping sound effect while skipping? [SOLVED]

#3 Post by YossarianIII » Fri Jan 20, 2017 1:16 pm

PyTom wrote:Perhaps in the skip screen:

Code:
on "show" action Play("sound", "fx skip", loop=True)
on "hide" action Stop("sound")

Yes, perfect! This'll help for some of the other screens too. Thanks!

Image Image

Post Reply

Who is online

Users browsing this forum: No registered users