[resolved] How to loop music in the music room ?

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
User avatar
Ryouzanki
Regular
Posts: 31
Joined: Mon May 21, 2012 2:18 am
Projects: Sous le masque / Social shark
Organization: Bal masqué
Location: France
Contact:

[resolved] How to loop music in the music room ?

#1 Post by Ryouzanki » Thu Nov 08, 2012 6:56 pm

Hello ! This question seems a bit idiot, but actually, I dont find how to loop music in the music room. Lock and unlock work pretty well but when I play a music in the music room, at the end, it play the next unlocked file. It is pretty annoying since some of my music are loop of 20-30s... Does anyone know how to loop music with the music room ?
Last edited by Ryouzanki on Fri Nov 09, 2012 8:42 am, edited 1 time in total.

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

Re: How to loop music in the music room ?

#2 Post by Levrex » Fri Nov 09, 2012 5:13 am

I just modified the music room itself, because i don't know how to modify part of the class without re-defining it in Python.

common/00musicroom.rpy
Find line that says playlist = playlist[idx:] + playlist[:idx] (in "play" function).
The line just below is what you need.

Swap the "playlist" in that line (renpy.music.play) with the "filename", and there ya go with little blood.
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.

User avatar
Ryouzanki
Regular
Posts: 31
Joined: Mon May 21, 2012 2:18 am
Projects: Sous le masque / Social shark
Organization: Bal masqué
Location: France
Contact:

Re: How to loop music in the music room ?

#3 Post by Ryouzanki » Fri Nov 09, 2012 8:41 am

Wow, thank you very much, it works :D

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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: [resolved] How to loop music in the music room ?

#4 Post by PyTom » Fri Nov 09, 2012 8:59 am

If you just want a music room where things loop, you don't need the Ren'Py music room code.

Instead, you can just use the Play action, to play each track individually.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Ryouzanki
Regular
Posts: 31
Joined: Mon May 21, 2012 2:18 am
Projects: Sous le masque / Social shark
Organization: Bal masqué
Location: France
Contact:

Re: [resolved] How to loop music in the music room ?

#5 Post by Ryouzanki » Fri Nov 09, 2012 7:09 pm

Yes however I want the player to unlock music before listening to it again in the music room.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot