Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[TUT/DEMO]Advanced Cooking System

-------------------------------------------------------------------------
-----------Pete's Advanced Cooking System-----------
-------------------------------------------------------------------------

Introduction
You might be asking "What's so advanced with this cooking system?". Well, it's just not your regular cooking skill system. What really makes it special is the fact that the cooking chance is calculated and the player can improve the skill.

Before reading the rest of the tutorial
I am not a good teacher, but I'll try to make it as easy as possible for you to understand how the system works and how to create it in your game. If you encounter any dificulties understanding the tutorial or the system, please do post.

Features
I made this system based of World of Warcraft's cooking skill, so you may notice several similarities, don't post about it please.

Real cooking skill, you can improve your cooking skill by successfuly cooking food.
Realistic cooking, the chance of cooking is calculated through the dificulty of the food and the current skill level.
Training and recipes, the player will need to ask an NPC to teach him how to cook (increasing the cooking level cap) and to teach him cooking recipes.

Bad Stuff
Involves some time creating it and can be very boring, maybe it's just easier to make a script and copy paste it. Well whatever...Just leave if you are not willing to waste some time on this.

--------------------------------------------

Essencial stuff
Now that you know what this system provides, as a game maker you will need to know what variables, switches and items you will need to create before starting with the events.

You should decide how many foods (fishes, meats, etc...) your game will have. Now that you made a list, you are going to create 1 switch for each food and name them accordingly (If there will be cookable trouts, you will need a switch named Trout or CookTrout, whatever you want to name it).

Done? Good. Now for each food create 2 items, the raw food and the cooked food. Make sure the raw food heals waaay less than the cooked food and is worth less. Example: A trout will need to have an item named Raw Trout and an item named Trout.

Done already? You're fast. Now lets move to the variables. Create the following variables:
0001: CookingQuantity
0002: CookSkill
0003: CookSkill2
0004: CookSkillXP
0005: CookskillXP2
0006: RandomCheck
0007: CookSkillLimit
And then create the rest of the variables that will be the dificulty levels of cooking. For example, a trout will be at level 1 dificulty to be cooked which means it's easy to cook it. You can have as much dificulty levels as you want, just don't exagerate.
0008: Dificulty1
(...)
0009: DificultyXP

Having the Switches and the Variables set, let's start eventing.

Eventing
You will need 4 common events for this system. More if you want to have things organized (A common event for cooking fish, a common event for cooking meat, etc...).
001: CookStart
-Optional-
002: CookFish
003: CookMeat
004: CookVegetables
-Optional- (You can replace these by only 1 if you want, but I highly recommend you to have things this way)
005: CookSkill
006: CookBook (yeah book, you will see why...)

Now let's start, base your first common event, CookStart on this one:
http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/CookStart.jpg[/IMG]

Easy wasn't it? Now let's burn your brain cells.
But before, you need to know that the cooking will work based on dificulty. For example, dificulty 1 will be very easy to cook and will give the lowest amount of XP.

--------------------------------------------

Make the cooking common event, CookFish in this demo, based on this one:
Notes: The cooking action will be performed as a loop until there is no more of that particular food to cook. It's easy to add a way for the player to choose how much he wants to cook, but I decided not to do that in this demo. You must decide a dificulty level for each food, so when cooking it will use the right variable and give the player the correct amount of experience points.
http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/CookFish.jpg[/IMG]http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/CookFish2.gif[/IMG]

Done? Now you just have to copy the first whole branch and paste it throughout the 3 common events, but changing the values at the same time, ofcourse.
...
...
...
Finally, you completed it. Cheer up, you have just completed the most sucky part! But, you still don't understand how it is done?
Well, Dificulty1 has the value of 10000, multiplied by the cooking skill (level 1) equals 10000. Then it is divided by 100 which equals 100. Then we get a random value from 1 to 100. If the division is bigger or equal to the random value we have a success, so it means we have a 100% success chance. If dificulty was 5000, divided by 100 equals 50 and we have a 50% chance of success, got it? GOOD!

--------------------------------------------

Now lets do the CookSkill common event.
Create a common event based on this one:
Notes: Here you will have to change the values in order to customize the dificulty of the Skill for your game. CookSkill is the Level, CookSkillXP is the current experience points and CookSkillXP2 is the current Skill's experience points cap, which means that when the CookSkillXP reaches the same value of CookSkillXP2, CookSkill is increased by 1.
http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/CookSkill.jpg[/IMG]

Done? Now lets do the CookBook common event.

--------------------------------------------

