Help with some of the functions of the Caption Tool by npck

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
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Help with some of the functions of the Caption Tool by npck

#1 Post by sheetcakeghost »

So, specifically I'm adapting the All-In-One-Gui Template that includes the caption tool.

There are two things I'm needing it to do that I haven't been able to figure out on my own (and google has done little to help me find the information or even the appropriate place to ask it.) Hopefully one of you kind code minded folks can help me out. Thanks in advance if you take the time to do so.

The first thing I need it to be able to do is play an ambient track and a music track at the same time, while displaying the text for both of them. I've tried what the code suggests and made a separate channel for ambient sounds. Then used this phrasing to play each item.

Code: Select all

    $ play_music(inside_night, channel='ambient')
    $ play_music(home)
When that didn't work (rather it still only played what I had listed second, as it immediately overrode what I had listed first) I tried a new tactic. I attempted to duplicate all of the code for music and replaced all mentions of music with ambient (or amb for my convenience).

Code: Select all

    def play_amb(file, channel='ambient', fadein=0.0, fadeout=0.0):
        renpy.music.play(file, fadein=fadein, fadeout=fadeout)
        if persistent.sound_captions:
            renpy.notify (ambtext + amb_list[file])

Code: Select all

     ambtext = _("Ambient: ")

Code: Select all

    amb_list = {
    elevator : _("An elevator is moving."),
I then changed the code in the script to look like this.

Code: Select all

    $ play_amb(inside_night)
    $ play_music(home)
Individually both things work. If I only state one of them it executes fully as intended. It's only when I try to do both at once that I have this trouble.


The second thing I need it to be able to do is display Kanji (rather than empty boxes) when it shows the title of a song. I've attempted to compensate for this with a special font just for Japanese (that I also use in my credits screen, where it works as intended.)

Code: Select all

main : _("{font=NotoJp.otf}ゆきうさぎ{/font} (Mountain Rabbit) - musmus.main.jp")
I don't know of any alternative ways to do this that doesn't require I change the font of the entire game (or even just the font the tool uses, as I'm sure that's possible) to one that has Kanji. Seeing as displaying the titles would be the only instance in which Kanji is used, you can see how that wouldn't be desirable to me.


Also, I apologize if this sort of thing has been asked before. I just couldn't find it anywhere when I searched the forums and google. (Also if this post looks familiar, I had it in the wrong forum at first. I've reposted it here and emptied the original so as to not have doubles.)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]