Re: Text bleeps callback won't stop when going to other menu
Posted: Tue Jun 02, 2015 12:59 pm
I wish you the best of luck with your project! And I'm glad the beeps are working for you!
Supporting creators of visual novels and story-based games since 2003.
https://lemmasoft.renai.us/forums/
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
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
Code: Select all
label enter_game_menu:
$ renpy.music.stop(channel="text")
return