Ok, I seem to have solved this but there should be a quickest way to do it.
Here is the code I used:
in dressup.rpy
Code: Select all
init python:
hair, eyes, skin, outfit = 1, 1, 1, 1, # default dressup items
hair_styles_num, eyes_styles_num, skin_styles_num, outfit_styles_num = 12, 3, 3, 10 # number of styles (files) for each dressup item
screen dressup_example():
## Ensure this appears on top of other screens.
frame:
xalign 0.9
xsize 700
yfill True
# YEUX / EYES
hbox:
xalign 0.5
yalign 0.40
spacing 400
textbutton _("< YEUX") action SetVariable('eyes', max(eyes-1,1))
textbutton _("YEUX >") action SetVariable('eyes',min(eyes+1,eyes_styles_num))
# PEAU / SKIN
hbox:
xalign 0.5
yalign 0.60
spacing 400
textbutton _("< PEAU") action SetVariable('skin', max(skin-1,0))
textbutton _("PEAU >") action SetVariable('skin',min(skin+1,skin_styles_num))
add "look" xalign 0.5
add "images/look/look_exp_1.png" xalign 0.5
if eyes == 1:
add "blinking1" xalign 0.5
if eyes == 2:
add "blinking2" xalign 0.5
if eyes == 3:
add "blinking3" xalign 0.5
# TENUE / OUTFIT
hbox:
xalign 0.5
yalign 0.90
spacing 400
textbutton _("< TENUE") action SetVariable('outfit', max(outfit-1,1))
textbutton _("TENUE >") action SetVariable('outfit',min(outfit+1,outfit_styles_num))
# HAIRS / CHEVEUX
hbox:
xalign 0.5
yalign 0.25
spacing 400
textbutton _("< CHEVEUX") action SetVariable('hair', max(hair-1,1))
textbutton _("CHEVEUX >") action SetVariable('hair',min(hair+1,hair_styles_num))
textbutton _("Done") action ToggleScreen("dressup_example") xalign 0.99 yalign 1.0
in definitions.rpy:
Code: Select all
image blinking1:
"look_eyes_1"
choice:
4.5
choice:
3.5
choice:
1.5
"look_eyes_1_half"
.1
"look_eyes_closed"
.1
"look_eyes_closed"
.1
repeat
image blinking2:
"look_eyes_2"
choice:
4.5
choice:
3.5
choice:
1.5
"look_eyes_2_half"
.1
"look_eyes_closed"
.1
"look_eyes_closed"
.1
repeat
image blinking3:
"look_eyes_3"
choice:
4.5
choice:
3.5
choice:
1.5
"look_eyes_3_half"
.1
"look_eyes_closed"
.1
"look_eyes_closed"
.1
repeat
And for calling it in the script:
Code: Select all
if eyes == 1:
e side blinking1 look "Salut, je suis la nouvelle héroïne du jeu !"
if eyes == 2:
e side blinking2 look "Salut, je suis la nouvelle héroïne du jeu !"
if eyes == 3:
e side blinking3 look "Salut, je suis la nouvelle héroïne du jeu !"
Like I said, using this code each time is a loss of time and there should be a cleaner and faster way to implement that. Does anyone have a suggestion? Thank you in advance
EDIT:
I found a solution!
Code: Select all
if eyes == 1:
"blinking1"
if eyes == 2:
"blinking2"
if eyes == 3:
"blinking3"
I had to define the blinking and instead of saying, if eyes == 1 show me eyes1, I asked: if eyes == 1, show me "blinking1".