[SOLVED] Music on a Screen?
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.
- Shocking Alberto
- Regular
- Posts: 35
- Joined: Sun Mar 29, 2020 4:58 am
- Contact:
[SOLVED] Music on a Screen?
Curious to know if there's a way to play music on a screen besides using the MusicRoom screen code? I'm building a CG/event gallery right now and while music is playing in said gallery, which is piped in from the BGM set for the main menu, it would be ideal to be able to use a different track for the gallery itself. Short of making a button to use an action to use a music file, I'm not sure what other options there are.
If a thread on this already exists, just kick me to the thread. I'll figure it out from there. o/
If a thread on this already exists, just kick me to the thread. I'll figure it out from there. o/
Last edited by Shocking Alberto on Sun Jul 12, 2020 4:25 pm, edited 1 time in total.
- Shocking Alberto
- Regular
- Posts: 35
- Joined: Sun Mar 29, 2020 4:58 am
- Contact:
Re: Music on a Screen?
After some searching, it seems the easiest is still to change the action from screens.rpg to go to a label where you can change the music then call the screen for the CG gallery.
Only problem is if you exit the gallery, it will be playing the music from the gallery, rather than the main menu. Welp, nearly there... /o/
Only problem is if you exit the gallery, it will be playing the music from the gallery, rather than the main menu. Welp, nearly there... /o/
- Jackkel Dragon
- Veteran
- Posts: 269
- Joined: Mon Mar 31, 2014 7:17 pm
- Organization: Nightshade, Team Despair
- itch: jackkel-dragon
- Location: USA
- Contact:
Re: Music on a Screen?
The simple idea that comes to mind is to use multiple actions. On the button to enter the gallery, instead of
use:
This will play the actions from the list, in order. As long as you play music before you switch screens, it should carry over.
For returning to the title screen, you could use the dedicated main menu action instead of "return", or do the above method to change the music before popping the current screen to return.
There's a complex idea that comes to mind that involves overriding internal labels, but I don't know if it would even work. I'd heavily recommend the multiple action list for the related buttons.
Code: Select all
action <action>Code: Select all
action [<action>, <action>]For returning to the title screen, you could use the dedicated main menu action instead of "return", or do the above method to change the music before popping the current screen to return.
There's a complex idea that comes to mind that involves overriding internal labels, but I don't know if it would even work. I'd heavily recommend the multiple action list for the related buttons.
Main Website
Includes information about and links to many of my current and past projects.
Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series
Includes information about and links to many of my current and past projects.
Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series
- Shocking Alberto
- Regular
- Posts: 35
- Joined: Sun Mar 29, 2020 4:58 am
- Contact:
Re: Music on a Screen?
Thank you for the suggestion! I keep forgetting that you can use multiple actions at once.
With that said, it seems that the button to return back to the main menu with no longer becomes responsive when you add multiple actions. Currently I am using this code which should work:
The "music_reset" label itself just contains a single line to play the main menu screen and that's it. Maybe there's some limitations as to what can be put in the action line. Guess I'll snoop around some more till I figure it out.
With that said, it seems that the button to return back to the main menu with no longer becomes responsive when you add multiple actions. Currently I am using this code which should work:
Code: Select all
imagebutton:
xalign 0.98
yalign 0.98
idle "gui/return.png"
hover "gui/return_hover.png"
hovered Play ("sound", "SE/sound_hover.ogg")
activate_sound "SE/sound_click.ogg"
action [Call("music_reset"), MainMenu(confirm=False)]- Shocking Alberto
- Regular
- Posts: 35
- Joined: Sun Mar 29, 2020 4:58 am
- Contact:
Re: Music on a Screen?
Okay, never mind I am dumb and didn't read the documentation thoroughly. Again. I forgot that there were audio actions I can use and it worked as suggested. Thanks, Jackkel!
Who is online
Users browsing this forum: Google [Bot]