Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Blacksmith system in VX

Aside from scripting, you could make a common event that sets different variables equal to the number of items held for each item you want to keep track of.  Then just have a conditional branch at the blacksmith that checks for the variable to see if you have enough of each type of item required to blacksmith an item.
 
evergreen":2dwoinlo said:
You'd have to event, or script it. If you PM me, I'll happily start of the system for you, with comments and all. Just as long as I get something in return. ;)
I don't know what I should give you back since I'm just a starter... Maybe you tell me ( except money because I don't have paypal account...) whether I can do it or not?

Gabriot":2dwoinlo said:
Aside from scripting, you could make a common event that sets different variables equal to the number of items held for each item you want to keep track of.  Then just have a conditional branch at the blacksmith that checks for the variable to see if you have enough of each type of item required to blacksmith an item.
That's the problem! Because I have no idea the usage of variable even though I had read the variable tutorials for so many times...T__T
 
I'll guide you through a quick tutorial for making a "sword" from 2 "irons" (sword is a weapon and iron is just some item used for smithing)

Make a common event called "check inventory".

Now make a Control Variable event, where it says Single at the top, create a variable and call it # of Iron.  For Operation hit "Set", and below that click the "Item" bubble and then select "Iron" from the dropdown (Make sure you have Iron item already made in the items tab of the database)

Now click Okay.  You're done w/ the common event!

Now make an event in your game, maybe some blacksmith looking guy or a table or something.  Now in the event processing:  The first thing you should do is have it call the common event you just created ("check inventory").
You can also put in a message such as "Costs 2 Iron to make this sword, create?"  (Then show choice yes or no)
Now (for the yes condition): make a conditional branch.  Click the variable bubble and select the # of iron variable.  In the dropdown box below that, set it to "Greater than or Equal to" and for the Constant have it be 2.  Also leave the handling when not met thing checked in the bottom right.

Now Right between where it says Conditional Branch: (bla bla bla) and : Else

Make a Text that says "Success, you made a Sword out of 2 iron!"  then change items having 2 less iron and 1 more sword.

Now between the : Else and : Branch End

Create a Text that says "You can't fool me, you do not have 2 Iron!"

And that should be all you need to get on your way!
 
Gabriot":1b98znkx said:
I'll guide you through a quick tutorial for making a "sword" from 2 "irons" (sword is a weapon and iron is just some item used for smithing)

Make a common event called "check inventory".

Now make a Control Variable event, where it says Single at the top, create a variable and call it # of Iron.  For Operation hit "Set", and below that click the "Item" bubble and then select "Iron" from the dropdown (Make sure you have Iron item already made in the items tab of the database)

Now click Okay.  You're done w/ the common event!

Now make an event in your game, maybe some blacksmith looking guy or a table or something.  Now in the event processing:  The first thing you should do is have it call the common event you just created ("check inventory").
You can also put in a message such as "Costs 2 Iron to make this sword, create?"  (Then show choice yes or no)
Now (for the yes condition): make a conditional branch.  Click the variable bubble and select the # of iron variable.  In the dropdown box below that, set it to "Greater than or Equal to" and for the Constant have it be 2.  Also leave the handling when not met thing checked in the bottom right.

Now Right between where it says Conditional Branch: (bla bla bla) and : Else

Make a Text that says "Success, you made a Sword out of 2 iron!"  then change items having 2 less iron and 1 more sword.

Now between the : Else and : Branch End

Create a Text that says "You can't fool me, you do not have 2 Iron!"

And that should be all you need to get on your way!
Okay I kinda get there now... If like had to pay before smithing, how? Since there are no such blacksmith for free...
 
Have him also notify the player the price that is involved.  Now what you have to do is have another conditional branch in between the First conditional branch that you made and the else statement (and the 3 lines you put in there (message, item delete and item add) need to be cut and pasted into the new conditional statement).  This new conditional statement should check for gold (which is located in the 4th tab on the conditional branch creation screen) and have it check for the gold.

So basically you have a branch which in a branch that checks to see if you have enough gold after checking also that you have enough Iron.  Then the only thing you'll need to add on top of the Success! message, iron delete and sword add would be to take away X amount of gold.  Also in the new : Else you can put something like "You have enough Iron, but not enough gold!".

I know that's going to be hard to try and understand, I'll try to get a screenshot up of an example event tomorow sometime, I'm going to go to bed now though.
 
Hum, but, if you wish to have a Shop Menu for blacksmith, you'd actually need a system, right? I have also thought of that, and did not do that because using messages for blacksmithing and shop menu for normal shop would be ugly.
 
You could do that...

Or you could just have a bunch of items out on display, and you could walk up to them and do it with events.

Whichever you prefer.  What you speak of will need a script however.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top