Text bleeps callback won't stop in menus [SOLVED!]
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.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Text bleeps callback won't stop when going to other menu
I wish you the best of luck with your project! And I'm glad the beeps are working for you!
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
- tomotomo
- Regular
- Posts: 32
- Joined: Thu May 28, 2015 2:01 pm
- Tumblr: tomatomagica
- Location: Russia
- Contact:
Re: Text bleeps callback won't stop when going to other menu
trooper6, thanks a lot for your help again!
Re: Text bleeps callback won't stop in menus [SOLVED!]
Hi there, how do you make the slider for adjusting the typing sound?
Re: Text bleeps callback won't stop when going to other menu
This is a bit of a necro so I apologize, but your code doesn't seem to be working. It always usestrooper6 wrote: ↑Tue Jun 02, 2015 10:02 am You don't need the no_game screen in your code since you never call it. That screen was for the option where you can't go to the menu while the slow text is running...but you aren't using that option, you are using the function option--so you don't need the screen.
To answer your question about having a bunch of different beeping sounds, you can achieve this by having a keyword variable in your callback to distinguish the different characters, pass that variable to the function and have an if statement in there that decides what beep to play based on the variable:
I have to say, though...all those clicks for the entire game might annoy your player. Perhaps you should add an option to turn all those clicks off?Code: Select all
init -1 python: #Register Audio Channel renpy.music.register_channel("Chan1", mixer= "sfx", loop=True) #Play Audio Function def clack_play(on=False, char=1): if on: if char==1: renpy.music.play("click.wav", channel="Chan1") if char==2: renpy.music.play("pong_beep.wav", channel="Chan1") else: renpy.music.stop(channel="Chan1") #Callback def clicks(event, char=1, **kwargs): if event == "show" or event == "begin": clack_play(True, char) if event == "slow_done" or event == "end": clack_play(False, char) # names define cha = Character(u"Шарлотта", show_two_window=True, what_slow_cps=20, stop_on_mute=False, callback=clicks, cb_char=1) define dan = Character(u"Даниэлла", show_two_window=True, what_slow_cps=20, stop_on_mute=False, callback=clicks, ch_char=2)
Code: Select all
char=1
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Text bleeps callback won't stop in menus [SOLVED!]
I noticed a typo in that code that could have caused that problem. When I was defining dan, the last bit says: ch_char=2, but that should be cb_char=2
The "cb" stands for callback.
Anyhow, I just remade the project and tested it, it work. I'll post the code and also a zip of the project itself that you can download and test our yourself.
The "cb" stands for callback.
Anyhow, I just remade the project and tested it, it work. I'll post the code and also a zip of the project itself that you can download and test our yourself.
Code: Select all
# You can place the script of your game in this file.
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
image skimpy = Placeholder('boy')
image flippy = Placeholder('girl')
# Declare characters used by this game.
define e = Character('Eileen', image="skimpy", color="#c8ffc8", what_slow_cps=20, what_slow_abortable=False,
stop_on_mute=False, callback=clicks, cb_char=1)
define f = Character('Faye', image="flippy", color="#c8ffc8", what_slow_cps=20, what_slow_abortable=False,
stop_on_mute=False, callback=clicks, cb_char=2)
#Functions
init -1 python:
renpy.music.register_channel("Chan1", mixer= "sfx", loop=True)
def clack_play(on=False, char=1):
if on:
if char==1:
renpy.music.play("audio/click.wav", channel="Chan1")
if char==2:
renpy.music.play("audio/pong_beep.wav", channel="Chan1")
else:
renpy.music.stop(channel="Chan1")
def clicks(event, char=1, **kwargs):
if event == "show" or event == "begin":
#This is the function option
clack_play(True, char)
if event == "slow_done" or event == "end":
clack_play(False, char)
# The game starts here.
label start:
e "Let us test the callbacks."
e "This character is using one set of beeps."
f "But I'm differnt character, and I'm using different beep."
return
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Re: Text bleeps callback won't stop in menus [SOLVED!]
The above download doesn't appear to actually stop the beeps in the menu. (Also the second sound effect is... pretty unpleasant.)
For my own project, I have to specifically mute the text channel when calling a screen from the main screen.In the above code, the channel would be "Chan1".
For my own project, I have to specifically mute the text channel when calling a screen from the main screen.
Code: Select all
label enter_game_menu:
$ renpy.music.stop(channel="text")
return
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Text bleeps callback won't stop in menus [SOLVED!]
The second sound is very unpleasant. I’d never use it in an actual game. That is just for testing purposes. Also, that code doesn’t implement the menu fix because Mikasa didn’t quote my post dealing with muting the bleeps, just the post having different bleeps. The solution I posted earlier (adding a few lines to the menu screens) still works.
You can review that post here (it is the second half of the post): viewtopic.php?
You can review that post here (it is the second half of the post): viewtopic.php?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Re: Text bleeps callback won't stop in menus [SOLVED!]
Thanks for providing a fix for the code.
Who is online
Users browsing this forum: risukadekei