I'm going to add a phone option on my game, and I wanted to allow the player to choose their "ringtone".
There's like "ringtone1.mp3", "ringtone2.mp3" and "ringtone3.mp3" files.
Then when there's "play ringtone", it will play the chosen one. Is it possible?
Sorry guys, I'm kinda slow now. It's been a long a time since I used Renpy.
Thank you.
Allowing the player to choose the music on this case?
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.
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.
Re: Allowing the player to choose the music on this case?
It is "possible". However, I know of no 'proper' way to do it.
Personally, I'd define a variable that handles the player's choice, something like this:
Again, sorry for the wrong codes, my memory is a bit hazy since it's been a long time. I hope this helps!
Personally, I'd define a variable that handles the player's choice, something like this:
Code: Select all
default pchoice = ""
label start: #or whatever it is called. Sorry, been a long time since I last used the Engine.
#I forgot how to make a menu but imagine if this is a menu
menu:
Which ringtone do you want?
1:
jump ring1
2:
jump ring2
3:
jump ring3
label ring1:
$pchoice = ""ring1"
jump continue
label ring2:
$pchoice = "ring2"
jump continue
label ring3:
$pchoice = "ring3"
jump continue
label continue:
"bla bla bla"
if pchoice == ring1:
play music "ring1.mp3"
if pchoice == ring2:
play music "ring2.mp3"
if pchoice == ring3:
play music "ring3.mp3"
Re: Allowing the player to choose the music on this case?
Thank you so much! I'll try thatHotMango wrote: ↑Sat Aug 15, 2020 2:18 am It is "possible". However, I know of no 'proper' way to do it.
Personally, I'd define a variable that handles the player's choice, something like this:
Again, sorry for the wrong codes, my memory is a bit hazy since it's been a long time. I hope this helps!Code: Select all
default pchoice = "" label start: #or whatever it is called. Sorry, been a long time since I last used the Engine. #I forgot how to make a menu but imagine if this is a menu menu: Which ringtone do you want? 1: jump ring1 2: jump ring2 3: jump ring3 label ring1: $pchoice = ""ring1" jump continue label ring2: $pchoice = "ring2" jump continue label ring3: $pchoice = "ring3" jump continue label continue: "bla bla bla" if pchoice == ring1: play music "ring1.mp3" if pchoice == ring2: play music "ring2.mp3" if pchoice == ring3: play music "ring3.mp3"
Who is online
Users browsing this forum: Google [Bot]