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.
They each take about 10-12 seconds so in order to fill a 5-7 minute mark I can't use queues.
I need them to function independently from the text boxes. How could I do that?
Is there a way to set a function to work in parallel with the text boxes?
Code: Select all
screen musicbutton: button: text "Hit me!" size 35 background "#211" xpos .5 ypos .5 xysize(100, 100) action [mr.Play(), Jump("continue")] init python: mr = MusicRoom(fadeout=1.0, loop=False, shuffle=True) #shuffle = random, right? :D mr.add("concerto.mp3", always_unlocked=True) mr.add("act2_theme.mp3", always_unlocked=True) mr.add("Love Song.mp3", always_unlocked=True) mr.add("05 Landscaper.mp3", always_unlocked=True) mr.add("09 Rainbow.mp3", always_unlocked=True) label start: "It's so quiet here. How about some music..?" call screen musicbutton label continue: "Ah... this is better..."
- Lemma-Class Veteran
- Posts: 2138
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
Here's what I would try:
You can use the playlist function to stack several sound files to play, one after the other.
Modify that to take a renpy.random value instead.
Define your audio for easy calling
Elsewhere (probably an init-1 block), define the renpy.random function.
I posted a similar function in the cookbook for multiple, random menu sounds. Perhaps it can be tweaked for your specific use.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Code: Select all
init: python: ##this function creates a playlist of sounds def sounds(songlist, lenght, channel_c, initial): playlist = ["sounds/pause_1s.mp3"] if initial == True: for song in songlist: playlist.append(song) lenght -= 9 i = 0 while i < lenght: for song in songlist: ii = renpy.random.randint(0, 8) if ii == 0: playlist.append(song) i += 1 return renpy.music.play(playlist, channel=channel_c)