6.16: Automatic Voice + Translations

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

6.16: Automatic Voice + Translations

#1 Post by xavimat » Thu Oct 24, 2013 5:15 pm

Me again, with my strange translation-related posts:

I've been playing with the new (6.16) feature Automatic Voice. The first thing I found is that the voice is only played the first time, if I return to the Main Menu and start again, it's not played.

I'm trying to use Automatic Voice with different translations, but I only have been able of figuring out this:

Code: Select all

init python:
    if _preferences.language is None:
        config.auto_voice = "voice/english/{id}.ogg"  # or simply: config.auto_voice = "voice/{id}.ogg"
    else:
        config.auto_voice = "voice/" + _preferences.language + "/{id}.ogg"
But it needs the user to restart the game every time the Language is changed, otherwise, the former language is played, while the text in the new language is displayed.

Also, the "Extract Dialogue" feature doesn't consider the translated script.
It could be possible to have different "dialogue identifiers" according to the translations?:
> Language = None; id = start_a170b500
> Language = "spanish"; id = start_a170b500_spanish
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

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: 6.16: Automatic Voice + Translations

#2 Post by PyTom » Thu Oct 24, 2013 9:41 pm

xavimat wrote:I've been playing with the new (6.16) feature Automatic Voice. The first thing I found is that the voice is only played the first time, if I return to the Main Menu and start again, it's not played.
Could you put together a replication for me? This shouldn't happen.
I'm trying to use Automatic Voice with different translations...
I've modified Ren'Py so that auto_voice can be a function instead of a string. The function can access all sorts of things, including _preferences.language. So you should be able to do what you want.
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
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: 6.16: Automatic Voice + Translations

#3 Post by xavimat » Fri Oct 25, 2013 5:51 am

PyTom wrote:
xavimat wrote:I've been playing with the new (6.16) feature Automatic Voice. The first thing I found is that the voice is only played the first time, if I return to the Main Menu and start again, it's not played.
Could you put together a replication for me? This shouldn't happen.
My little test (sorry about my pronunciation :oops: )
voice_test.zip
(209.98 KiB) Downloaded 42 times
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

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: 6.16: Automatic Voice + Translations

#4 Post by PyTom » Fri Oct 25, 2013 10:58 pm

Thanks for the replication. Having that made it easy to fix the underlying bug.
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
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: 6.16: Automatic Voice + Translations

#5 Post by xavimat » Sat Oct 26, 2013 3:13 am

Glad to help! :)
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: 6.16: Automatic Voice + Translations

#6 Post by xavimat » Mon Oct 28, 2013 10:55 am

Tested in 6.16.0.335 and both things work.
I've used this code for auto_voice:

Code: Select all

init python:
    def the_voice(identifier):        
        if _preferences.language is None:
            return "voice/english/" + identifier + ".ogg"            
        else:
            return "voice/" + _preferences.language + "/" + identifier + ".ogg"            
    config.auto_voice = the_voice
On the other hand, there is a small error in the documentation of auto_voice ( http://www.renpy.org/dev-doc/html/voice ... atic-voice ), the variable config.auto_dialogue should be config.auto_voice.

About the translations, I've seen also the new feature: "translate None strings:" It's wonderful for us who write the original text in non-English language. Thanks!
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

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: 6.16: Automatic Voice + Translations

#7 Post by PyTom » Mon Oct 28, 2013 11:00 am

I've fixed that, thanks for pointing it out.

Translate None strings is actually an old (6.15 series) feature, as it existed in 6.15, but wasn't documented. (I actually went in to implement the feature for 6.16, only to realize it was already there.)
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

Post Reply

Who is online

Users browsing this forum: No registered users