Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+2)

I haven't tried this code, but wanted to mention that you should use https://www.renpy.org/doc/html/text.html#renpy.filter_text_tags to fix the text tag issue.
This will filter out text tags before you grab the first x characters :)

Oh and I should mention this as well: https://www.renpy.org/doc/html/other.html#renpy.substitute

You should use both to ensure you're not also accidentally cutting off variable substitutions (e.g. "Hey [name]" would be bad if it got cut off at "Hey [nam")

This can be accomplished in one line if necessary, e.g.

preview = renpy.substitute(renpy.filter_text_tags(TEXT_FOR_FILTERING, allow=[]))

Hope that helps!

I actually just found and implemented renpy.filter_text_tags before you posted this lmao, but thank you for bringing for renpy.substitute to my attention! I'll test this out. Thank you so much! :D

Wanted to let you know the code you provided works! Thank you so much! :D