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

There's another add on I've been working on for a week or so trying to get just right. I'm almost always scripting one thing or another.. but as far as another totally new script released... probably not any time soon. I've got a lot of unfinished scripts I need to finish before taking on anything else big.
Thanks for this great script, Venka!


One question with that little fix you just posted:


I just commented out anything related to "create_status_window" and the Recipe Scene was fixed by doing that.


Unfortunately, for some reason, I can't make that Dropbox working now, it will just stop loading, so I can't see the actual fix you posted.


Did you do anything else in that fix, or I'm good with what I have done?
yep that was it 😉 you should be good
Have you considered having an option where the player can experiment with combinations of random items to attempt to find a recipe they have to learnt??

So they could try mixing say flower and water to make bread and discover the recipe or flower and salt and fail.

It would allow another dimension to the crafts such as alchemy allowing the character to try and figure out recipe's. And if they manage to find a combination for a recipe they are not high enough level for the pop up could say you lack the experience to keep the potion stable instead of fail or success
I have thought about that and a more versatile crafting system where you could use types of ingredients.. like "fish" could be a catfish, a tuna or a trout.. but it seemed too complicated to try and do at this point and would probably need a different core mechanic to support it. I have written a custom script that allowed the teaching of recipes on deconstructed items.

So for example, you could learn how to make a Healing Potion when you decomp it if you didn't already know how to make one.
First of all, excellent script. I have spent the whole day tinkering with it and learning its capabilities. It is very good!  🙂

I wanted to ask you though, how do you recommend to add perks? For instance, I want the player to get buffs that will make it easier for him to craft or they will get a better reward (what have you) as they reach new levels. Would you say another script, a common event, or something through the script?
Lukio did a rewards system like this that I thought was pretty neat:

But in my game I want it to be "spammable" so I've designed that the normal item you get from crafting if failed and prefailed, and if you hit the green bar (I've put it to 15 frames so it's hard to hit) you getan improved item. The problem now is when I go into the crafting window it says the recipe is "Improved potion" instead of just "Potion". I want the improved to be a surprise bonus if you hit the green bar.

So is it possible to easily change name for the recipe to be failed_item instead of crafted_item. I've tried to change the crafted_item to failed_item at some point of the script, but

I'm no scripter and it made all the outcomes to become the normal potion. And some other places I tried to change just made errors appear.
see if you can get that working and maybe I can make a script call that will add to the buffer time so the window of opportunity is slightly better while a buff is on or I could toggle it so you could turn it on/off.
I'm sorry, I didn't ask the question correctly. I meant more on the lines of this: 

The player reaches Alchemy lvl 3 - They now have a chance to make two items.

The player reaches Alchemy lvl 5 - The player finds more ingredients when harvesting.

Etc etc.

But now more that I think about it, this sounds like a whole beast of its own.

What I'm at least looking for is a way for the game to read the crafting level of the player so that it can run the specified common event (or perk), this way I could at least make up some perks that don't affect your script.

Hopefully I make some sort fo sense now!
I wanted to ask you though, how do you recommend to add perks? For instance, I want the player to get buffs that will make it easier for him to craft or they will get a better reward (what have you) as they reach new levels. Would you say another script, a common event, or something through the script?
For the better rewards, thats why there are the new recipes for, it is already in the script.

The buff is there also kinda, if you level your craft, you will make everything faster if you set it up that way in the script.

For the hidden bonus item what Venka mentioned in that quote, I made it with the aid of Vlue's Equip Randomizer script.

It won't show the improved item's name in the outcome window, nor on the learned recipes name list, not even on the result window (but I want to fix this one), only in your inventory. 

If anyone is interested I could put up the things I edited in the crafting scripts to make it work.

I just saw that you wanted some harvesting bonus...

Don't know what thing you use for harvesting and how, but you can always multiply the amounts of the items received by your crafting level or extracting level. This would require just a little scripting knowledge.

Peek in the spoiler of learning how to do this and even more!

