Key Items are a major part of many games, from keys that unlock dungeon doors to crystals that you need to find and return to a magical kingdom. But sometimes we want our items to be more than just a two-line description in the item menu. That’s where common events come into play, giving us the freedom to make our items as detailed as we want.
We’ll be focusing on key items for this tutorial, but of course these ideas can be used with normal and even consumable items. Before jumping into some of the fun stuff we can do, let’s make an example item to see how it all works.
Let’s start with something simple while we learn what’s required for this to work. Luckily, we only need to set up two things: the item itself and the common event it calls. First up is the item, which in this example is A Key Item. It only has two lines for the description, which just isn’t enough to fully explore how great A Key Item is so let’s go ahead and have it call a common event in the Effects section.
And honestly, that’s all we need to do to get the item to get it working! But we don’t want the database’s default General Settings for this item, so let’s go over what has been changed and why.
First up is the Item Type, which we’ll switch to ‘Key Items’ since it would be silly if our A Key Item item wasn’t a key item. In this example the Price doesn’t matter, but if we didn’t want the player to be able to sell an item then we’d leave the price at 0. Consumable is one of the most important settings to change because it controls whether or not the item will disappear when it’s used. Since we want the player to be able to use the item repeatedly, we need to switch it to ‘No’. There are a lot of options for the Scope setting, but in this case we’ll be setting it to ‘None’. ‘None’ means we can skip the ‘choose target’ list and just straight to the item’s common event, which is the perfect option for items that don’t have an effect on anyone. Lastly, we’ll switch the Occasion to ‘Menu Screen’ instead of ‘Always’ because we don’t want the player to accidentally use A Key Item in battle where it won’t help them win the fight.
With our item ready to go, we need to set up our common event so that our item has something to do. We have two main options for our item common events, we can either set up a separate common event for each item that calls one or we can put multiple items into one common event and keep track of which one activates with a variable and conditional branches. Since the second option is a little more complicated if we haven’t done it before, let’s use it for our tutorial.
The first thing our common event needs is the variable properly set. MZ makes that easy with its Last options in the Game Data section, so we can pick ‘Last Used Item ID’ and it will set our variable to the right number. If we check our Items page in the Database (or scroll up to check the screenshot), we can see A Key Item’s ID number is 38.
Since the variable will always be set to 38 when we use A Key Item, we just need to set up a Conditional Branch that checks if our variable matches the item ID number, and add in what we want to happen when that item is used. For A Key Item, we’ll keep it simple and just tint the screen and have a message where Priscilla talks a bit more about the item (we want to remove the tint at the end so that we don’t accidentally leave the game in sepia). With the eventing for the item done, we’ll wrap up the common event by resetting the variable used to 0 so that we can reuse it without worry. If we had an idea like having an NPC comment on the last item used and wanted to keep track of the item for later, then we could leave out the reset so that the item variable will only be changed when a new item is used.
All that’s left is to test it in our game!
Since our event was simple, there wasn’t too much that could go wrong but it’s always good to check so that we can fix any bugs with the items before our players run into them.
Now that we know how to make a common event work with an item, let’s make something fun. World maps can be a great way for players to better understand our game world, so why not make a key item that lets our players check out the map whenever they want?
First we need to make the Map item, which is similar to our A Key Item we practiced with.
Since we set up a common event for our items already, we can add in a Conditional Branch for our Map item (setting it to check if the variable is 33 to match the item ID) and add in our map event. We’ll use a picture to really show off our world map, and to make it a bit cooler let’s move the picture onto the screen as if it’s being unrolled from the hero’s bag.
It can be difficult to understand what’s going on from just a screenshot, so let’s break it down into simpler parts. First we’ll add the picture to the screen, but have it appear off the bottom of the screen with its width set to 0% so that it can’t be seen right away. Once that’s added we can play a sound effect and move the picture to the center of the screen, changing its width to 100% so that it’s totally visible.
With the world map visible, we need a way to have it stay on-screen until the player is finished with it. That’s easy to do with an empty message with the Background set to ‘Transparent’, which means it won’t get in the way of the player’s view but keeps the event from moving on until they click.
Last up is moving our picture back offscreen and then erasing it.
With those all working together, we get a great effect when the player feels like checking out their map.
Another thing we can do is have our party members separately comment on an item, which is a perfect way to show off their different personalities. To get this effect we need to change our setup slightly, so let’s make a new item and common event for the party messages.
We’ll make our item a Sandwich and set its Scope to ‘1 Ally’ since we want to be able to choose who will be commenting on the item.
Now onto our commentary common event. It starts the same way as our other common event, setting a variable to get the item’s ID number, but we also need another variable to find which actor was chosen. The Last option in the variable command lets us grab the actor ID as easily as the item ID, so all we need to do is check which party member the player can get and make sure there’s a Conditional Branch that matches all our possible party members.
With those Conditional Branches all set up, we just need to add in what the party members will say. I decided to show the party member bust along with their message, but as long as the player knows who’s speaking it’s fine to keep things simple if it fits your game.
In the case of this sandwich their comments aren’t too exciting, but for more important items it could lead players to discover new things. Maybe a magical scroll can only be read by your mage character and they discover a brand-new spell, or a ragged note has some symbols on it that your thief recognizes as a treasure map to a secret stash of weapons.
Common events can add a ton of extra details to our game’s items, from giving us a way to show our world map to our players whenever they want to see it to just having more than a two-lined description so that the player can learn all they could possibly want to know about the item. Now that you know how to do it, what other things could you do with items and common events?
Steam Next Fest is here, and it is a time to explore tons of upcoming games, and the team at AstralShift in cooperation with the VisuStella team and Komodo, has joined the festivities with the release of the Demo for their RPG Maker Game Pocket Mirror ~ GoldenerTraum!