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.
I put this code in the options.rpy following this tutorial viewtopic.php?t=43333 but when I launch the game there is no Language menu visible, or error code, any Idea about what could be happening? tks!
init -3 python:
if persistent.lang is None:
persistent.lang = "english"
lang = persistent.lang
init python:
config.main_menu.insert(3, (u'Language', "language_chooser", "True"))
init python:
if lang == "english":
style.default.font = "font_name_here_1.ttf" #english font here
elif lang == "espaniol":
style.default.font = "font_name_here_2.ttf" #espaniol font here
Working on many weird narrative games at Curse Box Studios
label language_chooser:
scene black
menu:
"{font=Arimo-Regular.ttf}English{/font}": $ renpy.change_language(None)
"{font=Arimo-Regular.ttf}Русский{/font}": $ renpy.change_language("russian")
$ renpy.utter_restart() #alternatively, use "return" if you don't want to go to the main menu.
**edit: I realize that specific block of code is for a splash screen selection. I don't see it working either but it could be outdated? You could try implementing a section in the preferences menu possibly that selects language
namastaii wrote: ↑Fri Jul 26, 2019 6:05 pm
You need to prompt the user with menu choices that set the language or create your own screen with buttons that do the same thing.
label language_chooser:
scene black
menu:
"{font=Arimo-Regular.ttf}English{/font}": $ renpy.change_language(None)
"{font=Arimo-Regular.ttf}Русский{/font}": $ renpy.change_language("russian")
$ renpy.utter_restart() #alternatively, use "return" if you don't want to go to the main menu.
**edit: I realize that specific block of code is for a splash screen selection. I don't see it working either but it could be outdated? You could try implementing a section in the preferences menu possibly that selects language
Tks, I think I will use this code, but Im having a problem with the font, it says It cant find the Arimo-Regular.ttf file.
Working on many weird narrative games at Curse Box Studios
That's just an example. You don't even need to have it change font right there. I just pasted that from the tutorial you shared. Basically if you wanted to just open a menu in the dialogue (as a simple solution), all it would need to be is something like:
label start:
e "Hi, which language would you like?"
menu:
"English":
$ renpy.change_language(None)
"Русский":
$ renpy.change_language("russian")
$ renpy.utter_restart() #alternatively, use "return" if you don't want to go to the main menu.
namastaii wrote: ↑Fri Jul 26, 2019 7:34 pm
That's just an example. You don't even need to have it change font right there. I just pasted that from the tutorial you shared. Basically if you wanted to just open a menu in the dialogue (as a simple solution), all it would need to be is something like:
label start:
e "Hi, which language would you like?"
menu:
"English":
$ renpy.change_language(None)
"Русский":
$ renpy.change_language("russian")
$ renpy.utter_restart() #alternatively, use "return" if you don't want to go to the main menu.
Tks, that worked, but now it seems like it doesnt choose the files that needs to be using once I selected Epañol