Music play in the background from a previous label.
Problem: set the background music from the prefs screen. So you can select a jazzy, rock or fusion theme while you play.
My solution:
Right click - enter setup screen.
Press an arrow button - set an index variable (with a function that cycle values) and play a track accordingly to a list on music channel - so far work fine. A nice jukebox.
Right click to exit the screen - the old first music play again (and I dunno why as it refer to a previous label now expired, no other "play" statement where I return to).
How to have that new music keep playing even if I exit the prefs screen?
I've tried queue reset but baf, does nothing.
[SOLVED] Problem with audio and screens.
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.
[SOLVED] Problem with audio and screens.
Last edited by gas on Mon Mar 13, 2017 2:41 pm, edited 1 time in total.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
- PyTom
- Ren'Py Creator
- Posts: 16093
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Hey you! Set that track now! Problem with audio and scre
It's difficult. Ren'Py considers the menus to be a different context than the rest of the game, so changes to music from inside the menus will be erased.
What you can do is to have an interact callback that sets the music if not already playing. Something like:
Then in the screen, you can use SetField(persistent, "music", "rock.opus") or whatever.
What you can do is to have an interact callback that sets the music if not already playing. Something like:
Code: Select all
default persistent.music = "jazzy.opus"
init python:
def music_callback():
renpy.music.play(persistent.music, if_changed=True)
config.interact_callbacks.append(music_callback)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Hey you! Set that track now! Problem with audio and scre
I was suspecting the context was guilty .
Thank you for the reply!
Thank you for the reply!
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
Who is online
Users browsing this forum: Andredron