Home
Sitemap
Site News
Downloads
FAQ
Contact
• Basic Tutorials •
Maps
The Database
Events
Graphic Resources
• More Advanced Tutorials •
Maps
Events
The Database
Event Systems
• RGSS •
Script Fixes
Script Systems
• Other •
Using RMXP
Mini Tutorials
Miscellaneous
• Reference •
Reference

In this tutorial you will learn…

• How to use the Name Input Processing command
• How to show a character's name in the message box
• How to use this feature for NPCs


Hi there, and welcome to my Message Box Codes tutorial! This is a tutorial I should have written for a long time, really, and, after getting several e-mails asking me how to use this feature, I decided that I should get myself into gear and write this tutorial at long last. So, let's get started!

The first thing we're going to look at is the use of the Name Input Processing command. Now, as you know, being able to change the name of the main character is a fairly common feature in third-person, single-player RPGs. Now, you can insert this command at any time during the game - you can have it during an autorun cutscene at the beginning, or you can have it somewhere in the middle of the game. So, I'm going to show you how it works.

You don't need a blank map for this, really, but I like to have myself a nice, open space to work in. In my map, I'm going to have an event called Name Changing, and in it, I'm going to put a Name Input Processing command, which you'll find third down on the third page of event commands. When you click on it, you'll get a box like this…



The bit at the top is which character's name you're going to change. The main character is Arshes, so let's leave that. The bit underneath is the maximum number of characters that you will allow the player to input as their name. This can only be an integer value between 1 and 16. So, I'm going to set it at 8, and then I'll press OK. You'll see this…



Doesn't look like much, does it? Well, now we've done that, we can test out our little system already. Make sure that the event has a graphic, like mine, so that you can see where your event is in-game! When you go up to your event and press the C button (spacebar or return), you'll see this…



This allows the player to input a name of their choice. We can do this too - just press Esc to erase the letters there, and then input in a new name. When you're done, move the cursor to the OK button in the bottom-right corner and enter or space to accept the name. If you go into the menu now, you'll see that Arshes's name has changed to what we entered…



Congratulations: you've just renamed the main character! Right, now that we've renamed our main character, we need to know how to show his name when people speak to us. At the moment, if you wanted someone to speak to us and call us by name, you'd enter:



However, if the player then goes and changes their name again, the message box will still read the same. If only there were a way of entering a variable that displayed the player's name regardless of what it was changed to… Well - luckily for us, there is. Go back to your NPC event that greets us by name, and edit the text. Instead of writing the hero's name, write the following code…



You see where it is? The code you need is a backslash (/), followed by the letter n, followed by the number of the character in the database in square brackets. When written out, it looks something like this: /n[1]. Obviously I'm using the number 1 for Arshes, because he is the first entry in the database - but if you wanted to display any other actors' names, you'd just enter their number in the sqaure brackets. With the default actors, Basil would be /n[2], Cyrus would be /n[3], and so on. Now, if we playtest our game, you can see that whatever we enter as our name is displayed in the message box (I've changed my name again to demonstrate the difference)…



This is also useful for game makers (myself included!); you can write all the text and conversations in your game using just the /n[x] code rather than characters' actual names, and then, if you decided to change the names, you only have to change them in the database rather than going through your whole game and changing every instance of their name. You can even do this with NPC characters. Believe me, it's worth it if you're fickle with character names like I am!

In addition, you can use this for NPCs - just create an entry for them in the database, take note of their number, and use the code to display their name. Just a few notes about the Name Input Processing command to bear in mind when you're using it:

• The name that the character has in the database (their default name) is displayed before the player enters the custom name. Therefore, if you don't want any name to be shown, make sure that the character has no name in the database (leave the name field blank).
Note: If you want to use the /n[x] code to show the character's name before the player enters their own and you want to have a blank Name Input screen, you can use the following technique: give the character their default name in the database, and then, just before you use the Name Input Processing command, use a Change Actor Name command and change the name to being nothing:




• The Name Input Processing command will remember the name that you entered. If you want to change the hero's name more than once and you don't want to have any name displayed by default, use the technique above to clear the name before the Name Input Processing command.
• The character's sprite graphic is shown next to their name. If you don't want a graphic to be shown, make sure that you leave their character graphic blank in the database. However, remember to change it if you want to add the character to your party!

And I think that that is about it for this tutorial! If you have any further questions or get stuck with something, go to my Contact page and I'll do my best to help you. The next, and final, tutorial is on other message box codes.

:: << Previous Tutorial ::      :: Home ::      :: Next Tutorial >> ::

RPG Maker XP © 2005 Enterbrain Inc.           © 2004 Xiph. Org Foundation           Ruby © 1993 - 2003 Yukihiro Matsumoto
This site, including images and textual content, were created by and belong to me.
© 2006 - 2011 All rights reserved.

This website and tutorials have all been written in my free time (what there is of it!), and hosting can be rather costly, so any donations are very gratefully received - no matter how small - even if you can spare 50p I would be grateful!