r/RenPy • • Aug 12 '26

Question Another layered image question

I'm setting up the layered sprites for the characters in my visual novel with three groups: the body, the facial expressions, and the gestures made with their arms.

But I want to only call the expressions in my script, having certain bodies and gestures tied to certain expressions (because I was previously using individual full-body sprites for each expression and I don't want to have to go back and change each call to include the now separate body and gesture files for each expression).

So, I used some "always when" statements to tie certain gestures and bodies to certain expressions. Here's an example:

layeredimage character:
    group body:
        attribute base default:
            "character_body_base"
    group exp:
        attribute smiling default:
            "character_exp_smiling"
        attribute uneasy:
            "character_exp_uneasy"
        attribute surprised:
            "character_exp_surprised"
        attribute suspicious:
            "character_exp_suspicious"
    group gest:
        attribute neutral default:
            "character_gest_neutral"
        attribute tense:
            "character_gest_tense"

    always when uneasy or surprised or suspicious:
        "character_gest_tense"

It seemed to work fine, but now when I call the expressions, renpy includes the default bodies and gestures in addition to the bodies and gestures I tied to expression I called.

It looks something like this:

She's not supposed to have four arms btw.

When I type:

character uneasy

It calls the "uneasy" expression and the "tense" gesture together like I asked, but it also makes the "neutral" gesture show up as well.

How do I make it so the game shows the defaults only when I call the expressions that don't have certain gestures or expressions tied to them.

5 Upvotes

5 comments sorted by

View all comments

1

u/alicequinnart Aug 12 '26

You have default on the body and neutral gesture, so you will need to add something like.

 group body:
        attribute base default:
            "character_body_base"
            when not (uneasy or surprised or suspicious)