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.
def talking_stick(char, event_name, interact=True, **kwargs):
if not interact:
return
if event_name == "show_done":
renpy.sound.play("audio/"+char.name+"bip.wav", loop="True")
if event_name == "slow_done":
renpy.sound.stop()
My issue is two things. One, the line will sometimes end in the middle of the beep sound and it will cut out somewhat painfully. Is there a way to make it stop at the end of a beep?
Two, the looping of the beep is too regular, and I want to make it sound more Morse-code-like, with beep dots and beep dashes. Is there a way to put in variable pauses after the sound before it loops, or have beeps overlap?
Last edited by TellerFarsight on Mon May 21, 2018 10:29 am, edited 2 times in total.
if event_name == "show_done":
random:
renpy.sound.play("audio/"+char.name+"dot.wav", loop="True")
or
renpy.sound.play("audio/"+char.name+"dash.wav", loop="True")
Figured it out, if anyone wants to use this. It creates a playlist beforehand that is randomly populated with dots and dashes, and then plays that. The playlist is re-randomized before each use.
def beeps(char):
char.beeps = []
for x in range(10):
char.beeps.append(renpy.random.choice(["audio/"+char.name+"dot.wav","audio/"+char.name+"dash.wav"]))
def talking_stick(char, event_name, interact=True, **kwargs):
if not interact:
return
if event_name == "show_done":
beeps(char)
renpy.sound.play(char.beeps, loop="True")
if event_name == "slow_done":
renpy.sound.stop()