How to add Song Information to "Music Room." [Solved]

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.
Post Reply
Message
Author
yukiculkin
Newbie
Posts: 5
Joined: Tue Nov 27, 2012 3:25 am
Contact:

How to add Song Information to "Music Room." [Solved]

#1 Post by yukiculkin » Tue Nov 27, 2012 3:36 am

My Question: I'm wanting to find a way to add song information in the music room screen. That is, say I am playing the "So-n-so Song" by The So-n-Sos in the music room. Ideally, there would be that very information somewhere on the screen (song title, singer, song length, etc.)

I guess the real question is: can what I want even be done at all? I've been fiddling with for clauses and if/else loops and so forth, but because I'm a complete failure when it comes to code, I've yet to figure out any magic fixes. :/ I did try to search the forums for similar topics, but I didn't find anything relevant (....I might've missed everything though OTL).

Thank you! :D
Last edited by yukiculkin on Fri Feb 08, 2013 6:25 pm, edited 1 time in total.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: How to add Song Information to "Music Room."

#2 Post by Levrex » Tue Nov 27, 2012 4:39 am

Answer to real question is yes.

=======

Answer to your question is below.

Code: Select all

textbutton _("So-n-so Song"):
    action [mr.Play("music/SNS.ogg"), Show("music_info", chapter_text=u'The song that's played currently is called "So-n-so Song" and was written by The So-n-Sos.')]
(Assuming "mr" is a MusicRoom alias, as in the wiki.)

Code: Select all

screen music_info:
    
    window background None:
        area (16, 305, 580, 100)
        
        text chapter_text:
            style "chapter_text"
That shows only text somewhere on the screen in a certain area when you click the button (my screen is using a custom style). If you want to show info when you hover over it - use "hovered" event for showing screen instead.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

yukiculkin
Newbie
Posts: 5
Joined: Tue Nov 27, 2012 3:25 am
Contact:

Re: How to add Song Information to "Music Room."

#3 Post by yukiculkin » Fri Feb 08, 2013 4:39 pm

Sorry for the late reply, but thank you! That worked wonderfully!

User avatar
kuri_chii
Regular
Posts: 69
Joined: Sat Apr 27, 2013 10:34 am
Completed: RHWIMY beta 1.0
Projects: Right here where I met you, Love Snatch, Monarchy High
Organization: VND - AWA
IRC Nick: Kuri
Deviantart: franzzzz002
Skype: franz.mole
Location: Somewhere in Asia
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#4 Post by kuri_chii » Sat Jun 08, 2013 8:00 am

is this possibly can be use in imagebutton: like this

Code: Select all

imagebutton:
            action mr.Play("music/Akogare no Hibi.mp3")
            idle "gui/Track1.png"
            hover "gui/Track2.png"
cause when I try the code

Code: Select all

imagebutton:
            action mr.Play("music/Ajisai no Ha.mp3") Show("music_info", chapter_text=u'The song thats played currently is called "Ajisai no Ha" and was written by Yukari Hashimoto.')]
            idle "gui/Track1.png"
            hover "gui/Track2.png"
But it shows error:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/options.rpy", line 404: u'Show' is not a keyword argument or valid child for the imagebutton statement.
    action mr.Play("music/Ajisai no Ha.mp3") Show("music_info", chapter_text=u'The song thats played currently is called "Ajisai no Ha" and was written by Yukari Hashimoto.')]
                                                 ^

Ren'Py Version: Ren'Py 6.15.3.303
can you help me?
The best way showing your feelings is to write Novel Stories :3
Image
DeviantArt | Monarchy High | RHWIMY | Love Snatch

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#5 Post by pwisaguacate » Sat Jun 08, 2013 11:49 am

You are missing a left bracket and a comma around mr.Play():

Code: Select all

    imagebutton:
        idle "gui/Track1.png" hover "gui/Track2.png"
        action [mr.Play("music/Ajisai no Ha.mp3"), Show("music_info", chapter_text=u'This song is called "Ajisai no Ha", written by Yukari Hashimoto.')]
        #      ^                                 ^

User avatar
kuri_chii
Regular
Posts: 69
Joined: Sat Apr 27, 2013 10:34 am
Completed: RHWIMY beta 1.0
Projects: Right here where I met you, Love Snatch, Monarchy High
Organization: VND - AWA
IRC Nick: Kuri
Deviantart: franzzzz002
Skype: franz.mole
Location: Somewhere in Asia
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#6 Post by kuri_chii » Sat Jun 08, 2013 3:06 pm

pwisaguacate wrote:You are missing a left bracket and a comma around mr.Play():

Code: Select all

    imagebutton:
        idle "gui/Track1.png" hover "gui/Track2.png"
        action [mr.Play("music/Ajisai no Ha.mp3"), Show("music_info", chapter_text=u'This song is called "Ajisai no Ha", written by Yukari Hashimoto.')]
        #      ^                                 ^

wii! Thnx...wew...shame on me...Why I dont use my logic?? hehhe thnx a lot :3

But how will I get rid of this when returning to main menu? O_O
The best way showing your feelings is to write Novel Stories :3
Image
DeviantArt | Monarchy High | RHWIMY | Love Snatch

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#7 Post by pwisaguacate » Sat Jun 08, 2013 3:46 pm

Use the MainMenu() screen action somewhere:

Code: Select all

screen my_screen:

    # This ensures that any other menu screen is replaced.
    tag menu

    [...]

    textbutton _("Main Menu") action MainMenu()
The Save/Load and Preferences screens also use "use navigation", but music rooms / extras are most likely not to be linked to ingame.

User avatar
kuri_chii
Regular
Posts: 69
Joined: Sat Apr 27, 2013 10:34 am
Completed: RHWIMY beta 1.0
Projects: Right here where I met you, Love Snatch, Monarchy High
Organization: VND - AWA
IRC Nick: Kuri
Deviantart: franzzzz002
Skype: franz.mole
Location: Somewhere in Asia
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#8 Post by kuri_chii » Sat Jun 08, 2013 3:57 pm

pwisaguacate wrote:Use the MainMenu() screen action somewhere:

Code: Select all

screen my_screen:

    # This ensures that any other menu screen is replaced.
    tag menu

    [...]

    textbutton _("Main Menu") action MainMenu()
The Save/Load and Preferences screens also use "use navigation", but music rooms / extras are most likely not to be linked to ingame.
Im using imagebutton:...if I change it to MainMenu()...it doesnt hover...
why is that?

im putting it on my Extras menu
The best way showing your feelings is to write Novel Stories :3
Image
DeviantArt | Monarchy High | RHWIMY | Love Snatch

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#9 Post by pwisaguacate » Sat Jun 08, 2013 4:42 pm

kuri_chii wrote:Im using imagebutton:...if I change it to MainMenu()...it doesnt hover...
why is that?

im putting it on my Extras menu
Imagebuttons work similarly:

Code: Select all

    imagebutton:
        idle "mm_button_idle.png" hover "mm_button_hover.png" action MainMenu(confirm=False)
Is it not working for you? (What doesn't hover?)

User avatar
kuri_chii
Regular
Posts: 69
Joined: Sat Apr 27, 2013 10:34 am
Completed: RHWIMY beta 1.0
Projects: Right here where I met you, Love Snatch, Monarchy High
Organization: VND - AWA
IRC Nick: Kuri
Deviantart: franzzzz002
Skype: franz.mole
Location: Somewhere in Asia
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#10 Post by kuri_chii » Sat Jun 08, 2013 5:01 pm

its really not working... :(

Code: Select all

imagebutton:
            action MainMenu()
            idle "gui/Return1.png"
            hover "gui/Return2.png"
thats my imagebutton: code
The best way showing your feelings is to write Novel Stories :3
Image
DeviantArt | Monarchy High | RHWIMY | Love Snatch

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: How to add Song Information to "Music Room." [Solved]

#11 Post by Levrex » Sun Jun 09, 2013 1:42 pm

If it doesn't hover, it means it's still in the main menu context or whatever it's called.
That means you need to either Start a label beforehand, or use Return(), or use Show("main_menu").
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]