See Nyaatrap's response for code: *clicky*
ありがとう ございます Nyaatrap-san! ^_^
Note! This is not my game originally!
Some clever people can probably figure out which game it is despite the fact that I've changes some variables around... I humbly ask you keep it to yourselves. Thank you!
I'm modifying it with no intentions on releasing it!
The main reason I'm doing this is to learn more about Ren'Py and Python.
That said, here's the code I have at the moment:
Code: Select all
for o in outfit_list:
for e in expression_list:
renpy.image("chris {}".format(e), ConditionSwitch(
"player.image=='{}' and player.cos==1".format(o.image),im.Composite((1045,1536),(0,0),"sprites/{}/base1.png".format(o.image),(0,0),"sprites/chris/{}.png".format(e)),
"player.image=='{}' and player.cos==2".format(o.image),im.Composite((1045,1536),(0,0),"sprites/{}/base2.png".format(o.image),(0,0),"sprites/chris/{}.png".format(e)),
"player.image=='{}' and player.cos==3".format(o.image),im.Composite((1045,1536),(0,0),"sprites/{}/base3.png".format(o.image),(0,0),"sprites/chris/{}.png".format(e))))
expression_list is just a plain list of words: smile, laugh, angry, etc.
The 'chris' folder contains a base sprite and all the expressions.
The error I'm getting is 'Exception: Switch could not choose a displayable.'
I've checked (in-game) that o.image returns the correct string.
Is it not possible to have a for loop within a for loop or what am I doing wrong?