Spoiler
#################################################################################### Item bonus depending on any variable/formula using simple script calls# Level: Very Easy################################################################################### # Let's start with this.# A regular script call which would give items into your inventory when called on# an event page should look like this: $game_party.gain_item($data_weapons[X], Y) # for weapons$game_party.gain_item($data_armors[X], Y) # for armors$game_party.gain_item($data_items[X], Y) # for items # Replace 'X' with the ID of the item/armor/weapon from your database.# Replace 'Y' with the amount you wish to gain. # This would do the exact same thing like the "Change Weapons/Armors/Items" command# in the eventing menu.# However, with the script calls provided above, it is possible to add some # variety and possibilities of the rewards in multiple ways.# This is what I will explain below. # For the following examples, I will use a custom variable # from Venka's Crafting script. But it can be done with any other variable. # The variable which will return the current level of your craft type # in a script call is: $craft[X].level # Replace 'X' with the ID of the craft type you want to use. # Now let's try to make a flower which can be harvested once in every 20 seconds,# for example. # (Ignore the "once in every 20 seconds" for now. That is just an example, but it# can be achieved pretty easily with Galv's Event Spawn Timer script. # The usage manual for that one is in that script, so I won't detail it here. # It's just a good-to-know thing, in case you want to make a nice # harvesting/extraction system on your own. But for now, let's get back to the # basics of creating variable rewards with simple scrip calls.)# Make a flower item in your database just like you usually do with any items.# Make a regular event, get a flower graphic for it to suit our example.# Now, insert these lines in a script call on the event list: $game_party.gain_item($data_items[17], 1*$craft[3].level) # This will give the player the 17th item from the item list from your database,# which will be some kind of flower just for the sake of this example.# But what else will this script call do?# Well, the amount of the item(s) you will get will vary with your Alchemy level# (Alchemy is craft type 3 in the default script settings).# If your alchemy is on level 1, it will give 1 item only, but if your alchemy is # level 4, for example, it will give 4 items at once! How nice, isn't it?# Use this knowledge to create reward amounts based on your craft level# (or based on any other variable/formula you can think of actually). # Another quick example: $game_party.gain_item($data_weapons[15], 1+$craft[2].level) # This would give you the 15th weapon from your weapon list in your database.# The amount is bound with your Smithing level, so for example, you will get# 2 weapons if your smithing level is level 1, and 4 if your smithing is # level 3 (1 + 3), and so on. # Moving on to twist it some more, okay?# With the next example, I will try to demonstrate a completely variable reward# according to our craft level.  $game_party.gain_item($data_items[16+$craft[3]], 1) # This fine little example would give you the above created flower # (the 17th item in your database) only if your alchemy level is 1. # If you increase your alchemy level by 1, it would start to give the# 18th item from your item database instead of the 17th.# There, go nuts with completely variable rewards bound to any variable you want# without any conditional branches flooding your event pages! # You can even combine both of these to get variable reward types and # variable amounts of them. # Also, you can insert any formula for variable, as long as it returns a valid # decimal number, and not something else. For example, your character's level, # class ID, the amount of gold you have (careful with this, remember, # only decimals are good to go, so edit your formula with that in mind!),# the amount of another item in your inventory, and so on, and so on.# The possibilities are endless! Well, it is, if you know the specific codes for # making those formulas... # That is all we need to know about this. Have fun with your new-found knowledge!
For another way to do this, you could use Falcao's Alchemy system for extracting things on the map automatically. I am using this script and it is awesome. Disable the menu for crafting there, and use the extraction system only.

With this, you can multiply the amount number with your craft/extraction level the same way.

Your extraction level if using Falcao's script:

$game_party.extract_lv

This returns your extraction level.

Actually, because Falcao's script modifies the event to be "extract-able things" on the map with the use of note-tags, it is not possible to do the same effect as above without modifying the script itself. Modifying it for this is not hard thou, so maybe I could do it within some days.

Alright, off to sleep again! 😛
I've actually done that script, but it was really heavily modified for a specific game so I can't just post it. I can see about writing an add on for it at some point in the future. In the mean time, this is the script call to check the current crafting level

$craft[craft_id].levelwhere craft_id is the id of the craft you want to check.. so 1 would be cooking in the demo.

You can do that script call in a conditional statement and then check it.. so like $craft[craft_id].level >= 3 would do something if the craft level is 3 or higher.

The operators are as follows (incase you aren't familiar with them):

== # Checks if the values on each side are equal >= # Checks if the left side is greather then or equal to <= # Checks if left side is less then or equal to > < != # Checks if the two items are not equal to each otherhope this helps
It does!! That's exactly what I was looking for. Thanks for the quick response and the helpful nature. Seriously dude. You deserve a gold medal.
I have a suggestion. 

I noticed while on craft screen, let's say (Cook).
I have some recipes that you auto learn at, let's say level 3.
Once I hit level 3, the recipe list (in craft screen) does not update to let you know you learned new recipes.
I must exit the crafting screen and come back to get a freshly updated list.

My suggestions are either

1. Make the Recipe list update live while still on crafting screen.
2. Once you level up, it ALSO says "You've learned to craft: Iron Sword" for example.

or both would be neat.

Thanks again for the hard work and amazing scripts  😀
I tested it several ways and taking add ons out (incase I scripted it one of the add-ons and forgot to do it to the main script), but the recipe list does update when you auto learn a recipe.. or it does on my end. Can I see your recipe that's suppose to auto learn, maybe I'll see what's going on if it's not updating for you
I tested it several ways and taking add ons out (incase I scripted it one of the add-ons and forgot to do it to the main script), but the recipe list does update when you auto learn a recipe.. or it does on my end. Can I see your recipe that's suppose to auto learn, maybe I'll see what's going on if it's not updating for you
Here you go

If it works for you, then it must be one of the many many scripts I use conflicting with it. 

Code:
Recipes[12] = {     # Blue Berry 1 kg    :recipe_type  => 3,          # recipe    :auto_learn   => true,      # auto learn.    :req_level    => 3,          # Level required to use this recipe    :craft_time   => 350,        # Time it takes to make the item    :earned_exp   => 10,          # Exp gained on success    :crafted_item => [:i259, 1],   # Makes this item     :failed_item  => [:i267,11],   # 10 oz. crafted too late    :pre_failed   => [:i267,11],   # 10 oz. crafted too late    :ingredients  => [# ITEMS NEEDED BELLOW.                     [:i263, 2], [:i83, 1], [:i81, 1],  ]} # <- DO NOT REMOVE  Recipes[13] = {     # Silver 1 kg    :recipe_type  => 3,          # recipe    :auto_learn   => true,      # auto learn.    :req_level    => 3,          # Level required to use this recipe    :craft_time   => 350,        # Time it takes to make the item    :earned_exp   => 10,          # Exp gained on success    :crafted_item => [:i260, 1],   # Makes this item     :failed_item  => [:i268,11],   # 10 oz. crafted too late    :pre_failed   => [:i268,11],   # 10 oz. crafted too late    :ingredients  => [# ITEMS NEEDED BELLOW.                     [:i264, 2], [:i83, 1], [:i81, 1],  ]} # <- DO NOT REMOVE
Ok finally tracked it down. It was an issue in the actor specific add on that was conflicting with the main script 😉 here's the updated addon

https://www.dropbox.com/s/6opcbyst89k1p2x/Crafting%20Actor%20Specific%20Add-on.txt
Ok finally tracked it down. It was an issue in the actor specific add on that was conflicting with the main script 😉 here's the updated addon

https://www.dropbox.com/s/6opcbyst89k1p2x/Crafting%20Actor%20Specific%20Add-on.txt
Amazing 🙂 Thank you so much for the fast fix.

It would also be cool if it said a quick message (popup) like when you level up saying you've learned new recipes or something like that. 

Awesome work!
I'll see if I can get that worked in 😉
I'll see if I can get that worked in 😉
Hehe I feel bad but there's another thing I just noticed 😛

Bug: 

The CREATE button.

If the results of the recipe will give 2 or more of that item, the button says x1 (under CREATE).

Is it possible at all to make it recognize that it will make 2x or more of that item?

Suggestion: 

Is it possible to make it so the recipe list is Custom Names instead of the actual item it creates?

So instead of "Battle Axe" (default database name for item)

It would say "Craft Battle Axe"

To give more definition as to what the recipe does/is etc.

it would prove to be useful in my game and others I am sure.

Of course it can optional for devs.

Thanks again 🙂
I see you mean like the Loaf of Bread one in the demo.. where the recipe itself creates 2 items? I should be able to fix that. As for the suggestion, I think I can do that to by setting up a display name in the recipe set up. I'll add it to the "to do list" 🙂
I see you mean like the Loaf of Bread one in the demo.. where the recipe itself creates 2 items? I should be able to fix that. As for the suggestion, I think I can do that to by setting up a display name in the recipe set up. I'll add it to the "to do list" 🙂
Yep

Hahaha remember to be a human being once and a while 🙂 such an amazing machine you are.

Thanks for considering 😀

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