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.
I have a character in my game who gets referred to as "Mysterious Woman" until the player eventually learns her real name, and that phrase is a bit too long to fit in the name label style the way that I have it set up for all the other characters. So for the name label in the dialogue box, I've edited the way that her name appears by adding some code to the namebox window underneath the following:
if h.who:
if _last_say_who == "mw":
text "{color=#efc9de}Mysterious\n Woman{/color}" xalign 0.2 yalign 0
At first I thought I had totally figured it out, because I got it looking like this:
Exactly what I want! But then I realized that if I try looking at the history screen again once some other character has had dialogue after her, that text I added in place of her default namebox has disappeared. I hadn't considered that since the variable is called "_last_say_who", it will only show up if she was the last character to talk. Does anyone know if there's a different variable I can put in its place to change it for every time her name shows up in the history screen, or another way to handle editing names on that screen specifically? Thanks!
Ocelot wrote: ↑Tue Mar 01, 2022 2:31 pm
Why don't you use h.who directly?
Also note that you can override styles for names in character definition. In your case you could set it to be centered and turn on linebreaking
Just replacing "if _last_say_who" in my code with "if h.who" doesn't seem to do anything - it just shows the default name label on the history screen as if the code wasn't there. Am I doing it wrong? Or alternatively, how would you set the name to be centered and turn on linebreaking in the definition? Thanks!
Bumping up this old thread again as I'm getting back into working on this project and still a little unclear on how to handle this problem. Does anyone have any ideas? Thanks