Hello all,
This is my problem. I want to make a multi-language games.
This is my exemple code for dialogue in the game :
bob "[dia1]"
and this is my code for dialogue :
define dia1 = Character("Hello!")
define dia2 = Character("Very nice...")
etc ...
I have a option in the beginning (for english_langu or french_langu). I want to change the "dia1" with condition. I test this code but it disn't work ....
if english_langu:
define dia1 = Character("Hello!")
define dia2 = Character("Very nice...")
if french_langu:
define dia1 = Character("Bonjour!")
define dia1 = Character("Très jolie...")
Sorry for my english ...
Define Carracter with condition.
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.
-
- Regular
- Posts: 31
- Joined: Sat Jun 02, 2018 3:00 pm
- Contact:
- plaster
- Regular
- Posts: 89
- Joined: Thu Jul 11, 2013 1:03 am
- Tumblr: plasterbrain
- Soundcloud: plasterbrain
- Location: Chicago
- Contact:
Re: Define Carracter with condition.
Have you looked at Ren'Py's built-in translation framework? Just write everything in one language:
... and then when you're done, click Generate Translations in the launcher and make a translation called "french". Then in game/tl/french you'll see a copy of the game's scripts. You can edit those and fill in your French translations, which will look something like this when you're done:
Then instead of your custom language variable, use _preferences.language to get the current language name ("french" or None for English). You can change the language in the script with renpy.change_language("french") or from a screen using action Language("french")
Code: Select all
bob "Hello!"
bob "Very nice..."
Code: Select all
translate french strings:
old "Hello!"
new "Bonjour!"
old "Very nice..."
new "Très jolie..."
-
- Regular
- Posts: 31
- Joined: Sat Jun 02, 2018 3:00 pm
- Contact:
Re: Define Carracter with condition.
Thx, I will see that
Who is online
Users browsing this forum: Google [Bot], Nozori_Games, voluorem