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

Thank you very much !

This script is very nice. 👍   
finally got the update done. The script has a lot of small and big changes with some new features added and the decon and shop keeper crafting add on is now finished. See the main post for details
Love this script! Thanks so much. Do you think it's possible to modify it so that recipes can have variant ingredients? Doesn't seem like something that could be done with a few if - or loops (which is about the limit of my coding ability). Any tips or advice appreciated 🙂  
Thank you 🙂 and I'd have to think on how best to do that... do you want the amounts to vary or the ingredients themselves?
The ingredients themselves. So you might make a doughnut with flour and sugar and butter, or with dough and a peanut (ok they wouldn't all be terrible puns). I could just make a bunch of recipes with the same name but then the list would look quite messy. Also, thanks for your help 😀
So I attempted to try this out on my own project.

As usual, I removed the default recipes and made one of my own.

Recipes[1] = { # Sharpened Flint :recipe_type => 2, # Crafting :auto_learn => false, # Auto-learn this recipe when level is reached :req_level => 1, # Level required to use this recipe :shop_fee => 5, # Fee charged if crafted at a shop :craft_time => 200, # Time it takes to make the item :earned_exp => 1, # Exp gained on success :crafted_item => [:i3478, 1], # :failed_item => [:i2866, 2], # 😛re_failed => [:i2889, 2], # Failed item if crafted before timer :ingredients => [ # [:i2889, 2], ]} # <- DO NOT REMOVEHowever I keep getting the following error when I enter the crafting window:

undefined method 'icon_index' for nil:NILClass
I check the scripts section and it show up in the main Crafting Script, line 644.

draw_icon(item.icon_index, rect.x + 1, rect.y, @list[index][:enabled])So, what am I doing wrong here?
 
I'll think about how to make it work best 😉 I'll probably set it up in the recipe settings so you can put in an array of ingredients and it'll randomly pick from one of them...

like they kind of look like this now: [[:i42, 1], [:43, 2]], # 1x dough, 2x egg

they'd change to something like this: [[:i42, 1], [:43, 2]], [[:i43, 1], [:44, 2]], [[:i43, 1], [:45, 2]], # (1 Dough, 2 Eggs) OR (1 Egg, 1 Sugar), OR (1 Egg, 2 Peanuts)

I'll have to think on how to randomize it thought. It might be a few days till I get a chance to get to it, I also had another request I spaced to put in tools that I need to do as well.

edit:

@Ultimah: yay for posting at the same time 😉 do all of your items in the recipe have an icon graphic? I think it works without them as well, but I haven't tested that out. I'll see if I can get it to happen again since I'm not seeing any errors or typos in your recipe
You know, I DID make a huge error now that I take an extra look at it..

The [ix, x] refers to items, my brain must have translated that to icons.

Really, I feel dumb now.

edit: So is there a way to have sounds for individual recipes?
lol no worries 🙂 I just figured you had a really HUGE database. I guess I should have realized.. I think it's limit is 999. Also I did write a custom script that let the recipes have their own sounds. But re-writting that script is in my to do stack right now as well 😉 since I updated the main script, it needs some adjusting
Well that's good. Take the time you need.

And yes, I do know the maximum limit.

But still, my brain messed up at the time.
A tools system sounds like something I might want too! Also there's a 999 item limit?! There's a Yanfly script to get around it but dropbox is annoyed at Yanfly RN.

Again, thanks a million 🙂
Hey, I'm working on setting up my recipes. I tried to be careful not to mess up anything important, but upon start up, I am getting this error. I've included the script section it is referring to in the same pic. I went back and tried to make sure everything looked the same as in the demo there, but for the life of me, I don't know what the problem is. I'm sure it is something silly.

VenkaScriptError.png
it's always something silly! 😉 I can't even count how many times it was something like a comma missing 😉

sorry we were grilling tonight so I didn't see the message sooner. You have Recipe[7] in there twice on the same line. Fix that and you should be good.
Aha, yep that would do it! Thanks so much!
updated main thread with the tools add on

https://www.dropbox.com/s/35z1ojquguqecpz/Crafting%20Tools%20Add-on.txt

you can list a tool in the recipe's ingredients and if the item (or weapons) note box has <tool> in it then it won't be consumed on crafting.
Been waiting for that, thanks!
Thanks alot for sharing this script!! 
Sorry if I'm doing something wrong. I gave this wonderful demo a try from dropbox and it was updated less then 24 hours ago. I went into the scripts and edited:

Timer_Type = :none # Set to :active, :timer, or :noneBut in game the bar still works and is still required to craft.

I will try to re-read the comments and see if I can figure it out. 
oh.. did you start a new game when you changed the timer type?

The way you set it looks perfect.
oh.. did you start a new game when you changed the timer type?

The way you set it looks perfect.
Yeah I will give it another try.

Odd it works now 🙂 I think save button might been checked to know you know when you hit f12 and hit enter. Might not of actually saved the changes at the time 🙂

Thanks!

I really love this script. I was looking at a more simple version one but this seems to have a lot of power and support on it.

Going to have to smelt all these ores into bars now 🙂

mQdc83e.png

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