Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Sub] Cooking
RzrBladeMontage
post Jul 1 2010, 04:10 PM
Post #1


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




Here is another tutorial that I whipped up. It took me about 2 hours to put together and test to make sure it worked. It's a pretty simple system that tells you how many raw fish you have, allows you to level up your cooking, from Newbie, to Adept and finally to Chef. You can also feed a cat your burnt fish to clear out your inventory. So let's get started!

Difficulty: Normal
Engine: RPG Maker XP



Step One

Make 3 items. Name them the following:
Raw Fish
Cooked Fish
Burnt Fish

You can choose whatever you want for the Icons, however I do have 3 re-colored icons in my game that you're free to use. Blue is raw, brown is cooked and black is burnt.

Make 7 variables. Name them the following:

Raw Fish
Burnt Fish
Newbie Cook
Adept Cook
Chef Cook
LevelUpToADEPT
LevelUpToCHEF

Make 2 switches. Name them the following:

LevelUpADEPT
LevelUpCHEF

These will be the basics for our cooking system. All these variables and switches are vital so make sure to pay attention! Create an event for your player to be able to "cook" on. Example: A fire or stove. Also add a way for your player to obtain Raw Fish, whether an NPC gives it to them or if you have a fishing event or script installed (HatredLust has a fishing event! Check the submissions list!) For this example I'm using a fire and a NPC is just giving the player Raw Fish. When the player recieves the Raw Fish (I have it set to 5) make the Raw Fish Variable increase by 5. Now when the player presses the "Action Button" on the fire, have a text box pop up that says "You currently have \v[1] Raw Fish Would you like to try and cook them?.

I bet there's at least 1 person looking what I just said and being confused. \v[#] brings that variable amount into the text box. So if the player has 5 raw fish, and you correctly added 5 to the Raw Fish variable, then the message should saw "You currently have 5 Raw Fish. Would you like to try and cook them?" Onto step two!


Step Two
Now Show Choices and have Yes and No. Put nothing under the No option, and under the Yes option put a conditional branch, checking if the Raw Fish variable is greater than or equal to 1. Now ask the player if they want to cook a single fish or all the fish in their inventory. If single is selected, add a conditional branch that once again checks if the Raw Fish variable is equal to or greater than 1. Under that put Controls Variables NewbieCook = Random number between 1 and 10. Then add another conditional branch below that that checks if NewbieCook is greater than or equal to 7. If so the player cooks a fish. Remember to take away 1 raw fish, add 1 cooked fish, minus 1 away from the Raw Fish variable and add 1 to the LevelUpToADEPT variable. When the player successfully cooks 10 fish they will level up to an Adept cook, allowing them to burn less! Add another conditional branch that checks to see if the LevelUpToADEPT variable is equal to 10. NOT GREATER THAN OR EQUAL. ONLY EQUAL TO! If it is equal to 10, turn on the LevelUpADEPT switch and display a message to the player: "You are now an Adept Cook!" and add a nice little "Level Up" sound if you like. However, if the NewbieCook variable is less than 7, the player burns a fish. Remove a raw fish, add a burnt fish and minus one from the Raw Fish variable and add one to the Burnt Fish variable. Onto Step 3!


Step Three
Now if the player wants to cook ALL their fish, all we really need to do is add another conditional branch and a loop. Under When[All] add a loop and within that loop add a conditional branch that checks if your raw fish is equal to 0. If so display a message "You have cooked all your fish!" break the loop, and Exit Event Processing. Under "Else" put another conditional branch that checks the Raw Fish variable to see if it's greater than or equal to 1. If it is do the same thing as above with the NewbieCook variable and all of the success and failure results. Within this same event, add 2 more pages with all the same conditional branches and stuff (just copy and paste the pages) However, make page 2 activate if the LevelUpADEPT switch is on. On page 2 make sure to switch all of the variables and switches that need to be switched to "LevelUpToCHEF" and "LevelUpCHEF." However, in order to level up to a Chef you need to cook 15 fish, so make sure to change that as well. On the third page, make it activate by the LevelUpCHEF switch. In this page you can delete all of leveling up stuff unless you're going to add more and more levels within your game. A newbie cook variable has to get 7 or higher to cook the fish, an adept cook variable has to get 5 or higher and a chef cook variable has to get 2 or higher. Onto the last, and easiest step!


Step Four
Now you have some burnt fish in your inventory, but what now? Add some type of event to get rid of it all. I put a cat in my demo who loves burnt fish. It's pretty basic what you do. Make the event display a message to the player "You currently have \v[#] Burnt Fish."

(# being the number your Burnt Fish variable is)

Then display another message "Give all your burnt fish to the cat?" and add "Show Choices" Yes and No. If no, do nothing, if Yes add a conditional branch that checks if your Burnt Fish variable is equal to 0. If it is, display a message that says "You don't have any Burnt Fish!" Under Else put another conditional branch that checks to see if the Burnt Fish variable is greater than or equal to 1. If it is, remove "Burnt Fish" from your inventory, and for the amount use "Variable: Burnt Fish." Now subtract the Burnt fish variable from itself to assure that it's 0. That's it! You've set up a simple cooking system. If you don't even want burnt fish to be added to the inventory, you don't have to worry about making an item, variable or a way of disposing it. You can also use this event with many others, such as my gardening event, and HatredLusts fishing event.


__________________________





Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 09:20 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker