is config.speaking_attribute supposed to replace other image attributes?

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
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

is config.speaking_attribute supposed to replace other image attributes?

#1 Post by zmook » Sun May 29, 2022 11:59 am

My impression is that config.speaking_attribute is supposed to append to whatever attributes are already being shown for an image tag -- at least the docs say "The image attribute is added to the image when the character's image tag when the character is speaking, and removed when the character stops." Instead I'm seeing the 'speaking' attribute *replace* all existing attributes while the dialog is up.

E.g.

Code: Select all

    show kasei unhappy with dissolve
    # "kasei unhappy" flashes on the screen, then is immediately replaced by "kasei speaking" rather than "kasei unhappy speaking"
    ka "I should probably leave before they find me here. This doesn't need to be your problem."  # "kasei speaking" is showing
    # "kasei unhappy" is restored
    pc "What? Don't do that. I mean, if you're in trouble, I'd like to, um, help?"
I have checked, and images for "kasei unhappy" and "kasei unhappy speaking" both exist.

Is this a bug in 8.0, or does config.speaking_attribute just not do what I expected?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: is config.speaking_attribute supposed to replace other image attributes?

#2 Post by PyTom » Sun May 29, 2022 12:09 pm

It's equivalent to:

Code: Select all

show kaisei speaking
ka "I should probably leave before they find me here. This doesn't need to be your problem.
show kaisei -speaking
The former is special cased, I believe, so that if it exactly matches a defined image, that image is shown. That's probably what's happening here.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: is config.speaking_attribute supposed to replace other image attributes?

#3 Post by zmook » Sun May 29, 2022 12:39 pm

Oh, huh. Okay, this isn't an issue with config.speaking_attribute, then, but is a surprising special case in 'show'.

Code: Select all

    hide kasei
    "testing now"
    show kasei
    "see plain kasei: check"
    show kasei happy
    "see happy kasei: check "
    show kasei speaking
    "I expected to see 'kasei happy speaking' now, but it's actually just 'kasei speaking'…"
Let's see if I understand this. For this to work the way I want, to avoid getting caught in this special case, "image kasei speaking" can't exist. That means I have to add an attribute to neutral kasei so she is declared as "image kasei neutral" and I always have to do "show kasei neutral" instead of just "show kasei". Correct?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: is config.speaking_attribute supposed to replace other image attributes?

#4 Post by PyTom » Sun May 29, 2022 12:55 pm

That's right, if I'm analyzing this correctly.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users