TypeError: coercing to Unicode
Posted: Thu Feb 14, 2019 10:26 am
Hi there! I've stumbled upon an error today and after changing up the syntax 100 times to fix it and some research I realised I need help haha. I have this screen with an awful lot of imagebuttons. I'm still using placeholder art atm so I will have to change their positions once I get the finished GUI. To save me a lot of time I thought why not use predefined positions? Here's a snippet of the code:
But it gives me the folliwing error at pos ("bakerypos")
I guess it's a syntax error? (My achilles' heel haha) The positions are numbers and not strings so if I understand correctly it can't convert a string to an int. But I don't know how I should write this down instead. Any thoughts? 
Code: Select all
$ bakerypos = Position(xpos=589, ypos=143)
$ bakerypos2 = Position(xpos=589, ypos=99)Code: Select all
imagebutton:
idle "images/GUI/map/abigale_loc.png"
if abigale_location == "bakery":
if bakeryCharAmount == 2:
pos ("bakerypos")
else:
pos ("bakerypos2")Code: Select all
TypeError: coercing to Unicode: need string or buffer, int found