Home > Tutorials > RPG Maker VX > Basic Cooking Events
Basic Cooking Events
Kita's Basic Cooking Events!
Now your characters can cook and eat it too!
One of the many things I noticed, and liked, in certain games was how they had a little cooking option in the game. This wasn't a minigame, but more, a choice in the menu/certain places where your character could cook something with a recipe, and certain items, creating a food that would restore HP/SP and in the long run, cost less.
As an example: Tales of the Abyss.
So, what I managed to so was create a simple, basic cooking system, using events, not scripts, because I CAN'T SCRIPT FOR BEANS. D:
HERE IS A DEMO: http://www.mediafire.com/?ddysjgfztdg
With instrutctions on what to do to cook!
I shall use a stew as an example in this tutorial!
What to prepare for the cooking event:
In the database, go to the items and create the following items:
-Recipe: Stew
-Recipe Book
-Iron Pot
-Spoon
-Potatoes
-Meat
-Carrot
-Spice
-Empty Pot
-Stew
Iron Pot, Spoon, Potatoes, Carrot, Spice, Meat, Empty Pot:
In their options, set it so that the target for the item is NONE and they are NOT consumable.
Recipe Book and Recipe: Stew :
In their options, set it so that the target is NONE, and that they are NOT consumable. Also, make a common event for each of them.
-Recipe Book Common Event to be set as follows:
[url="http://imageshack.us"] [/url]
This makes the recipe book a sort of instruction manual for when where and how.
-Recipe: Stew Common Event to be set as follows:
[url="http://imageshack.us"] [/url]
Stew:
And now for the Stew!
[url="http://imageshack.us"] [/url]
And, since recycling is awesome, make a common event for the Stew, call it Stew>Eat. In the event, all you need to so is put
@>Change Items:[Empty Pot], +1
This will add one Empty Pot for every Stew you eat.
Now we can move on to VARIABLES.
First, make an event for the first time you'll be making a stew in the game, such as a campfire.
Next, make the variables.
The variables isn't complicated, just long due to the fact that this bit will be repetitive, but it only has to be done once. Hurrah!
Make a new single variable for EACH cooking related item, and name it whatever the item is, so we don't mix them up. Next, leave the operation as Set and set the opperand to the respective item. If your variable is named CARROT, then set the opperand to CARROT in inventory.
Once all this is done, save your game/project. I personally have bad luck and windows accidentally close on me a lot.
Next, in your event under the variables, make a Conditional Branch for if you have a Recipe Book in your inventory. It should look like this (Without the AAA and BBB):
@>Conditional Branch: [Recipe Book] in Inventory
@> AAA
: Else
@> BBB
What this means is that, if the player has Recipe Book, AAA happens, or else, if not, BBB happens because you dont have the recipe book.
Where the BBB is, put in a text where your character will say something about the fire, like "Ah, the fire sure is nice and warm tonight!"
Then, where AAA is, put in text asking "Would you like to cook?"
After the question, insert Choices YES or NO.
In the NO option, leave it blank. In the YES OPTION, insert text "What would you like to make?", followed by a Conditional Branch: [Recipe: Stew] in Inventory.
Once again, in the BBB spot, inset the text "No recipes!" Because this will happen if the player doesn't have the recipe. In the AAA spot, insert Choices STEW or CANCEL. In the CANCEL option, leave it blank, and in the STEW option, insert a switch named STEW. This switch will only ever be used for stew.
Now, leave this event as is for now, we're going to make a new one elsewhere to make it more organized, I find that it gets rather cluttered when it's all together.
NEW EVENT:
Condition: Switch STEW is ON.
Autorun Event
The next part is confusing to explain, so I will just show what it looks like, then explain quickly:
[url="http://imageshack.us"] [/url]
Now, what this means is, example:
In conditional branch#1, if variable IRONPOT in inventory is greater than or equal to 1, the next conditional branch comes in, or else, if thats not the case, a text message will appear saying "Cant cook, missing a material!" and cancel it right away. If, the character has all the required items, you'll get two pots of stew, and you'll loose everything in the recipe for stew!
Also, once the stew is eaten, the pots are empty again and can be used. It's an easy to do thing, and if you want it to be done somewhere else, just copy and paste the events!
ON A SIDENOTE:
I had a problem with my scripts and variables, causing the game to crash once we got to the event with the variables, the error message would say there's an error in script Game_Interpretor in line 750 and here's how to fix it(just in case):
[url="http://imageshack.us"] [/url]
[url="http://imageshack.us"] [/url]
It's really as stupid as that, but everything works fine when it's fixed.
To conclude, you can add or change the event how you wish, this is more like, a template to Basic Cooking in the game.
I hope some of you find it interesting! I'll share whatever other ideas I may come up with in the future.
|
|
Details
|
|
Tutorial:
|
Basic Cooking Events |
|
Date Listed:
|
2008-06-08 |
|
Author:
|
Kita
|
|
Total Hits:
|
9206 |
|
|