My goal is to have a screen with a number of buttons, and the player will select variables that they believe is related to the diagnosis. There'll be multiple possible diseases, and each with their own set of answer key. The player will have the option of choosing all the different diseases, and the screen is a way for them to justify their choice (they choose which of the patients factors are related to their diagnosis).
The disease name will be a string, and the chosen_answer will be a list of boolean values that I'll compare from the answer key once the player selects the last button, "That's All".
I've just included two of the reasons for the diagnosis here but in the actual program there'll probably be at least 12.
Code: Select all
screen justification(disease,chosen_answer):
zorder 100
modal True
frame:
xalign 0.5 ypos 10
vbox:
text "Why do you think this is [disease]?"
textbutton "Demographic":
action SetVariable("chosen_answer[0]", True)
textbutton "Site of Pain":
action SetVariable("chosen_answer[1]", True)
textbutton "That's all":
action [Hide("justification", transition=None)]
Code: Select all
show screen justification(disease=disease, chosen_answer=chosen_answer)
Code: Select all
File "renpy/common/00action_data.rpy", line 50, in get_selected
return getattr(self.object, self.field) == self.value
AttributeError: 'StoreModule' object has no attribute 'chosen_answer[0]'