Changing something based on the length of a player input variable?
Posted: Sun May 30, 2021 10:03 am
I'm working on a project in which players can input a custom name for the main character, and I'm currently experimenting with what the character limit on that should be. I'm wondering if I might be able to do something like make the text size smaller in the main character's dialogue label if it's past a certain length. That way players who want to give the character a longer name can still do it, and rather than cutting them off past the point where it would be bigger than the namebox, I just make their name smaller to fit. I've messed around with character-specific labels before by putting things like
on the namebox screen before, so I know where to start with figuring out that part - but I'm not sure whether it's possible to set up an if/else statement that changes something based on the length of the variable text. I tried just throwing
into the code of a random scene to see if it would work, and it gave me an invalid syntax error. Does anyone know what I should be doing instead?
Code: Select all
if _last_say_who == "mc":
add "some_special_image_or_something.png" Code: Select all
if mcfirst length == 8:
"test"