How to make a restaurant/diner minigame?

Hey! I was wondering if it’s possible to make a mini-game in RPGMaker MV that will let the player carry and serve dishes to NPCs that will act as customers, and if so, does anyone know how I could go about making it? I think it would be really fun, and a way for players to earn money! :smiley:

I also want to add a timer for customer patience, and customers to request things. How do I do that?

Yes, this should be doable with just events.

The core of it is a variable holding what the player is currently carrying. The kitchen or counter event sets it (1 = soup, 2 = pie, and so on), and you can use Set Movement Route on the player with Change Image to swap to a carrying sprite so it reads visually.

Each customer NPC then needs a Conditional Branch on that variable. If it matches what they ordered, Change Gold, set the carry variable back to 0, and swap the player image back. If it doesn’t match, they say something and nothing happens.

For the orders I’d give each customer their own variable set with Control Variables → Random, and the branch compares the carry variable against it. Control Timer can add the pressure if you want customers to leave when it runs out.

Ooh! Is it possible to make the customers random, and a time-limit as well? Also I’ll admit I know very little about variables and branches. Especially branches. I’m not very smart to be honest lol. :sweat_smile:

If it’s okay, could you provide image examples on how this could work?

Both are doable, yeah. Random customers you can do by picking a number with Control Variables → Random and branching on it to decide who walks in and what they order, and the time limit is Control Timer.

There’s a tutorial that’s almost exactly what you’re describing. It’s a cafe job where you take a coffee from the counter and bring it to a table, all eventing, no plugins. It’s written for MZ but the author says it should work fine in MV: Cafe Job/Minigame Tutorial RMMZ (No Plugins) | RPG Maker Forums

And for the variables and branches part on its own, this one has a downloadable demo project you can open up and click through, which I think helps more than screenshots: RPG Maker MV - Switches, Branches & Variables [Basic] | RPG Maker Forums

Turns out that tutorial is only helpful if you only want to serve the customers coffee. I’m not sure how to get them to ask for things, or how to implement a timer. I really need some visual examples, but I can’t find any. :sweat_smile::broken_heart:

Can anyone provide visual examples of how to add a timer and customer requests? Please?

Here’s the whole customer as one event page, Trigger set to Action Button. Variable 0011 is the order, 0012 is what the player is carrying, Switch 0001 is whether this customer is waiting on something.

◆Conditional Branch: Variable [0011: Order] == 0
  ◆Control Variables: [0011: Order] = Random 1..3
  ◆Control Timer: Start (0 min, 30 sec)
  ◆Control Switches: [0001: Waiting] = ON
  ◆Conditional Branch: Variable [0011: Order] == 1
    ◆Text: Soup for me, please!
  ◆Else
    ◆Conditional Branch: Variable [0011: Order] == 2
      ◆Text: I'll have the pie.
    ◆Else
      ◆Text: Just a tea, thanks.
◆Else
  ◆Conditional Branch: Variable [0012: Carrying] == Variable [0011: Order]
    ◆Text: Thank you!
    ◆Change Gold: + 100
    ◆Control Variables: [0012: Carrying] = 0
    ◆Control Timer: Stop
    ◆Control Switches: [0001: Waiting] = OFF
    ◆Control Variables: [0011: Order] = 0
  ◆Else
    ◆Text: That's not what I asked for.

The first branch is the whole trick. Order sitting at 0 means they haven’t ordered yet, so talking to them rolls the order and starts the clock. Any time after that, Order is 1, 2 or 3, so the same event falls into the Else and checks what you’re holding instead. In that second Conditional Branch, when you pick Variable, the box on the right has a Variable option too, that’s how you compare the two against each other rather than against a number.

For the timer running out, that needs its own event set to Parallel, since the customer event only runs when you talk to them.

◆Conditional Branch: Switch [0001: Waiting] is ON
  ◆Conditional Branch: Timer 0 min 0 sec or less
    ◆Text: Forget it, I'm leaving.
    ◆Control Switches: [0001: Waiting] = OFF
    ◆Control Variables: [0011: Order] = 0

The switch check on the outside matters. A stopped timer reads as 0, so without it that branch would fire the moment the map loads.

One thing to know before you build too much around it, MV only has the one timer for the whole game, so it can’t give each customer their own separate countdown. For one customer at a time it’s fine. If you end up wanting several waiting at once, that’s a variable counting down in a parallel event instead, and I can write that version out too.

Oh! Thank you so much! I’ll try and test it out when I get home and you know how it goes!

Sorry, I’m having trouble understanding the examples. I tried to follow the guy in the example video’s system. So I’m not sure how to make his system and your examples work together. Here’s what I’ve been trying so far. :')

No worries, the two setups are doing the same job in different ways, so I think it’s easier to pick one than to merge them.

With a switch per item, every table needs its own page for every item you might walk up carrying, and there’s nowhere to store what the customer actually ordered. What I’d probably do instead is trade the Has Coffee / Has Cake / Has Pizza switches for a single variable. Each table drops back to one page and random orders become possible.

Pick a free variable, say 0011 Carrying. 0 is empty hands, then 1 = Coffee, 2 = Sandwich, 3 = Burger, 4 = Salad, 5 = Cake, 6 = Eggs, 7 = Pizza. Keep that list written down somewhere, you’ll be checking it constantly.

Your Cake event turns into this:

Conditional Branch : Variable 0011 Carrying == 0
   Text : You picked up a slice of Cake!
   Control Variables : 0011 Carrying = 5
   Change Actor Images : (carrying cake)
 : Else
   Text : Your hands are full already!
 : End

Every other food event is that same block with a different number, so you can copy the event and change the two spots.

Then give each table its own order variable, say 0012 Table 2 Order. When the customer sits down, Control Variables → 0012 → Random 1 to 7 picks their dish. The table page becomes:

Conditional Branch : Variable 0011 Carrying == Variable 0012 Table 2 Order
   Play SE
   Control Variables : 0011 Carrying = 0
   Change Gold : + whatever the dish pays
   Control Self Switch : A = ON
   Change Actor Images : (empty hands)
 : Else
   Text : That's not what I ordered!
 : End

In the Conditional Branch window that’s the Variable tab, and the second box has a radio to switch it from Constant over to Variable, which is what lets you compare the two.

Your page 2 with Self Switch A and the “you’ve already served them” message carries over as is, no change needed there.

For the customer telling you what they want, branch on 0012 in their talk event, one branch per number, and show the matching text. It all hangs off that same numbering once it’s set.

How do I set the Coffee and other foods to the Carrying Variable? I want to try it your way, and I’m sorry if these questions are really dumb. I’m just very horrible at this.

No worries at all.

That Control Variables line is doing exactly what you want. A variable is just a number sitting in a box though, it doesn’t make anything happen by itself. Setting Carrying Food? to 1 is you writing down “grilled cheese” somewhere the table events can read it later. The part that makes Maria actually look like she’s holding it is the Change Actor Images line right under it.

So every food event is that same block with a different number. Something like 1 = Grilled Cheese, 2 = Coffee, 3 = Burger, 4 = Salad, and so on. Whichever numbers you pick, write the list down somewhere, you’ll be checking it constantly.

One thing on the Else branch. It runs any time Carrying Food? isn’t 0, so it fires when your hands are full with anything at all, not just the grilled cheese. As it’s written now I think it would tell you to take the grilled cheese to the customer while you’re actually holding a salad. That one probably wants to be a plain “your hands are full already” message instead. Switch 0131 Carrying Food can come out too, the variable is tracking that for you now.

I’m so sorry… I’ve tried following all your instructions to the best of my ability but I genuinely don’t understand. I really want to make this mini-game, but I have no idea how to proceed. It’s completely broken. I’m sorry if I’m asking for too much, but if I send you my project, would you be able to figure this out for me? Do you have discord? I really don’t know how to do this on my own anymore.

I’m really embarrassed to say, but I struggle with a learning disability and understanding instructions can be very hard for me. I’m so angry at myself for not being able to figure this out… I was really excited to make this minigame work.

Your event is actually really close. From your screenshots I think there are three things going on, and they’re all small edits rather than starting over.

  1. The Random 0..2 line. Because 0 is in that range, some of the time she rolls a 0 and orders nothing, so talking to her does nothing. Double click that Control Variables line and change it to Random 1..2.
  2. Where the “Carrying Food? = Customer Order” check lives. Right now it’s inside the part that rolls the order, so she orders and expects you to already be holding it on the same visit, which is what your comment describes. Ordering and delivering need to be two separate visits. Double click the “If : Customer Order = 0” line, tick “Create Else Branch” and hit OK. A new Else appears at the bottom of the event, and the delivery check goes in there.
  3. The freeze. I think it’s the Move Down in the table’s move route. The table can’t actually move down (something’s in the way) and with Wait checked the game sits there waiting for a move that never finishes. The Image change works fine on its own, so open that move route and delete the Move Down line.

With those done, the whole event looks like this, using your names:

◆If : Customer Order = 0
  ◆Control Variables : #0013 Customer Order = Random 1..2
  ◆Control Switches : #0132 Waiting = ON
  ◆If : Customer Order = 1
    ◆Text : I'll have some Grilled Cheese please!
  ◆Else
    ◆Text : I'll have some Coffee please!
  ◆End
◆Else
  ◆If : Carrying Food? = Customer Order
    ◆Set Movement Route : Table 1 (Wait)
    :                   : ◇Image : Puddles(5)
    ◆Change Actor Images : Maria (empty hands)
    ◆Text : Thank you!
    ◆Change Gold : + 100
    ◆Control Switches : #0132 Waiting = OFF
    ◆Control Variables : Carrying Food? = 0
    ◆Control Variables : #0013 Customer Order = 0
  ◆Else
    ◆Text : That's not what I ordered!
  ◆End
◆End

The two Control Variables at the end are what let her order again next time, since Order goes back to 0 and your hands are empty. Adding a third food later is one more Else with a Text in the top half, the delivery half doesn’t change. If you want the plate on the table to match the dish, the delivery half needs its own “If Customer Order = 1 / Else” around just the Set Movement Route, but I’d get it working with one plate image first.

Oh! I didn’t realize I had it set to 0, and the table to “move down”! I thought I had it set to “turn down”!

Thanks for being so patient with me. I wasn’t sure if you’d be okay with me sending the project over after I sent my last message so I asked my friend who helps me with my game sometimes. I would’ve asked them originally, but I always get worried about asking friends for help out of fear of being annoying. Seeing an image of how the event is set up helps a lot, and I’ll see if I can tinker around with it a bit! If my friend and I can’t figure it out though, I’ll DM you! Thanks a lot! :smiley:

@Baz to the rescue again! Thanks to you, and @StressedAsHell for asking this question, thank you funhavers!