[Solved] Choosing "ringtone"? Default music?

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
Danah
Newbie
Posts: 20
Joined: Fri Sep 27, 2019 7:38 pm
Contact:

[Solved] Choosing "ringtone"? Default music?

#1 Post by Danah » Mon Sep 30, 2019 5:59 pm

We can create a default image like this:

Code: Select all

default bgr = '1'
image bgr = 'img[bgr].png'
And then allow the person to change the image creating a button like this:

Code: Select all

    textbutton '{size=30}Background{/size}' action SetVariable('bgr', '2'), Return() pos(30,460)
Is it possible to do the same with music?

I wanted to allow the player to choose their ringtone ("ringtone1.ogg", "ringtone2.ogg", "ringtone3.ogg"). So when I use "play music ringtone" their chosen ringtone will play.

I didn't find any information about it. Is that possible?
Thanks.
Last edited by Danah on Fri Oct 04, 2019 8:06 am, edited 1 time in total.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1310
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: deadseed
itch: lunalucid
Location: USA
Contact:

Re: Choosing "ringtone"? Default music?

#2 Post by namastaii » Mon Sep 30, 2019 8:14 pm

It's the same thing really. you can create a default variable and pop it into the audio file path
https://www.renpy.org/doc/html/audio.ht ... -namespace

User avatar
Danah
Newbie
Posts: 20
Joined: Fri Sep 27, 2019 7:38 pm
Contact:

Re: Choosing "ringtone"? Default music?

#3 Post by Danah » Wed Oct 02, 2019 10:18 am

namastaii wrote:
Mon Sep 30, 2019 8:14 pm
It's the same thing really. you can create a default variable and pop it into the audio file path
https://www.renpy.org/doc/html/audio.ht ... -namespace
Thank you! I'm going to try it :)

User avatar
namastaii
Eileen-Class Veteran
Posts: 1310
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: deadseed
itch: lunalucid
Location: USA
Contact:

Re: Choosing "ringtone"? Default music?

#4 Post by namastaii » Wed Oct 02, 2019 1:12 pm

Actually the new version of renpy released yesterday and you can do it more directly now
https://www.renpy.org/doc/html/changelog.html#audio

User avatar
Danah
Newbie
Posts: 20
Joined: Fri Sep 27, 2019 7:38 pm
Contact:

Re: Choosing "ringtone"? Default music?

#5 Post by Danah » Fri Oct 04, 2019 8:04 am

namastaii wrote:
Wed Oct 02, 2019 1:12 pm
Actually the new version of renpy released yesterday and you can do it more directly now
https://www.renpy.org/doc/html/changelog.html#audio
I haven't downloaded the new version yet. I'll give it a look. Thanks! :)

Post Reply

Who is online

Users browsing this forum: noeinan