Ren'Py A little help with displayables?

Ikatikei

Newbie
Aug 1, 2018
91
47
I've been trying to make a code to show the character body, and the face expressions separatedelly. So, when I change an variable of the body, it will show an different skin and whenI change the mood variation, it will show an diferrent face expression. But the thing is...It's only works when I change the variable from an screen. Here is the example:

Python:
default mtskin = "casual"
default mood_mt = "normal"

image mt train = Composite(
    (1280, 720),
    (0, 0), "images/training/mt/[mtskin]_body.png",                     #This is for the skin change... It will search on the folder the image called casual_body.png (it will change with the variable mtskin)
    (0, 0), "images/training/mt/expressions/[mood_mt].png" #This is for the facial expressions change... It works like the skin change
    )
So, my problem is...When I change the variable via an imagebutton or textbutton, it works perfectly. The real problem is when I try to change the variable value from a label.

Examples:
Python:
label start:
    scene bg mt
            if MTMad == True:
                $ mood_mt == "angry" ### It's supposed to show the angry facial expression
            else:
                $ mood_mt == "normal"
            show mt train with moveinleft           #This doesn't work for some reason....
But when I try from an textbutton:

Python:
screen test():
    textbutton "change expression" action SetVariable("mood_mt", "angry")
Why is that happening? What I am doing wrong? Is there any easier way to make expression change easier? I really don't wan't to save five different images and use show and hide everytime to change the facial expression...
 
Sep 17, 2022
123
199
You wanna use layered images:

Would look something like this:

label start:
scene bg mt
if MTMad == True:
show mt_train casual angry with moveinleft
else:
show mt_train casual normal with moveinleft
 
  • Like
Reactions: MissFortune