Rephrased question:
How can I make a sound behave like the voice object? i.e. replay stops when the player skips, or fast-forwards lines.
"voice" uses the config.interact_callbacks, how is it properly used for that purpose?
~
Original Post:
The "voice" statement has a few features the ordenary "play" has not. E.g. voice is stopped when the player skips a line (interact).
Is there a parameter to make play behave in the same way. Or perhaps adding channels to "voice" to get that behaviour?
How to stop a sound through interaction?
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.
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.
-
- Veteran
- Posts: 398
- Joined: Sat Jul 12, 2008 1:31 pm
- Projects: Kassiopeia [iVN]
- Location: Deutschland
- Contact:
How to stop a sound through interaction?
Last edited by Jo'ogn on Wed Sep 16, 2009 12:48 pm, edited 4 times in total.
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
- jack_norton
- Lemma-Class Veteran
- Posts: 4084
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: More than one "voice" statement at a time?
Remember that if player is in skip mode though, and the voice is still played full length, the result could be quite "cacophonic"
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: More than one "voice" statement at a time?
Hm, I guess he was talking about making the play statement behave like the voice statement, and not the other way around.jack_norton wrote:Remember that if player is in skip mode though, and the voice is still played full length, the result could be quite "cacophonic"
You can try registering a new channel using voice mixer, although I didn't test it and have no idea if it'll work or not xD
- jack_norton
- Lemma-Class Veteran
- Posts: 4084
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: More than one "voice" statement at a time?
Ah yes I read badly sorry
The only solution I can think of would be to put a stop command after each line with play, but isn't really a good solution...
The only solution I can think of would be to put a stop command after each line with play, but isn't really a good solution...
-
- Veteran
- Posts: 398
- Joined: Sat Jul 12, 2008 1:31 pm
- Projects: Kassiopeia [iVN]
- Location: Deutschland
- Contact:
Re: More than one "voice" statement at a time?
This is what I am doing atm. That's why I am asking if it's possible to stop a sound played when skipping or clicking away lines. Using the voice mixer alone does no inherit the same behaviour to the new channel.killdream wrote:You can try registering a new channel using voice mixer, although I didn't test it and have no idea if it'll work or not xD
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: More than one "voice" statement at a time?
You can hook Ren`Py function to show dialogs.
Then you just need to create characters that uses your custom display function instead of Ren'Py default one. You can even redefine the narrator character to use this function too.
Code: Select all
init -1 python:
def custom_display_say(who, what, who_args={}, what_args={}, window_args={},
image=False, side_image=None, two_window=False,
two_window_vbox_properties={},
who_window_properties={},
say_vbox_properties={},
variant=None,
**kwargs):
# stop any current playing sound
renpy.music.stop(channel="sound")
# displays the dialog
return renpy.show_display_say(who, what, who_args, what_args, window_args,
image, side_image, two_window,
two_window_vbox_properties,
who_window_properties,
say_vbox_properties,
variant,
**kwargs)
Code: Select all
init python:
engel = Character("Engel", show_function=custom_display_say)
# with this you can change the default Ren'Py narrator :D
narrator = Character(None, show_function=custom_display_say)
-
- Veteran
- Posts: 398
- Joined: Sat Jul 12, 2008 1:31 pm
- Projects: Kassiopeia [iVN]
- Location: Deutschland
- Contact:
Re: How to stop a sound through interaction?
Thanks killdream, but it seems too complicated to change an entire say behaviour if all I want is to stop a sound from playing. Stopping sounds through interactions could also be desired on other occasions.
I rephrased my question in my first post, I figured out by reading through the source code that "voice" is an object using a callback to prevent the playback, but I don't know how to make it work for, say, a dedicated channel I want to behave in the same way.
I rephrased my question in my first post, I figured out by reading through the source code that "voice" is an object using a callback to prevent the playback, but I don't know how to make it work for, say, a dedicated channel I want to behave in the same way.
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
Who is online
Users browsing this forum: Google [Bot], konimyun