Crafting Script v3.8 - Updated 2/26/2015

Thanks 🙂 As for the bug, it's just bad planning on my part. I added a add on script that gives actor specific recipes they can learn through notetags. So the default actor has all those recipes taught to him automatically through his note tags. The Book, CrossedSwords, and Hexagram are all part of the RTP, I just moved them to the picture's folder cause that's where folks usually put their custom graphics 🙂 they can be found in the Title folders of the RTP so feel free to use them 🙂

For all the sound file fixes, I'll get right on that. I try to play test everything, and I always miss things. As most folks who know me.. they know I rarely ever turn my sounds on, so thank you for point these things out to me and I'll try to get them fixed up today and the patch out 🙂

edit: Ok lots of stuff coming up today so I didn't get that much time to work on the script. I'm doing some other updates that are needed as well and will probably release some other add on scripts that I've been working on for various folks at the same time. Will try to test everything better before releasing them. So it might be tomorrow or the next day for the fixes.  The other add ons will allow NPC craft shops where you can decompile items for some crafting components and they can also craft items for you at an added cost of resources and fees. Another add on will be for buying and learning recipes off a NPC (working on compatibility issues on this one)
Thanks.

I removed the 'bug' from my previous post. Sorry I didn't notice that the actors in your demo have those notetags. But it still looks weird in the demo (learning recipe 1 when you already know recipe 1).
I'm trying to get through Harvest Moon (which has gotten to the point of boredom but my OCD says I must finish it before trying something else).
Finish...Harvest Moon? 😳

That game has no defined ending, only have the family and max stuff out.

The other add ons will allow NPC craft shops where you can decompile items for some crafting components and they can also craft items for you at an added cost of resources and fees. Another add on will be for buying and learning recipes off a NPC (working on compatibility issues on this one)
Could you make it so that you can learn the recipe for something by decompiling the item?

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

I'm a bit confused with this script. I am VERY new to scripting(I've only installed one before, and haven't made any) Anyway, the problem is that I want it done in a particular way and I don't know if this can be customized to do it.

Basically I want it so you take the Mechanic to the Work Shop and leave him there with a crafting assignment and retrieve the item the next time you return to that map. You will then have the choice of having the Mechanic rejoin the party or work on another assignment. Same for the Alchemist and the Laboratory.

Basically Mechanic is just the Smith but with more modern technology so that would be a rename rather than different crafting type.

Anyway, I'd tie the recipes in with items that are actually added to the Key Items in your inventory rather than learning from NPCs or leveling. "Alchemy Recipes" and "Mechanic's Blueprints".

Acquired recipes would have a minimum level requirement to use and leveling would affect success rates and ability to make stacks of an item at once(the minimal level would only allow the crafting of one to a time, but with each level you can add more to the stack.)

Is that possible with this? Or if not, would it be something you could(and would be willing) to add?
Your request sounds possible 🙂 It might take a while to get done since I need to finish working out some revisions and get it up, then I can work on your requests.

There's a simplified version of the script that I haven't touched in a long time that's posted in the main thread (the last link on the page). It doesn't have a crafting gauge. I'd probably base your requests off of that one as it allows the crafting of stacks of items. I just didn't think the gauge worked with crafting stacks of items, but I could write it with the gauge one if you'd like.

I'll test out learning a recipe from decompiling an item. The thought hadn't occurred to me, but it might work already with the two add ons I'm working on

edit: on HV I was pregnant and just waiting to deliver the baby and waiting for the goddess tree to regrow (it was planted with the correct seed), Think I had all the upgrades and properties I wanted. I'm very OCD when gaming =P So I had fished most types of fish and cooked all recipes (except the ones that required fish I didn't have yet). To me.. half the fun is gathering info on the game and sorting it all out in an easy to access way (so usually means filling out a spreadsheet).
Im very very stuck with trying to add new recipes can i have some help? All i really need is 2 more recipes on cooking which is a: Cooked tuna and a cooked trout.

EIther making this for me or helping me out would make me to greatful!

Also how would i activate it? So like it shows in the menu etc.
You'll want to add something like this to the script below the other recipes.

I know it's wordy.. this is the instructions in the script

Spoiler
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Recipe Settings - #---------------------------------------------------------------------------- # Recipe[ID] => { The ID must be a unique number. # :recipe_type => x # x = the Craft_Info ID this recipe belongs to. # If it was 1 then it'd be a cooking recipe, 2 is blacksmith, etc # :auto_learn => false # This can be omited. This option only works if Auto_Learn = true # You'll set this option to false if you want this recipe to be # learned from a special source (like a NPC, quest, boss kill, etc). # :req_level => y # y = the crafting level needed to make the recipe # :craft_time => t # t = time in frames (60 frames = 1 second). This is the time when # the recipe can claim success. Before the time results in lost # ingredients and no item. After this time results in lost # ingredients and a failed attempt item is granted. # NOTE: You can omit this one to use the Default_Craft_Time above # :earned_exp => exp # exp = the amount of exp received on successful crafting of the item # :crafted_item => [:Type/Item_ID, Amount] # :failed_item => [:Type/Item_ID, Amount] # Item made if crafted too late # 😛re_failed => [:Type/Item_ID, Amount] # Item made if crafted too soon # :ingredients => [[:Type/ItemID, Amount], [:Type/ItemID, Amount], ... ] # Type = i for Items # a for Armor # w for Weapons # g for Gold # Item_ID = item's id in the database # Amount = the amount of items to reward # # NOTE: :ingredients can have multiple entries. The following entries can be # omitted - :failed_item, 😛re_failed, and :craft_time #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I know instructions sometimes aren't very clear. Which is why I put a few recipes in so everyone could see some recipes built different ways.

