I'll start with some context:
When the customer makes an order, the script calls a label that sets ingredient parameters.
Code: Select all
label day1:
r "I would like a sandwich with bread_roll and bacon. toasted."
$ reset_order_vars()
#sets customer order to one of the orders from the menu (aka one of the limited amount of defined sandwich objects)
$ order_full = test_order
#sets part of the object to another variable with just the list of needed ingredients.
#is checked when the complete sandwich is being prepped
#also checked when counting amount of mistakes
$ order = test_order.order
#whether or not the customer wants the order toasted
$ customer_toasted = True
#timers for various moods.
$ set_counts(10.0, 10.0, 10.0, 10.0)
#shows how much money the player has
$ currency_display = True
call sandwich_minigame
################# ####################### this code runs after player finishes the minigame
if sandwich_mistakes == 0:
jump day1_order1_correct
elif sandwich_mistakes < 3:
jump day1_order1_wrong
else:
jump day1_order1_very_wrong
label day1_order1_correct:
r "correct"
#give mc his extra money if he gets order right
$ shift_commission = shift_commission + order_full.commission
$ shift_total_tips = shift_total_tips + 100
jump day1_order1_done
label day1_order1_wrong:
r "wrong"
$ shift_mistakes = shift_mistakes + sandwich_mistakes
jump day1_order_done
label day1_order1_very_wrong:
r "very wrong"
$ shift_mistakes = shift_mistakes + sandwich_mistakes
jump day1_order_done
label day1_order1_done:
$ reset_order_vars()
"Customer 1 done"
Code: Select all
## Parameters for each draggable. Go here before going to deli screens.
label sandwich_minigame: #label used so the variables can be reset by running the initial set variables. screen returns here to reset stuff
# Setting drag variables.
python:
#ingredients of a certain type should all have a common tag. ex: bread_wedge, bread_roll, etc. needed for the filter to work
#list of dictionaries
drag_param = [
## Breads
{
"name": "bread_roll",
"child": "images/deli/bar/breads/bread_roll.png",
"hover_child": "images/deli/bar/meats/meat_bacon/meat_bacon_hover.png",
"selected_hover_child": "images/deli/bar/meats/meat_bacon/meat_bacon_dragging.png",
"x": 550,
"y": 200,
"draggable": True,
"anim": None
},
....
#after setting parameters, go to a label that calls the deli screen and also controls other parts of screen flow
call .minigame
return
Code: Select all
## Controls deli screen flow. deli screens return here whenever an ingredient is dragged to stop placement anims from repeating
#also returns here after serving to calculate number of mistakes player made
#also returns when resetting sandwich mini-game
label .minigame:
call screen sandwich_interface with in_25
#this code ensures that ingredient placement animations do not play again when returning to screen
python:
...
if _return == "meat_before_bread":
show screen sandwich_interface
"I can't put meat before bread{w=10.0}{nw}"
jump .minigame #go back to beginning of flow
elif not _return:
jump .minigame #go back up to beginning of label
#checks for mistakes
python:
...
return ##when the player is done with the minigame, this returns to the first label where the character reacts depending on the amount of mistakes made
One thing I tried was making labels for the conversations themselves and calling those labels when the screen is loaded:
Code: Select all
screen sandwich_interface():
zorder -2 #make sure it's on top of customer and under hud
modal False
# aynchronous customer dialogue using interpolation
if fresh_prep:
Call("shift_[current_shift]_sandwich_dialogue_[current_convo]")
.......
label shift_1_sandwich_dialogue_1:
show screen sandwich_interface
pause 5.0
r "This is asynchronous dialogue{w=3.0}{nw}"
hide screen sandwich_interface
return