Create a common event based on this one:
Notes: It's just a common event that will give the player some information about his cooking skill: known recipes, level and experience points. You can call this common event through a key or through an event placed on a map (a book on a table for example)

http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/CookBook.jpg[/IMG]

Done. Let's move to the map events.

--------------------------------------------

Here is a screenshot of a kitchen, very simple but still a kitchen with a sailor in it for some reason.
http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/kitchen.jpg[/IMG]

The sailor is the trainer and you will create this event based on the following:
Notes: This event has 2 pages. Make sure you check the triggering options. In this event you will set up the dificulty level variables. Here is how you will do it: dificulty level 1 value must be equal to 10000, level 2 equal to a value under 10000, since 10000 is the 100% success rate. Every value above will also be 100%.

Page 1:
!!There is an error. The Dificulty2 value is 20000, not 1000. Sorry about that!
http://i240.photobucket.com/albums/ff20 ... rPage1.jpg[/IMG]

Page 2:
http://i240.photobucket.com/albums/ff203/Peted2s/rmxp/CookTrainerPage2.jpg[/IMG]

Now the CookStart common event will be called in that cooking table.
The book has an event to call the CookBook common event.

--------------------------------------------

And that concludes it! (told you I am a bad teacher)

Further Reading
I appreciate your replies and comments, good or bad , so please, start writing! :p
If you find any flaws with the system, broken links/images or any other problem with this tutorial, posts.
I certainly won't explain you how to event, other people can help you with that, just not me.
This has been tested and it works, if it doesn't work for some reason, post a detailed description of the problem and I'll tell you what you have done wrong.
Don't post something stupid in this thread, please.

Get the demo *here*!

Credits:
Created entirely by me (based on World of Warcraft) and a crucial part by MarineMechx2 (thank you very much).

Thanks to:
The people who cared to help me at the General Support, thanks.

What MAY come from me in the future:
Advanced Gathering Skill


-Pete

Updates:
-Fixed the dificulty variable values. (forgot to change them before posting, go check them again..)
-Fixed the values again (if you were wondering why something was not right, try reading the dificulty values explanation again)
 
Yeah guess not...There is already a fishing skill (scripted), but I don't know how much editable it is. If it's versatile enough, other people can turn it into other gathering skill.
 
Could you fix the pics so that we dont have to click on them... I'm lazy.

Also, I'm wondering how to turn this into synthesising.
 
Great tutorial for an good idea, but as stated above, the pictures needing to be actually clicked kind of diminishes the fun of learning.
Ah...How lazy we are...
 
hmm, although i am not interested in the cooking part, i wonder if this can be fully transformed into an alchemy skill with the same rules and concept (brewing potions, for example).
 
Uhm I don't wanna complain or anything but, can you make a Demo of this cooking thingy? cause when i do it, it never work :( me and variables= Down the toilet.. Thank you

~TwistedDragon

Edit: sorry my brother is kinda stupid, sorry for posting, nice thingy btw,

Love
~TraniXz the Beating Boxer ;)
 
There's a demo in the end of the post. Look better ;)

edit:

CarminesCreations;299064 said:
hmm, although i am not interested in the cooking part, i wonder if this can be fully transformed into an alchemy skill with the same rules and concept (brewing potions, for example).

"Cooking System" is just a name, Cooking skill is just a name. That is what makes evented system so good, the unexperienced game maker can simply change the names to his/her likes.:D
But the alchemy skill requires more event lines, since a potion needs more than 1 ingredient to be made. The essencial, thought, is there. When I have some time (exams break) I may create a tutorial to turn this system into an alchemy skill system. In the meanwhile, try to do it yourself ;)
 
WoW! This is the coolest tutorial that I even seen before! Its cool! I have an idea... waht about Mixtures? You make the Braked Food by using this Cookinjg System, and Braked Foods can be mixed into one food: for example Meal Soup (Hot Water + meal?), Pizza (Paste + Meal or Mushroom) etc.
 

Ravyne

Member

This will definately help my crafting scripts out... I'm a newbie to RPGM and I've never done any real scripting before so I really needed some kind of starter's kit... But... one question- where are the pics? I think I need them to know where the variables are or whatever... but I get the ugly red x even when I R-Click and choose "Show Picture".
 
First off, I love you! (not really) This will be a nice addition to my game. Second, I really want to see this but I can't see the pics.
 

Darok

Member

Ehh I now this post is dea 2 years ago but...ehhh...if i have 10 dificultys y need to start with 1.000.000.000??
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top