Code: Select all
protein = "steak"
starch = "white"
entree = "bowl"
topping = "none"
The game crashes when it check the variables in label food. What do I need to change so that it works the way I want it to?
Code: Select all
screen order:
tag menu
modal True
default protein = None
default starch = None
default entree = None
default topping = None
frame:
style_group "schedule"
xalign .5
yalign .40
#This controls vertical spacing
has vbox spacing 20
label "Menu"
grid 4 5:
transpose True
label "Protein"
textbutton "Steak" action SetScreenVariable("protein", "steak")
textbutton "Chicken" action SetScreenVariable("protein", "chicken")
textbutton "BBQ Pork" action SetScreenVariable("protein", "pork")
textbutton "Tofu" action SetScreenVariable("protein", "tofu")
label "Rice/Beans"
textbutton "White Rice" action SetScreenVariable("starch", "white")
textbutton "Brown Rice" action SetScreenVariable("starch", "brown")
textbutton "Black Beans" action SetScreenVariable("starch", "black")
textbutton "Pinto Beans" action SetScreenVariable("starch", "pinto")
label "Entree"
textbutton "Bowl" action SetScreenVariable("entree", "bowl")
textbutton "Wrap" action SetScreenVariable("entree", "wrap")
textbutton "Taco" action SetScreenVariable("entree", "taco")
textbutton "Salad" action SetScreenVariable("entree", "salad")
label "Topping"
textbutton "Sour Cream" action SetScreenVariable("topping", "sourcream")
textbutton "Chili" action SetScreenVariable("topping", "chili")
textbutton "Guacamole" action SetScreenVariable("topping", "guacamole")
textbutton "None" action SetScreenVariable("topping", "none")
hbox:
xalign 0.5
textbutton "Done" action [Hide("menu2"), Jump("food")]
textbutton "Cancel" action Hide("menu")
init python:
style.schedule_button.xminimum = 180
style.schedule_label.xalign = .5
label food:
#Check if all four variables match the correct order
if (protein = "tofu" and starch = "brown" and entree = "bowl" and topping = "guacamole"):
"Good job!"
if (protein = "chicken" and starch = "pinto" and entree = "wrap" and topping = "none"):
"Good job!"
else:
"That doesn't sound right."