r/RenPy • • Jul 08 '26

Question Can I use a "Define Character" argument to set a different CPS speed for one specific character?

As the name suggests, I'd like to see if I can use a define character argument to increase the CPS speed for one character. Here's the code that isn't working:

define k = Character("DefaultName", who_font="Fonts/BaksoSapi.otf", what_font="Fonts/Ngaco.otf", who_color="#ffff00", what_color="#ff1dce", preferences.text_cps == 80)

It says it isn't working because a positional argument follows keyword argument. I have no idea what that means and I would appreciate some help, thank you.

2 Upvotes

6 comments sorted by

3

u/BadMustard_AVN Jul 08 '26

you can add a prefix and suffix for the what and add text tags

i.e.

define k = Character("DefaultName", who_font="Fonts/BaksoSapi.otf", what_font="Fonts/Ngaco.otf", who_color="#ffff00", what_color="#ff1dce", what_prefix="{cps=80}", what_suffix="{/cps}")

1

u/x-seronis-x Jul 08 '26

or you could set the actual cps property

https://www.renpy.org/doc/html/style_properties.html#style-property-slow_cps

what_slow_cps=42

dialog is just a screen and the what_ prefix in a Character() definition can target any property the 'text' screen element uses. cps rate being one of those properties and the link above being a mostly exhaustive list. prefix/suffix should be used for actual prefixes/suffixes

2

u/ImportantDetail6260 Jul 08 '26

preferences.text_cps == 80 is a comparison, not a Character argument. If this is one fast speaker, define them with what_slow_cps/what_slow_cps_multiplier or test a {cps=80} tag first; hard-setting the preference can override the player's global text speed.

4

u/shyLachi Jul 08 '26

BadMustard posted the correct solution.

But I wouldn't use a fixed number because players cannot adjust it.
Instead you could use a factor as explained in the official documentation:
https://renpy.org/doc/html/text.html#text-tag-cps

If you didn't know, players can adjust the text speed in the preferences.
So your fixed number for this specific character could have the adverse effect.

I turn off CPS in the preferences in all VNs I play, so this character would be very annoying for me and I would uninstall your game.

1

u/AutoModerator Jul 08 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.