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.
Aside from going into every single line of text and manually setting the CPS for each, is there anyway of changing the CPS separately for each language. The problem I am running into now is that I Japanese and Chinese are should have a much lower CPS than English, especially as I am trying to get it to sync with the speech.
## Preference defaults #########################################################
## Controls the default text speed. The default, 0, is infinite, while any other
## number is the number of characters per second to type out.
default preferences.text_cps = 6
Can I add a conditional here? What would that look like? Or can I some how get this line to appear in the translated script? (by default it is only adding in game text but lines of code like this).
Thanks you for your patience and taking the time to read this.
Last edited by ComputerArt.Club on Mon Jul 01, 2019 10:33 am, edited 1 time in total.
translate chinese python:
preferences.text_cps = 4
Fixes the speed for Chinese and Japanese, and I can set them both independently, but once I change English is also affected.
Since English is the default language, I need to figure out how to get the CPS to reset once it goes back to English.
default language_cps = {
# current, maximum
None : [ 15, 200 ],
'chinese' : [ 4, 15 ],
## etc
}
# bit where you select a language
textbutton "Chinese" action [ SetField( preference, "text_cps", language_cps['chinese'][0] ), Language('chinese') ]
# bit where you adjust cps
value Preference("text speed", range=language_cps[preference.language])
#
# and shoehorn in a bit somewhere that (maybe when you close the prefs screen) takes text_cps and adjusts the language_cps mapping current val
default language_cps = {
# current, maximum
None : [ 15, 200 ],
'chinese' : [ 4, 15 ],
## etc
}
# bit where you select a language
textbutton "Chinese" action [ SetField( preference, "text_cps", language_cps['chinese'][0] ), Language('chinese') ]
# bit where you adjust cps
value Preference("text speed", range=language_cps[preference.language])
#
# and shoehorn in a bit somewhere that (maybe when you close the prefs screen) takes text_cps and adjusts the language_cps mapping current val
Hope that makes sense
Thanks for this! For this particular game I killed off and replaced the old preferences menu, stripped it down to the bear minimum of what I need for the game. So they only get the set cps. Changing it from none to None actually worked and I was able to fix some other problems with the new translate None code, such as the spacing issues I was having as a result of ruby text in the Japanese translation. Your above code looks really interesting if someone is keeping the preferences menu. I'm sure either I or someone else will learn from it for future games. Thanks again Remix! You are amazing!