I'm finding that after using play music "<from xxx>" and then using music.get_playing - the returned music filename also contains the "<from>" text.
Is that supposed to happen ?
Music.get_playing
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: Music.get_playing
I dunno, but this should return your filename string with the <from..> part stripped out, if you need for.
Code: Select all
$ mytrack = renpy.get_playing()
$ trackname = mytrack.partition(">")[2]
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
- Triority
- Regular
- Posts: 183
- Joined: Fri Jul 20, 2018 1:28 pm
- Completed: Welcome To... Chichester 0, 1,2 OVN 1, OVN 2, OVN 3, No Regrets For The Future
- Projects: Welcome To... Chichester series
- Organization: Triority
- Tumblr: Sku-te
- itch: triority
- Location: England
- Discord: sku_te
- Contact:
Re: Music.get_playing
You do have to check for ">" before partitioning otherwise there can be run-time errors if it's not present.
Re: Music.get_playing
Sure, if you want a generical approach.
Even a function returning the name could be used.
(Those are just suppositions, I don't know if there's an internal method to return the spurious track name).
Even a function returning the name could be used.
Code: Select all
def trackname(what):
if ">" in what:
return what.partition(">")[2]
return what
label idunno:
$ mytrack = trackname(renpy.get_playing())
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
- Triority
- Regular
- Posts: 183
- Joined: Fri Jul 20, 2018 1:28 pm
- Completed: Welcome To... Chichester 0, 1,2 OVN 1, OVN 2, OVN 3, No Regrets For The Future
- Projects: Welcome To... Chichester series
- Organization: Triority
- Tumblr: Sku-te
- itch: triority
- Location: England
- Discord: sku_te
- Contact:
Re: Music.get_playing
Very true
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]