Hmm, seeing as no one has replied yet I'll do my best.
Regarding conditions, there actually was an example within the tutorial. I'm going to copy/pasta straight from the tutorial's code. You can see here that the "condition switches" are created where you keep your sprite code.
Code: Select all
init -1:
$ evil = False
layeredimage augustina:
always:
"augustina_base"
group outfit:
attribute dress:
"augustina_outfit_dress"
attribute jeans:
"augustina_outfit_jeans"
group eyes:
attribute open default:
"augustina_eyes_open"
#default True
attribute wink:
"augustina_eyes_wink"
group eyebrows:
attribute normal default:
"augustina_eyebrows_normal"
attribute oneup:
"augustina_eyebrows_oneup"
group mouth:
#pos (100, 100)
attribute smile default:
"augustina_mouth_smile"
attribute happy:
"augustina_mouth_happy"
if evil:
"augustina_glasses_evil"
else:
"augustina_glasses"
And shown in action below within the script itself.
Code: Select all
$ evil = True
a "Maybe I'm angry at you, or being sneaky. At some point in the game, the {i}evil{/i} variable was set to {i}True{/i}."
show august normal smile regular with dissolve
$ evil = False
a "When the {i}evil{/i} variable is set to {i}False{/i}, my glasses will look normal."
With that as a base, I'll whip up the below as examples.
Code: Select all
"Hmm, what should I go with today?
menu:
“Let's use blue.”
$ blue = True
jump blah
“Feeling green today.”
$ green = True
jump blah
"Not feeling anything"
jump blah
label blah:
"..."
"All right the day's over, let's clean up."
$ blue = False
$ green = False
Of course, you don't only have to use them in a menu. Let's say the character bumped into someone, and spilled coffee on their shirt. You'd then made the stain attribute true. From then on, even in a new scene, the character will have a coffee stain on their shirt. Not until you have them go home and change clothes.
Code: Select all
layeredimage testcharacter:
always:
"images/test/base.png"
group test_eyes auto:
attribute eyesnormal default:
"testcharacter_eyes_normal"
group test_mouth auto:
attribute mouthneutral default:
"testcharacter_mouth_neutral"
if blue:
"eyes_ntrl_blu"
elif green:
"eyes_ntrl_grn"
else:
"eyes_ntrl"
if stain:
"clothes_shirtwhite_coffee"
else:
"clothes_shirtwhite"
I cleaned it up a bit, auto makes things much easier.
To make the auto work, you have to name the image files exactly.
"charactername_body/clothingpart_nameyouwillusetochangeit"
Such as
"testcharacter_mouth_shysmile".
It's not shown in the code, but it's how it's named in the files.
Regarding being able to change more than one attribute, yup! It is possible! The key though is to give everything its own name. You can't name several neutral things normal for example, which is why I changed the mouth to neutral. It'll cause errors because it won't know which "normal" image you're trying to pull up. I'll post some of my code below as an example. I'll be adding in ## to describe what's changing.
Code: Select all
show melanie closed1
#Her eyes are closed now.
m "Make sure to hold my hand tight so we don't get separated."
show asher two lup2 rup2 eplain2 normal2 smile2
#He was originally in pose 1. Now he's in pose 2, so I have to update his left arm, right arm, eyes, eyebrows, and mouth.
a "No one could pull you away from my grasp."
"Ahh, he always makes me feel safe."
#She has also now changed from pose 1 to pose 2. Cute2 are two arms together so the 2nd arm attribute will remain empty for now.
show melanie two cute2 happyopen2 normal2 closed2
m "Could you hold me a while longer? My legs have still not quite recovered from last night."
#His right hand is now on his hip and smiling with his teeth.
show asher righthip2 smileopen2
a "If that's what my wife wishes, then it shall be."
As you can see, a single show statement is enough to make all necessary changes.
Hopefully this was able to clear things up.