Way to, globally throughout the game, mute channel if 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
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Way to, globally throughout the game, mute channel if skipping?

#1 Post by SuperbowserX »

Is there a way to set up the game so that sound effects (played through the sound channel) will be disabled if the player is currently skipping through text? I've realized it might be annoying to the end user to have SFX from lines and lines of text ago playing from a moment they skipped through a second ago (but that the normal user who was not skipping would've heard a minute or a few ago).

Preferably a way to do it without changing every "play sound ..." line. :D Thanks

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Way to, globally throughout the game, mute channel if skipping?

#2 Post by philat »

Hmm. Hypothetically, you could have an on "show"/"hide" action to mute the sfx mixer on the skip screen. Haven't tested it though.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: Way to, globally throughout the game, mute channel if skipping?

#3 Post by PyTom »

You can add a function to config.interact_callbacks that checks to see if config.skipping is true-ish and mutes the channel.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Way to, globally throughout the game, mute channel if skipping?

#4 Post by SuperbowserX »

@philat - I found screen skip_indicator(): but I don't know what screen-compatible value can be passed into it that mutues the sound channel.

@pytom - I did a ctrl+shift+f (searches all files in the \game directory) for "config.interact_callbacks" and nothing was found.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Way to, globally throughout the game, mute channel if skipping?

#5 Post by philat »

As for interact_callbacks, I'll defer to PyTom of course, but I think the issue there is that it's only optional -- you wouldn't find anything defined by default. https://www.renpy.org/doc/html/config.h ... _callbacks

As for the screen, I imagine it would be something along the lines of:

Code: Select all

screen skip_indicator():
    on "show" SetMute("sfx", True)
    on "hide" SetMute("sfx", False)
    # the rest of the screen unaltered
See here for more audio related screen actions that you could look into. I haven't tested this.

ETA: Er, meant to copy/paste a link here (obviously) and forgot (facepalm). Glad you worked it out, adding for posterity. https://www.renpy.org/doc/html/screen_a ... io-actions
Last edited by philat on Tue Sep 05, 2017 1:03 am, edited 2 times in total.

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Way to, globally throughout the game, mute channel if skipping?

#6 Post by SuperbowserX »

Code: Select all

    on "show" action SetMute("sfx", True)
    on "hide" action SetMute("sfx", False)
did the trick, thanks phi :)

Post Reply

Who is online

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