Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Extended Music Room for Ren'Py

Fully featured music room with improved usability and setup for Ren'Py. · By Feniks

Adding custom arguments & accessing tracks

A topic by Angel Seraph created 76 days ago Views: 51 Replies: 2
Viewing posts 1 to 2

Hello,

I really like this tool you've created. I have 2 questions:

  1. I was just wondering if there is a way to add custom arguments. For example, if I want to display the genre of a song in the track listing, how would I do that?
  2. If I want to access a song to be used elsewhere besides in the music_room screen how would I be able to retrieve it? I've noticed that when declaring a track it uses the `.add()` method. However, I don't really know how I would get that song outside of the music_room screen. For instance, if I want to get the song details, example: `mysong.artwork` or `mysong.name` (or something like that).

Thank you in advance.

Developer

1. Yeah sure! It's just like any other class so feel free to add your own fields, or use the description field however you like (it's just an extra field which has no specific purpose in the code - you can set it to a string, or to a list or tuple of other information you want to access, for example). So you could use the description field as a genre field if you weren't confident about adding your own genre field! 

2. All songs are stored in the playlist field of the ExtendedMusicRoom - you can fetch an individual song's MusicInfo via mr.music_dictionary["audio/music/nutcracker.ogg"] where the path is the one you used to set up that song in the music room and mr is the extended music room the song is in. Typically you have to loop over the whole track list though, which is what the get_tracklist method is for! It'll return all the MusicInfo objects used by the extended music room. Usually that looks like for song in mr.get_tracklist(all_tracks=True): and then you can access song.name and song.description etc.

Hope that helps!

Thank you. I'll have a play around with those.