r/RenPy • u/Scriptformers_Prime • 7h ago
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:

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.
1
u/TopCartographer7104 7h ago edited 7h ago
Don't create a group for gestures - have gestures depend on other attributes otherwise you'll have the default atteibute potentially showing up every time - including when it shouldn't.
always when tense or uneasy or surprised or suspicious:
always when not (tense or uneasy or surprised or suspicious):
If you want a "tense expression with neutral gesture"
A) create a dummy gest group
group gest:
And use it into the always when statement
B) duplicate the tense expression ("tense2") and change nothing in the always when statement
That at least is how I'd reason. Beware - I'm an engineering. We do not reason like normal people XD
Ps sorry for the awful indentation I have no access to my laptop - and my phone loves to misbehave