I'll make a simplified version of what I'm dealing with.
Code: Select all
init python:
hair_color_list = ["blonde", "brown", "black"]
class Girl(object):
def __init__(self):
self.hair = random.choice(hair_color_list)
2. If I put it in regular python:, then there is no Girl class when I load the game and the game crashes.
3. If I put only the Girl class in the init python:, then it misses a hair_color_list
4. Of course I could solve this by defining the list twice, but that seems a very inelegant solution, and bound to lead to errors later on in development.
How should I resolve this?