Collecting items is a common event in games, but often once we’ve gotten the item all we can do with it is leave it in our inventories. While that does work for plenty of items like keys and potions, what’s stopping us from giving our players item pieces that they need to combine to make something better?
Being able to combine some items gives our players another thing to think about when they pick up our games. Building a complete crafting system from scratch is a lot of work, but it can still be fun even if we add just a few items that can merge to make something else. What if our players needed to find four crystal shards that they must combine to make a powerful crystal that opens the final boss’ door? Or if we just want to reward our players for gathering certain items and checking on them in their inventory?
Combining items in the menu can be a simple and fun addition to our games once we know how to do it, so let’s learn.
We’ve already discussed using common events with key items in a previous tutorial, so make sure to check that out if you want a refresher on setting up items and common events.
First thing we’ll work on is a new item made from two of the same item, in this case a stone tablet formed from two stone pieces. Before we can jump into the eventing, we need to make our two items. The most important things for our Stone Piece item is that we include our common event in the Effects section and that we sent the Consumable option to ‘No’, so that we don’t lose one when we try to combine them in the common event. We also want to set its Occasion to ‘Menu Screen’ since we don’t want our players to accidentally try to put these rocks together in a fight (though combining items in battles could be an interesting mechanic).
Our Stone Tablet item doesn’t need much for this example, we just want to create it.
Now that our two items exist, we can start on the eventing. Since we need two Stone Pieces to make a Stone Tablet, our first step is to check just how many Stone Pieces we’ve got sitting in our inventory. Let’s do that by using a variable to get the item’s possession count. Setting our variable to that will give us the number of Stone Pieces in our inventory, which is exactly what we need for the next step.
With our variable set to the number of Stone Pieces, we just need to use a conditional branch to see if we have enough to form a Stone Tablet. If our variable says we have two or more Stone Pieces, then we’ll give the option to form a Stone Tablet. We want to make sure to check ‘Create Else Branch’ in the conditional branch so that even if we don’t have enough Stone Pieces we still get feedback when using the item; in this case, just a simple message that mentions needing more Stone Pieces.
When we do have enough Stone Pieces, we need to actually turn them into the Stone Tablet. ‘Transforming’ the items into something new feels like it should be confusing to do, but it’s really a straightforward process. We just need to use the Change Items event command to decrease our Stone Piece amount by 2 and increase our Stone Tablet by 1. There isn’t any fanfare if we only change the items though, so by adding in an ME and a message informing us about the change we can be sure that our players know there’s been a change in their inventory.
We can also include the addition of a yes/no option with a Show Choice command so that the player has control over the whether or not the Stone Pieces are combined.
Combining multiples of the same item isn’t the only thing we can do with this idea though. What about combining a few totally different items to make something, like two sides of a map to form a full one? Well, we can do it with the use of nested conditional branches.
Again, the first thing we’ve got to do is set up our items that’ll be involved. To make the map we’ll need three items: the left part of the Ripped Map, the right part of the Ripped Map, and the Full Map. The two Ripped Map items are set up similarly to our Stone Piece, though the common event they call is their own.
The Full Map item is much like our Stone Tablet in this tutorial, though we could easily give the map the option to open up the game’s world map so that it’s useful in-game.
With our three map items ready we can make our conditional branches that check if we have the Ripped Map items. We’ll nest one inside the other, so that they’ll only be combined if both Ripped Maps are in the inventory.
Our first conditional branch will check if the Ripped Map (Left Part) is in the inventory, and if it was then our next one will check for the Ripped Map (Right Part). If either of them aren’t there, then a message about missing a piece will play. But when we do have both we’ll set up a similar situation to before using Change Items to remove both Ripped Maps and give the Full Map item (along with a ME and message for our players).
And with that, our players can piece together ripped map bits to form a map. Nested conditional branches work well, but let’s take a look at how we can combine them into just one branch in our next example.
For this example, let’s take a look at one way we can include upgrading equipment in our games. Adding a steel bar to a sword to make it better may not work in real life, but it’s perfect video game logic so let’s do it!
We’ll need to set up our Steel Bar item much like our previous items, along with our two weapons, the Sword and Sword+1.
The only difference between our swords will be that the Sword+1 has double the attack of our normal Sword.
With those ready, next up is our event. While we could do another common event that the Steel Bar calls, in this case let’s make a map event for a Blacksmith who will take care of crafting the weapon. Since we want to check for both the Steel Bar and Sword in one conditional branch, we need to use some script calls. $gameParty.hasItem(n) let’s us check if an item is in our inventory, we just need to replace the ‘n’ with the proper code and database number. For our steel bar, we’d put $dataItems in for the ‘n’ since it’s the 51th item in our database. Our Sword is a weapon, so its code will use ($dataWeapons[#], true/false), where the ‘true/false’ will tell the game to check currently equipped weapons or not. We do want it to check equipped weapons, which means the ‘n’ will be ($dataWeapons, true) for our Sword. Now that we know how to write out both pieces, we can connect them with && so that the conditional branch knows that we need both the Steel Bar and Sword.
So all together, our conditional branch’s script call is $gameParty.hasItem($dataWeapons, true) && $gameParty.hasItem($dataItems). If we don’t have both the Sword and Steel Bar, then the blacksmith will play a simple message about not having anything to talk about. When we do have the two items, we can set up our blacksmith to ask if the player wants to upgrade their sword. If we pick ‘yes’, then we’ll use Change Items and Change Weapons (making sure to check the ‘Include Equipment’ option, since we were checking for equipped Swords) to remove the Sword and Steel Bat and another Change Weapon to give the new Sword+1.
With a ME and message informing the player about the new sword, our blacksmith is done and ready to give our players an improved weapon.
Our examples today have used only a few items to make things, but the only limit is how much eventing you want to do. If you want to combine five or even ten items, all you need to do is add in some more checks to the inventory! Now that we know how to create item combining events, how would you use this in your games?
Have you ever made or seen a “I need this thing, otherwise I cannot continue working on my game!” type of request? While I understand that some elements can be crucial to have, there is no reason to have the lack of a resource restrain you from working on your project. In fact, the lack should not affect you at all - for the moment.