ann-arcana

Queen of Burgers 🍔

Writer, game designer, engineer, bisexual tranthing, FFXIV addict

OC: Anna Verde - Primal/Excalibur, Empyreum W12 P14

Mare: E6M76HDMVU
. . .



lexyeevee
@lexyeevee
stepnix
@stepnix asked:

I wanna hear about Ren'Py! Any cool and unexpected tricks you've seen with it?

it's not exactly what you asked, but since this is kind of similar to the other question, i'm going to talk about it anyway —

here's the thing about renpy: how impressive something looks has no bearing on how tricky it was to do. in fact even if you know how tricky something is to do, and you see it done, you can't really tell how tricky it was to do.

here is my example i will never let go of. by default, renpy collapses whitespace in strings into a single space, sort of like html does. i like to double-space between sentences so this is very annoying to me. however it happens extremely early so there is no way to, like, intervene. it doesn't just happen when text is displayed; it happens when renpy loads your code.

the only advice i have ever seen for this problem is "if you want two spaces, make one of them a U+00A0 non-breaking space". like you would in html, i guess. i would estimate that 50% of renpy advice i've seen given has been of this form. "if you want X to be like Y, then just remember to do Y every time you do X." i am a programmer so to me this is clearly insane.

so what i did is i monkeypatched the renpy lexer

99% of renpy developers will have no idea what that even means. probably a significant chunk of professional dayjob programmers won't know what that means. it is comically ludicrous and i had to think of it myself

(a more accessible solution would be to intercept say to inject an extra space where appropriate, but that's both error-prone and also doesn't solve other ways text is displayed)

so when you see, for example, a renpy game that clearly features double-spacing between sentences, you might not think anything of it at all, unless you're a renpy dev and have tried to do it yourself. but even then, you don't really know if the author manually pasted a unicode space character every time they typed a period, or if they chose violence so that they would never ever have to think about this microscopic problem ever again

a lot of my time with renpy is like that


You must log in to comment.

in reply to @lexyeevee's post:

Ren'py has its quirks, and its solutions are sometimes quirky, and it drives me absolutely barmy.
But I'm not about to try to make my own VN engine from scratch so I'm glad it exists.

Addendum: config.replace_text exists, I wonder if that could be used on ".[ ]" to replace it with ".[ ][ ]" ... (except without the indicative brackets)

EDIT: nevermind I don't think it works :v
EDIT2: no it DOES work it just doesn't work if the text has wait tags after the period like I do everywhere oh my god

note that you would have to replace with ". " + " " or r"\1 " or similar, because a replacement string with two spaces will also have its spaces collapsed

"pause after periods" is another problem i absolutely refused to solve by simply typing the same thing 500 fucking times lmao

(also periods are not necessarily the end of a sentence in english, but my auto-pauser doesn't actually look for double-spaces to indicate sentences so i guess i'm a hypocrite there. flora doesn't have a lot of "Mr." though)

I have seen posts on the Renpy forums where someone created an automatic pause system for after periods and commas and such, but since I vary between {w} user-prompted and {w=x} time-prompted, and I'm used to manually adding them in RPG Maker, I'm not too fussed, hahah.

On the other hand, if I did automate it it would keep the rule consistent...

i don't use {w} because it breaks space-to-fill-textbox. (if there's a {w} then space will only fill up to that point, even if it's {w=N}.) i had to think of...... something else.

a lot of my time with renpy is like that,

Having worked on a commercial VN and its own proprietary engine, yeah, I don't really recommend trying to build your own

ren'py probably isn't the best example of a VN engine out there but gosh, it exists and it's Good Enough and it does a lot of things pretty well