Fon With RenPy
So tonight I have been working on more of my game, trying to work out how to make a waiting mini game. As in: a mini game where you wait on café patrons.
Not just a waiting mini game.
I mean, that’s not a mini game at all. that’s just a renpy.pause() statement.
And that’s no fun at all.
Anyways… So I am trying to write a system where you will get an order from a customer, which will be completely randomized. Make sure you have your pen and pencil, dear player, as there will be a test at the end of this. Once the player has the order (or more likely, there will be four orders at a time) they will have to remember what each table ordered, as there will be multiple random “wrong orders” in there too.
This is to stop jerks from just jumping on gamefaqs, or what ever jerk-equivalent they are using, and just find out what the static orders are so they can get the best score (and tips) which will be used towards certain story pathways later on in the game. (1)
I mean, hey, you can’t take Alma out to that nice restaurant if you are as broke as a hobo, can you.
So tonight’s job has been working with lists. I am pretty new to Python (though I have done plenty of programming before)
I create two lists:
$ drinks_menu = ['Flat White' , 'Latte' , 'Cappuccino' , 'Espresso' , 'Long Black' , 'Breakfast Tea' , 'Earl Grey' , 'Darjeeling' , 'Orange Peoke' , 'Green Tea' , 'Chamomile' , 'Chai Latte' , 'Hot Chocolate' , 'Iced Coffee' , 'Hot Mocha' , 'Iced Mocha' , 'Lemonade' , 'Cola' , 'Bitters' , 'Ginger Beer' ]
$ food_menu = ['Carrot Cake' , 'Chocolate Mousse' , 'Apple Pie' , 'Chocolate Muffin' , 'Apple Strudel' , 'Pecan Pie' , 'Blueberry Muffin' , 'Danish' , 'Garden Salad' , 'Pesto Chicken' , 'Caesar Salad' , 'BLT on Sourdough' , 'Smoked Salmon and Dill Bagel' , 'Chicken and Salad Baguette' , 'Margarita Pizza' , 'Crunchy fries' , 'Fish Burger' , 'Club Sandwich']
I know, I know, riveting stuff here.
Then I write up a few simple little randomizer, and the customer asks for 1-3 items from the drinks menu, and 0-3 items from the food menu. And the game outputs, for example “I will have 2 coffee and 3 burger.”
Shit! That’s not how your work with plurals. Who orders two coffee? It’s coffees, you silly… oh, that’s right, you have no idea what coffee is, do you computer?
Or even the concept of plurals.
Well shit, looks like I have some work to do.
Next I have to do some quick if statements to determine if a plural is necessary.
if drink_qty > 1: $ drink_plural = "s"
Bam, check that shit out. Done.
Now to test it and…
2 Coffees… yep. 3 Lattes, yep. 1 Darjeeling. Yep!
3 Bitterss.
Bitterss.
Goddamn it, Sombra got into my god-damned game.
So yeah, I forgot to account for words where they already end with the letter s. That won’t be too hard to accommodate for, right?
…
Right!
Okay, so wading balls deep into how python works with strings (big thanks to TomPy for linking the Python string documentation for me!) and I think I have an elegant solution for this.
$ drink_item_last_letter = drink_item_string[len(drink_item_string)-1] $ drink_plural = "" if drink_qty > 1: $ drink_plural = "s" if drink_item_last_letter != "s":
Did I say elegant? I meant that other thing.
And I haven’t even gotten to the game part yet. This is all just so that a randomized order is displayed in a human readable format on screen.
Ladies and gentlemen… this is the glamour of games programming.
Moose.
(1) Note: I am a jerk too, as this is what I would do. Hashtag jerkface.















