Editing Name Labels in History Screen

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.
Post Reply
Message
Author
User avatar
parttimestorier
Veteran
Posts: 429
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
Projects: Seeds of Dreams
itch: janetitor
Location: Canada
Contact:

Editing Name Labels in History Screen

#1 Post by parttimestorier »

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:

Code: Select all

if _last_say_who == "mw":
That works perfectly so far. So I tried to edit the history screen in the same way, with the following code:

Code: Select all

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:
screenshot0002.png
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!
ImageImageImage

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Editing Name Labels in History Screen

#2 Post by Ocelot »

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
< < insert Rick Cook quote here > >

User avatar
parttimestorier
Veteran
Posts: 429
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
Projects: Seeds of Dreams
itch: janetitor
Location: Canada
Contact:

Re: Editing Name Labels in History Screen

#3 Post by parttimestorier »

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!
ImageImageImage

User avatar
parttimestorier
Veteran
Posts: 429
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
Projects: Seeds of Dreams
itch: janetitor
Location: Canada
Contact:

Re: Editing Name Labels in History Screen

#4 Post by parttimestorier »

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 :)
ImageImageImage

Post Reply

Who is online

Users browsing this forum: Bing [Bot]