ITEM CRAFTING

RPG Maker VX Ace

Craft items/weapons/armor from other items

Overview
This script adds an item crafting system to the game.
Crafting recipes are set using note tags.

For example, if you wanted to be able to distil 5 potions to make a Hi-Potion, you would add this tag to the Hi-Potion item's Note:
<craft item:1:5>

And to allow a hi potion to be diluted to make 4 potions from it using the breakdown system, you would add this tag:
<craft break item:1:4>

That makes it possible to create hi-potions through the crafting menu if you have 5 potions in your inventory.

And break hi-potions into potions through the breakdown menu:

Features
  • Craft item/weapon/armour from other items/weapons/armour
  • Restrict individual recipes to require a tool
  • Hide individual recipes until the player acquires a specific item
  • Restrict the crafting system to a specific actor or class
  • Control access to the crafting system with a game switch
  • Launch the crafting system from an event instead of the menu
  • Breakdown items into components (new in 0.9.2)
  • Crafting shops - gold price for recipes (new in 0.9.4)
  • Crafting shops - use a game switch to control recipe visibility (new in 0.9.4)


Usage
To install the script, open the script editor in RPG Maker VX Ace.
Scroll to the bottom, and select a blank row between Materials and Main Process.
copy/paste the script code into the right hand editing pane.

For any item you want to be craftable, you need to add at least one craft tag to its note.
Each craft tag specified one ingredient of the recipe to create the item.
The tags are as follows:
TagMeaning
<craft item:id>Consume 1 item with the specified id
<craft weapon:id>Consume 1 weapon with the specified id
<craft armor:id>Consume 1 armor with the specified id
<craft item:id:number>Consume a number of items
<craft weapon:id:number>Consume a number of weapons
<craft armor:id:number>Consume a number of armors


With these tags, you have the basic crafting system.
If the player has the ingredients you specified, they can craft the item.

But maybe you want the player to find recipe books or need specific tools to craft items.
This is also possible with two more note tags:
TagMeaning
<craft tool:id>The tool must be in inventory to craft, but is not consumed
<craft recipe:id>The recipe item must be in inventory, or this item will be hidden from the crafting menu


These are pretty similar in function, which one to use depends if you want the player to be able to see the recipe or not.

If you want to use item breakdown as well as crafting, the tags are similar:
TagMeaning
<craft break item:id>Give 1 item with the specified id
<craft break weapon:id>Give 1 weapon with the specified id
<craft break armor:id>Give 1 armor with the specified id
<craft break item:id:number>Give a number of items
<craft break weapon:id:number>Give a number of weapons
<craft break armor:id:number>Give a number of armors
<craft break tool:id>The tool must be in inventory to breakdown this item
<craft break recipe:id>The recipe item must be in inventory, or this item will be hidden from the breakdown menu


Finally, do you want the crafting menu to be available all the time?
If not, there are restrictions you can set by editing the configuration variables at the top of the script.
You should use the IDs from your game database.
VariableEffectDefault
MENU_COMMANDAddto the game menutrue
MENU_COMMAND_TEXTName of the menu commandCrafting
MENU_COMMAND_ENABLEAlways enable the menu commandtrue
MENU_COMMAND_SWITCHEnable the menu, if a switch is on0 (disabled)
MENU_COMMAND_ACTOREnable the menu if a specific actor in the party0 (disabled)
TEXT_INGREDIENTS_TITLEHeading for the ingredients windowIngredients:
TEXT_INGREDIENTS_TOOLSHeading for tools in the ingredients windowTools:
TEXT_INGREDIENTS_PRICEHeading for price in the ingredients windowTools:


Configuration for the breakdown system follows the same pattern, in the "module CRAFT_BREAK" section.
It is therefore possible to enable only one system, or have different conditions to enable each one.

Crafting shops

Perhaps you want to have crafting performed at a shop?
Perhaps you want different shops to be able to craft different things?

Both of these are now possible.
First, we need to add note tags to the items:
TagMeaning
<craft gold:amount>Price to craft this item
<craft break gold:amount>Price to break down this item
<craft switch:id>Show this recipe only if the game switch is ON
<craft break switch:id>Show this recipe only if the game switch is ON


If you want the same items to be craftable at every shop, you can ignore the switch.
However the switch lets you make a blacksmith, alchemist, etc, each of which can craft different items.
Switches can also be used to enable new items as the player progresses through the game. If you specify multiple switches in a recipe, all of them must be on.
(note that <craft switch> and <craft recipe> perform the same function, so you could use switches exclusively if you don't like using key items)

To launch the crafting from a shop event, you will need to use a script call:
SceneManager.call(Scene_Crafting)
Fiber.yield


And the equivalent for calling breakdown from an event:
SceneManager.call(Scene_Craft_Breakdown)
Fiber.yield


Here is an example of a blacksmith's shop event:


I have given the halberd these notes:
<craft weapon:1>
<craft weapon:13>
<craft gold:100>
<craft switch:10>

And in the game, it looks like this:

Posts

Marvelous! I was going to use Kread-EX's crafting system, but all I really need is something simple like this. Many thanks.
Hey, this script seemed just the thing I needed but when I start my game I get :

Script line 526 TypeError occurde
superclass mismatch for class Window_ingredientList.

I don't get it ! I have Vx Ace but it seems I'm confused... a lot lol !
Someone knows how to help me ?
Awesome script, but I have only ONE request! I have a HUGE list of things that are craftable. Can you add an option, similar to the recipe requirement, where you need to have a certain equipment in your inventory or equipped for the option to appear. For example, I have a longsword equipped. So I can see that Longsword +1 is in the craft list. If that sword was not equipped or in my inventory it would not appear.

My game has a long list of weapons each with variations up to +15 and even enchanted variations that I want to be crafted using this script. But that would make a HUGE list in the crafting menu and overwhelm the player.
Sadly, I'm a bit of a noobie at this and I'm having a bit of trouble figuring out how to get the "crafting shop" thing working. Any tips?
this is great! i have one question though. is there a way to make it so the craftable item isn't really shown? like it has question marks instead of the name or something? because the specific system im trying to make is more of a "putting ingredients in and getting lucky with the results" thing than traditional crafting.
Any way to recieve multiple items out of a recipe like 1 log = 4 planks
masterofmayhem
I can defiantly see where you’re coming from
2610
This is exactly what I've been looking for. Thank you.
I am using this in my game currently called An Unlikely Adventure. It is a game that I do plan to sell when it is done, I have given credit in the read me file and fully intend to present you with a free copy when it is ready.

Thanks for the awesome script! I spent several hours trying to make something similar with events and switches and finally found this
author=ashien
Any way to recieve multiple items out of a recipe like 1 log = 4 planks

Lets say log is Item 3 and Plank is item 2
the break code is normally
<craft break item:Item_id:Quantity>
this tag would be placed in the note space of Item three, the log. Item_ID is the item you get when you break down the log. So change Item_Id to 2. So the code would currently look like
<craft break item:2:Quantity>
and you want to get 4 planks. So where Quantity is, change it to 4. So the notetag should look like.
<craft break item:2:4>
and when you save and load up the playtest. Go to the Breaking option, click log and you should get 4 planks.

Hope that helps.

If you mean to go into craft and take 1 log and craft it into 4 planks - I have no idea. It'd be easier to just make it a break item tag instead in my opinion and from my current understanding of the script.
im not very smart with this, could someone help explain step by step please?
is it possible to find a demo of this somewhere so that i can see it in action?
i have looked at it and it is good. i have one question however. is there a way to bind things to specific classes?(like only guns being craftable by for example a gunner)
I understand the directions, I followed them exactly, but I think I discovered a bug in the script.

When I type <craft break item:1:2> to try to break down a hyper potion into two potions the script thinks potion is a tool for some reason and gives me infinite potions. I never used the tool command yet only recipe,craft item,and break. I am by no means an expert I just follow directions and can sometimes translate code.

If anyone can help solve this problem I'll be forever grateful.

Update: retested to try to debunk the problem. <craft recipe:id> command is the same as <craft tool:id> for me. Items always show up in crafting window whether I have a recipe for it or not. using the recipe command turns the item into a tool.

Update: figured out my issue. I was using the recipe command incorrectly. all is fixed now.
What is the fiber.yield and the script segment? Does yield represent class or what? How would it have to be written to not get a method error?

Nevermind I figured it out. I had it written as Fiber.Yield and it didn't like the caps. I had to write it as Fiber.yield instead and it worked fine.
This looks SO AWESOME! Any plans to convert this script to RPG Maker MV? It would be just the thing for a game I'm working on!
Hi, first i want to thank you for creating this, your script is amazing!
Second i need your help (or anyone's who can help), with customizing something in the script. Its something very simple i guess, but i have no idea how to script.
So i want to draw an empty line between ingredients title and the actual ingrediends, something like this:
Ingredients

first item 0/1
second item 0/1 etc.

Can you please tell me what do i need to change in the script in order to do that?

Nevermind i got it!
This script is really great. It's the best of the crafting scripts out there.

However, it conflicts with Victory Engine's Item Command Script.

I can also see that it is unlikely anyone will respond to this, hence the last post was an unanswered question.

But, reporting the bug anyway, because it is the right thing to do.
Hi! First I wanted to thank you coelocanth for this awesome script! I am currently working on a project and plan on going commercial. I'd like to use this script and would of course give due credit and send you a free copy as per your terms of use...but I can't figure out how to contact you besides posting on this forum.

Is there any way I can pm you or whatever once my project is done to send you your game copy and a heads-up that it is done?
This is a very well made, easy to follow script. However, I'm having trouble understanding how to develop recipes. I want to combine random items to make certain potions. Can anybody give me or point me to a step-by-step tutorial on making recipes with this script?
author=Reapergurl
This script is really great. It's the best of the crafting scripts out there.

However, it conflicts with Victory Engine's Item Command Script.

I can also see that it is unlikely anyone will respond to this, hence the last post was an unanswered question.

But, reporting the bug anyway, because it is the right thing to do.


Sorry, I lost my password for RMN some time ago when the reset function wasn't working.
Do you know how it conflicts at all?