I made a cooked tuna recipe but you will still need to change some things to make it work for you. The recipe will need to know the item id's in your database for the Cooked Tuna and the id's for the items that are required to make it. I'd assume a Tuna and whatever else you'd like.. seasonings, lemon, etc 🙂

Spoiler
Recipes[10] = { # Cooked Tuna # The number here can be anything as long as it hasn't been # used already) :recipe_type => 1, # Cooking Recipe (Craft_Info[1] from above) :req_level => 1, # Level required to use this recipe # can be any level you want :craft_time => 240, # Time it takes to make the item (60 = 1 second) # 60 = 1 second. So 240 would be about 4 seconds # since there is a variance setting :earned_exp => 7, # How much cooking exp reward for sucess :crafted_item => [:i40, 1], # You'll have to change this to the item in the # database that you made the Cooked Tuna. # I set it to database item 40 right now. The # next number is how many are given. I assume # you'll only want 1 Cooked Tuna made. :failed_item => [:i29, 1], # 1x Piece of Charcoal if failed attempt # Charcoal is item 29 in the demo's database :ingredients => [# 1x Tuna, 1x Lemon [:i41, 1], [:i42, 1],]} # <- DO NOT REMOVE
If it's still confusing, send me a PM and I'll try to get a some more instructions to help so you can add them when you'd like 🙂
Your request sounds possible 🙂 It might take a while to get done since I need to finish working out some revisions and get it up, then I can work on your requests.

There's a simplified version of the script that I haven't touched in a long time that's posted in the main thread (the last link on the page). It doesn't have a crafting gauge. I'd probably base your requests off of that one as it allows the crafting of stacks of items. I just didn't think the gauge worked with crafting stacks of items, but I could write it with the gauge one if you'd like.

I'll test out learning a recipe from decompiling an item. The thought hadn't occurred to me, but it might work already with the two add ons I'm working on

edit: on HV I was pregnant and just waiting to deliver the baby and waiting for the goddess tree to regrow (it was planted with the correct seed), Think I had all the upgrades and properties I wanted. I'm very OCD when gaming =P So I had fished most types of fish and cooked all recipes (except the ones that required fish I didn't have yet). To me.. half the fun is gathering info on the game and sorting it all out in an easy to access way (so usually means filling out a spreadsheet).
Thank you very much! ^_^

Like I said, I knew some of it could be done with the current system, but I had no idea if the rest could and I had misunderstood, or if it couldn't after all.
I'm not sure if this available already so I'm sorry if I'm asking an already answered question. But is it possible to call the "Recipe Reviewer" the thing that the "Menu access add-on" from a book. 

So instead of using the menu I could have the player read a book to show them what recipes they have unlocked already.
@ninjalex: If you use the Menu Access add on, change the customize section setting to this:

Menu_Access = false # If this is true, then you can always use in the menu Menu_Switch = 0 # Switch ID to toggle menu access if Menu_Access = false # You can set this to 0 if you don't want to use a switch Menu_Text = "Recipes" # Command's name in the Main MenuThen create a book item in the database with a common event. Inside the common event do a script call (it's the last option on the 3rd page in the event editor). Inside the script box put this line:

SceneManager.call(Scene_Recipes)

That should make a book that you have to look at to access the recipes.

Here's some screen shots of the book/event incase I'm not explaining well 🙂

Spoiler
book1.png

book2.png
If you want recipe books that will only show recipes for a given craft.. like a Cook Book, Alchemy Book, etc then I can write something. I shouldn't be too hard to do 🙂

Let me know
If you want recipe books that will only show recipes for a given craft.. like a Cook Book, Alchemy Book, etc then I can write something. I shouldn't be too hard to do 🙂

Let me know
If you wouldn't mind, that would be appreciated! In my case they would be the "Mechanic's Blueprints" and "Alchemy Recipes" I mentioned before!
@Cadh2000: I'll add it to the list and will probably send you a PM tomorrow to get some more specifics for your vision of the crafting stuff. It's getting a little late tonight

BTW, updated the main script post earlier today with the audio adjustments. Still working on ironing out the bugs for the new add-ons
Hi I am using version 2.6 of the script with the menu recipe list add on, I was just wondering if there is a way to make it so that the recipes in each craft are listed bye level and not the number of the recipe in the crafting script ??

So when the player looks at the recipe list they can see them by level and the ones that they are not currently able to use as their craft level isn't high enough is slightly greyed out, even if they have the ingredients.

