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.
$ playing = renpy.music.get_playing("music")
if playing is not None:
text playing xpos 0.5 ypos 0.5
else:
text "Press play!" xpos 0.5 ypos 0.5
But of course that understandably comes out looking like "soundfolder/gamemusicfolder/songtitle.ogg". I'd like it so I could define what each file being played displayed as, so it would show up as something like "Song Title - Artist" instead of the file's path. After much googling and experimenting I've had no luck, so any help would be greatly appreciated. Thank you!
Last edited by bluebat on Tue Apr 06, 2021 10:15 am, edited 1 time in total.
# Somewhere where you define variables
define song_list = {
"soundfolder/gamemusicfolder/songtitle.ogg" : "Song Title - Artist",
"soundfolder/gamemusicfolder/anothersong.ogg" : "Another Song - IDK Who",
}
# Then in your screen:
text song_list.get(playing, playing) xpos 0.5 ypos 0.5
This will show name of the sont if it exist in the song_list dictionary, or raw path if it does not.
# Somewhere where you define variables
define song_list = {
"soundfolder/gamemusicfolder/songtitle.ogg" : "Song Title - Artist",
"soundfolder/gamemusicfolder/anothersong.ogg" : "Another Song - IDK Who",
}
# Then in your screen:
text song_list.get(playing, playing) xpos 0.5 ypos 0.5
This will show name of the sont if it exist in the song_list dictionary, or raw path if it does not.
This worked perfectly, thank you so much for your help!