The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: ShadowLink on January 18, 2006, 07:04:01 PM

Title: Cooking Script?
Post by: ShadowLink on January 18, 2006, 07:04:01 PM
I was wondering, how about a cooking script?

It's just like using potions but you have the option to cook after battle and/or cook once outside of battle.

If anyone has played Tales of Symphonia then you'd understand what I'm trying to get at.  :?

Thanks in advance  :^^:
Title: Cooking Script?
Post by: ahref on January 18, 2006, 08:10:17 PM
hmmm....id like this to...

you killed a ghost
a ghost dropped a healing leave and an empty vial

at a cooking pot:
you boil the leaf in water and boil the liquid into a vial.

you made 1 potion

or maybe even food

you baked the dough into bread

ill keep checkiing back :)
-------------------------------------------------------------------------------------
I DID NOT MAKE THIS SCRIPT
Here is a script that I recently wrote that allows for all those blacksmithing and cooking type trades. I hope you like. Let me know if you have any problems with it.



I will try to give a good explanation on how to use this script.

First of in order to craft an item, you need to create a recipe. A recipe has 5 things.
1. INGREDIENTS (part 1)
An array of items used to make the desired object. These arrays simply consist of the indexes of the object taken form the database. For example, in the picture below the index of a tablet is 30. The indexes of a card and fruit would be 31 and 32, respectively. If we wanted to make a recipe that used all three objects, our ingredients array would look like the following:
[30,31,32]


NOTE: Even if you only need 1 ingredient you should encapsulate it as an array. For example, the proper syntax would be [15], not 15.


2. INGREDIENTS (part 2)
You may not want all your recipes to be made only items. Maybe you want a recipe that uses a regular sword combined with dragon breath to make a fire sword. In order to make this possible you have to specify in your recipe what type of ingredients you are using. Ingredients can be items, armors, or weapons. I use the following convention (consistent with the default programming)
-items are type 0
-armors are type 1
-weapons are type 2

So, in my example, all the "ingredients" are items, so my type array would be [0,0,0].
NOTE: The type list should always be the same size as the ingredients list.

3. INGREDIENTS (part 3)
Well now that we know what type the ingredients are and what there index is, what else could we possibly need to know? You guessed it, we need to know how many of each ingredient the recipe requires. Suppose we just wanted 1 of each type of ingredient, our array would look like this: (This array should be the same size as the other two.)
[1,1,1]

4. THE RESULT (part 1)
Just like with the ingredients you need to tell the recipe what the index is of the object you want to create. The only difference is that now it doesn
Title: Cooking Script?
Post by: ShadowLink on January 19, 2006, 11:29:18 PM
whey! you rawk man! I haven't tried it out yet, but when I do, I'll let you know if I come across any errors or problems.
Title: Cooking Script?
Post by: ahref on January 21, 2006, 05:00:24 PM
i restate i did not write this script
Title: Cooking Script?
Post by: Jesse 015 on January 28, 2006, 06:07:33 AM
umm why not just use events, like a conditional branch
Title: Cooking Script?
Post by: ahref on January 28, 2006, 01:03:07 PM
meh this is easier
Title: Cooking Script?
Post by: ShadowLink on January 28, 2006, 02:05:15 PM
Quote from: Jesse 015umm why not just use events, like a conditional branch

yeah, the script is easier. Plus you don't have to work with those crazy switches lol
Title: Cooking Script?
Post by: helipluis on January 28, 2006, 02:27:56 PM
Yeah your right, the script is better then using CB's..
Anyway, I don't care, I don't mind using CB's either =P
Title: Re: Cooking Script?
Post by: GhstHawk on July 31, 2007, 08:08:43 PM
hello
did this script disappear? can someone send it to me or repost it please?
Title: Re: Cooking Script?
Post by: Xuroth on August 02, 2007, 07:19:00 PM
personally, i disagree about  using scripts over event commands. I have been in the RPG Maker scene since RM2K came out, and I though it rocked. 2K3 was even better, and I spent almost a year practicing with events (practicing = making cool stuff, but never posting or publishing anything) I learned a lot from Dragon Destiny and I even made an entire HUGE CMS using only events. in that case, scripting would have been easier, but due to my experience with events, to do simple things like cooking/profession systems, it is so easy to just use a couple variables, switches, and conditional branches in a Common Event to always monitor the characters progress.

I might concede though, that due to the efficiency of the game engine (or lack thereof) scripts are less demanding in general, and produce less lag, then having 6 GIANT events that control literally hundreds of things...

Power to the Events!
Title: Re: Cooking Script?
Post by: Restaurant Sackboy on August 03, 2007, 07:53:30 AM
Script, NAO!
Title: Re: Cooking Script?
Post by: Malson on August 03, 2007, 08:56:17 AM
Quote from: Xuroth on August 02, 2007, 07:19:00 PM
personally, i disagree about  using scripts over event commands. I have been in the RPG Maker scene since RM2K came out, and I though it rocked. 2K3 was even better, and I spent almost a year practicing with events (practicing = making cool stuff, but never posting or publishing anything) I learned a lot from Dragon Destiny and I even made an entire HUGE CMS using only events. in that case, scripting would have been easier, but due to my experience with events, to do simple things like cooking/profession systems, it is so easy to just use a couple variables, switches, and conditional branches in a Common Event to always monitor the characters progress.

I might concede though, that due to the efficiency of the game engine (or lack thereof) scripts are less demanding in general, and produce less lag, then having 6 GIANT events that control literally hundreds of things...

Power to the Events!

This thread has nothing to do with whether or not you like events, so quit preaching.

ahref basically covered it clearly, but it'd be nice to see a coded version of it :o

I wish I could add a cooking script to women ;9
Title: Re: Cooking Script?
Post by: Restaurant Sackboy on August 04, 2007, 02:51:12 PM
Where do I put the recipes?
Title: Re: Cooking Script?
Post by: Kokowam on August 04, 2007, 03:30:03 PM
Quote from: Zypher on August 03, 2007, 08:56:17 AM
Quote from: Xuroth on August 02, 2007, 07:19:00 PM
personally, i disagree about  using scripts over event commands. I have been in the RPG Maker scene since RM2K came out, and I though it rocked. 2K3 was even better, and I spent almost a year practicing with events (practicing = making cool stuff, but never posting or publishing anything) I learned a lot from Dragon Destiny and I even made an entire HUGE CMS using only events. in that case, scripting would have been easier, but due to my experience with events, to do simple things like cooking/profession systems, it is so easy to just use a couple variables, switches, and conditional branches in a Common Event to always monitor the characters progress.

I might concede though, that due to the efficiency of the game engine (or lack thereof) scripts are less demanding in general, and produce less lag, then having 6 GIANT events that control literally hundreds of things...

Power to the Events!

This thread has nothing to do with whether or not you like events, so quit preaching.

ahref basically covered it clearly, but it'd be nice to see a coded version of it :o

I wish I could add a cooking script to women ;9
Lol and you posted in the RM forums. :o Also, if you're using scripts, I recommend you read the instructions if it's there. :P
Title: Re: Cooking Script?
Post by: GhstHawk on August 05, 2007, 03:07:29 AM
so umm... regardless whether or not you like the script, can someone send it to me? cuz its cut off and theres no script here.
Title: Re: Cooking Script?
Post by: Restaurant Sackboy on August 05, 2007, 05:28:01 PM
Where do I put recipes? ANSWER, NAO!