As in my game the character learns the recipes from books or teachers but may not be a high enough level in that craft to use it yet.
that's a great idea. I'll see if I can make that happen =)
cool let me know how it goes 😀
ok think I have it sorted out 🙂

open up your script and search for class Game_Recipe to find this section:

#==============================================================================# ■ Game_Recipe#==============================================================================class Game_Recipe #---------------------------------------------------------------------------- # ♦ Public Instance Variables #---------------------------------------------------------------------------- attr_reader :recipe_type, :req_level, :ingredients attr_reader :craft_time, :earned_exp, :ingredient_amount attr_reader 😛re_failed, :auto_learn, :recipe_idyou'll want to change that last line on your side. Add in that :recipe_id to the end of it.

Next search for this section "Recipe_List_Window" and you'll need to replace 3 of the defs:

Spoiler
#---------------------------------------------------------------------------- # ● upgraded method: make_command_list #---------------------------------------------------------------------------- def make_command_list if @recipes @items = [] @recipes.each do |recipe_id| next unless $recipe[recipe_id].recipe_type == @craft_type item = $recipe[recipe_id] @items << item @items.sort!{|a, b| a.req_level <=> b.req_level} end @items.each do |item| add_command(item.crafted_item, item.recipe_id.to_s.to_sym, enabled?(item)) end end end #---------------------------------------------------------------------------- # ○ new method: enabled? #---------------------------------------------------------------------------- def enabled?(recipe) return false if recipe.req_level > $craft[@craft_type].level ingredients = recipe.ingredients required = recipe.ingredient_amount for i in 0...ingredients.size if ingredients.is_a?(Craft_Gold) owned = $game_party.gold else owned = $game_party.item_number(ingredients) end enabled = (owned < required ? false : true) end return enabled end #---------------------------------------------------------------------------- # ● upgraded method: draw_item #---------------------------------------------------------------------------- def draw_item(index) rect = item_rect_for_text(index) return unless @list[index] set_font🙂recipe_list, @list[index][:enabled]) item = @list[index][:name] if $imported[:MAIcon_Hue] draw_icon_with_hue(item.icon_index, item.icon_hue, rect.x + 1, rect.y, @list[index][:enabled]) else draw_icon(item.icon_index, rect.x + 1, rect.y, @list[index][:enabled]) end draw_text(rect.x + 26, rect.y, rect.width - 27, line_height, item.name) end

Or here's the 2.6 version of the script with the edits (you'll have to copy over your customize section at the top):

https://www.dropbox.com/s/ntkyvvazx8jhs3f/craft%20v2-6%20altered.txt

whichever way is easier for you. It should work with the update actor specific add on and the new shop add on as well 🙂
Sweet man work perfectly 😀 wish I could make my own scripts, I understand the logic behind it but the actual language and words used baffle me haha 
Thank you very much for the reply. I think I get it I will give it a try in a bit.
Hello all,

First, I'd like to say this is a great script- perfect for my Harvest Moon-type game I'm attempting to make.

I just have one problem, and I'm not sure if it's something on my end. When I test-play my game, I have my character learn a recipe by talking to an NPC. I use the script call learn_recipe(3), as it has the ID of 3. I also have the menu-access add-on, so when I go to the menu to look at my learned recipes, I correctly see recipe 3. So, then I save my game, quit, and then play the same save. Now, I do not see the recipe in the menu, even though I had my character learn it before.

Is there something I'm doing wrong?

Sorry if this is a stupid question, and thanks in advance for help! P.S. I am using the version from 03/09/2014. I just updated to the newest version, and am still experiencing the same problem. Demo works fine though, so it must be something I'm doing wrong or one of my other scripts is screwing it up.

EDIT: I found that this script is slightly incompatible with the Survival System v1.11, created by: Apellonyx. If anyone knows how to fix this problem, it would be greatly appreciated! (I have no scripting knowledge).

EDIT AGAIN... I fixed the problem by myself by moving the Hunger Script above the Crafting Script. For some reason, this makes everything work. Sorry for the long, unnecessary post!
sorry the forums wouldn't load for me for most of the morning. Glad you got it working, was wondering what was happening because I couldn't repeat the bug in my demo and now that I can see the edits.. I know why 🙂
This might be my first post here, but whatever.

I am very much a newbie at scripting, but i may understand the basics of your system.. Or at least how to add recipes.

I have two questions and one suggestion.

1. I have made a crafting recipe with makes you sharpen a piece of flint. It was quite simple really.

However I would like to get back an item from crafting something.

This would be extremely useful if you if you want to use a tool item, such as a saw but want to keep the saw once making a log into some planks.

2. Is it possible to have two ways of crafting? Such as certain recipes not needing to use certain tools or a crafting station.

Example: Sharpening a piece of flint should be able to be done without the need of a forge. While smelting ores into bars should still need one

edit:

3. Now that I think about it, having different sound effects (during the gauge thing) per recipes could be nice.

Such as boiling eggs would make some bubbling noise and chopping up leeks would have a chopping sound.

This is just a suggestion tough.

Original thread: https://forums.rpgmakerweb.com/threads/crafting-script-v3-8-updated-2-26-2015.17560/