This is somewhat of a beginner's tutorial for those that don't quite fully understand how to work with variables.
NOTE: This works for virtually all RPG makers from RPG maker 2000 to RPG VX
I helped someone recently make a simple blacksmithing system, so I'm going to guide you through step by step the uber simple process that requires no scripts.
Creating a common event to check for Items
Creating an actual Blacksmith
And that's it! Short and sweet, but from this template you should be able to create much more sophisticated blacksmithing operations (or crafting or alchemy or whatever you want in your game!)
Demo: http://www.megaupload.com/?d=JPY7I344
Edit: Also, you need to download the Variable fix script from the scripts section of this site (stickied). You'll notice that if you don't the game will error, because by default variables don't even work worth a shit in rmvx.
NOTE: This works for virtually all RPG makers from RPG maker 2000 to RPG VX
I helped someone recently make a simple blacksmithing system, so I'm going to guide you through step by step the uber simple process that requires no scripts.
Creating a common event to check for Items
You need to go to the database manager (the place where you edit actors, items, animations, skill, etc.)
There will be a tab named "common events". Click it. Think of a common event as an event that you can call over and over again from anywhere in the game. Now name a new common event something like "Inventory Check". Basically our goal here is to create an event that checks our inventory for items that are needed for blacksmithing (or alchemy or whatever you want to do) and assigns the number of these items held in your inventory to a variable.
Now in this tutorial we'll just do one to save time and space. Insert a new process, and have it be "Control Variables". I use an item I created called "Iron", but you can use any item you want. Take a look at the picture below to see how you should set everything. Basically, what this does is sets the number of "Iron" in your inventory to the variable "# of Iron" that you specified at the top. So if you had 2 Irons in you inventory, the value of # of Iron is now 2.
Click okay and we have all we need right now for the common event! In the future you can do this same thing to check for whichever items you need to check for.
http://i292.photobucket.com/albums/mm4/ ... smith2.jpg[/img]
http://i292.photobucket.com/albums/mm4/ ... smith3.jpg[/img]
There will be a tab named "common events". Click it. Think of a common event as an event that you can call over and over again from anywhere in the game. Now name a new common event something like "Inventory Check". Basically our goal here is to create an event that checks our inventory for items that are needed for blacksmithing (or alchemy or whatever you want to do) and assigns the number of these items held in your inventory to a variable.
Now in this tutorial we'll just do one to save time and space. Insert a new process, and have it be "Control Variables". I use an item I created called "Iron", but you can use any item you want. Take a look at the picture below to see how you should set everything. Basically, what this does is sets the number of "Iron" in your inventory to the variable "# of Iron" that you specified at the top. So if you had 2 Irons in you inventory, the value of # of Iron is now 2.
Click okay and we have all we need right now for the common event! In the future you can do this same thing to check for whichever items you need to check for.
http://i292.photobucket.com/albums/mm4/ ... smith2.jpg[/img]
http://i292.photobucket.com/albums/mm4/ ... smith3.jpg[/img]
Creating an actual Blacksmith
Now we have to create an actual blacksmith. Create a new event and make it look something like a blacksmith.
Have the first thing it does is call the common event that you just created (This is so it sets all of your variables to the correct values aka the correct number of items currently held in your inventory)
Next you can add in a message from the blacksmith, something like "This swords can be made from 2 Iron and it'll cost ya 20 Gold" (because blacksmiths don't work for free ya know) and give the player a choice to choose Yes or No.
Now under the Yes line, we are going to start using conditional branches to check if the player actually does have the materials require to make the item. Create a Conditional Statement. You're going to want to click the Variable bubble and make it be the # of Iron Variable. Then in the dropdown box below it select Greater than or equal to, and select a constant of 2. What this does is checks to see if your variable # of iron has a value of 2 or greater. Leave the box that says set handling when conditions don't apply, because this is going to allow us to have event processing for when the player does not have 2 or more Iron (we can leave a message like "You do not have 2 Iron").
http://i292.photobucket.com/albums/mm4/ ... smith4.jpg[/img]
Now if all we needed was for the player to have 2 Iron, we'd not need any more Conditional branches, but since we also need 20 gold, we have to check for that as well! Most of the time you're going to be checking for many things, and you'll need additional Conditional branches inside of each branch for each additional thing that you need to check for. Basically think of it in this grammar: "If player has 2 or more iron, then -> If player has 20 or mole gold, then -> Sucess! Add 1 sword, take 2 iron away, take 20 gold away."
So between the conditional branch you just made and the Else line, make a new conditional branch. This time go to the 4th tab and select the "Gold" bubble, and check to see if the player has 20 or more gold. Leave the ELSE handling conditions box checked this time as well.
Now between your newly created branch within a branch and your new Else created from that branch, you can create your processing for a succesful smelting and payment! Have a message telling the user it was a succes, then change your inventory accordingly. For the else condition here you might want to let the player know that they did have enough Iron, just not enough Gold.
http://i292.photobucket.com/albums/mm4/ ... ksmith.jpg[/img]
Have the first thing it does is call the common event that you just created (This is so it sets all of your variables to the correct values aka the correct number of items currently held in your inventory)
Next you can add in a message from the blacksmith, something like "This swords can be made from 2 Iron and it'll cost ya 20 Gold" (because blacksmiths don't work for free ya know) and give the player a choice to choose Yes or No.
Now under the Yes line, we are going to start using conditional branches to check if the player actually does have the materials require to make the item. Create a Conditional Statement. You're going to want to click the Variable bubble and make it be the # of Iron Variable. Then in the dropdown box below it select Greater than or equal to, and select a constant of 2. What this does is checks to see if your variable # of iron has a value of 2 or greater. Leave the box that says set handling when conditions don't apply, because this is going to allow us to have event processing for when the player does not have 2 or more Iron (we can leave a message like "You do not have 2 Iron").
http://i292.photobucket.com/albums/mm4/ ... smith4.jpg[/img]
Now if all we needed was for the player to have 2 Iron, we'd not need any more Conditional branches, but since we also need 20 gold, we have to check for that as well! Most of the time you're going to be checking for many things, and you'll need additional Conditional branches inside of each branch for each additional thing that you need to check for. Basically think of it in this grammar: "If player has 2 or more iron, then -> If player has 20 or mole gold, then -> Sucess! Add 1 sword, take 2 iron away, take 20 gold away."
So between the conditional branch you just made and the Else line, make a new conditional branch. This time go to the 4th tab and select the "Gold" bubble, and check to see if the player has 20 or more gold. Leave the ELSE handling conditions box checked this time as well.
Now between your newly created branch within a branch and your new Else created from that branch, you can create your processing for a succesful smelting and payment! Have a message telling the user it was a succes, then change your inventory accordingly. For the else condition here you might want to let the player know that they did have enough Iron, just not enough Gold.
http://i292.photobucket.com/albums/mm4/ ... ksmith.jpg[/img]
And that's it! Short and sweet, but from this template you should be able to create much more sophisticated blacksmithing operations (or crafting or alchemy or whatever you want in your game!)
Demo: http://www.megaupload.com/?d=JPY7I344
Edit: Also, you need to download the Variable fix script from the scripts section of this site (stickied). You'll notice that if you don't the game will error, because by default variables don't even work worth a shit in rmvx.