RPG Maker VX Ace from scratch – part 3, NPC interaction

Last time we added some object interaction. I’m not finished with that yet, so I’ll add some finishing touches to this floor, and then let Eric go down to the base floor. But what I really want to get to is to have Eric meet someone.

Piano music

There’s a piano on the floor. I think it would be neat if interacting with it changed the background music. Let’s do that.

Add an event on the middle of the piano keyboard.

2015-08-31 19_49_32-Set priority to Same as Characters. Add a Play BGM (background music) command and select Theme4 (or another piece of music you want).2015-08-31 19_53_30-BGMAdd a Control Self Switch to set A to ON, so we move to another page.

Add a new event page, set its priority to Same as Characters, set its condition to Self Switch A is ON, and do the same as on the first page, but this time selecting Scene 2 for the BGM and Control Self Switch B to ON.

Do the same thing again (adding a third event page) with a condition of Self Switch B. Add an event to set BGM to Theme 3, which is the background music we selected for the map. Add two Control Self Switch commands to switch A and B to off.

You can now playtest and hear the background music changes.

A prologue

I’m going to add some more events, but won’t describe them here. You can check the project to see what I did and how. I made some use of Comment command to explain things.

The last thing I want to do before letting Eric go down to the bottom floor is add some text to tell players what’s going on.

Edit the cutscene event. We’ll put the text at the start using the Show Scrolling Text command. It’s at the bottom of the Message category on the top left of the first event commands tab. I entered the following text (I originally wrote something a little longer, but I think shorter is easier on the player):

A recent graduate of knight training, Eric has
returned home to rest.

One night when his parents and sister were out,
he remembered his grandfather telling him of a
dungeon in the basement.

The house has no basement that he knows of, but
he decides to look for it anyway. Who knows, he
might find some of the adventure he's been craving.

First things first, he needs to find his sword and
shield, which his mother stored away for him.

You can OK the command and dialogue and test this (remember to turn the cutscene’s event trigger back to Autorun if you want it to run automatically).

The speed is a little too fast for me, and if you think so too edit the event and change the speed to 1. (I would have liked it to be a little slower still, but that’s the slowest speed.)

Now it’s possible to read this text but it’s not very comfortable, the way it’s shown over the scene. I think it’d be better to show it over an image.

2015-09-22 22_38_04-Event CommandsI’d like to use the Show Picture command, but unfortunately there are no pictures there to select.

Fortunately I noticed a suitable picture while I was deciding on the title screen graphic. It’s called Book, and if you go to the database (F9) System page and select a title page graphic (bottom right of the screen) as we did before, you could see it. I feel that’s something that’s suitable for displaying the intro text over.

So now I need to get this graphic into a place I can select it from. That’s what the Resource Manager is for. Press F10 or select it from the Tools menu.

2015-09-23 11_06_38-Resource ManagerThe title screen graphics are under Graphics/Titles1 (and Titles 2 for the foreground decals). We want to get a copy of the Book graphics under Graphics/Pictures. Click Export and save the file somewhere. Choose Graphics/Pictures and click Import, choose the Book.png file that was previously saved, keep the default options in the import dialogue, and the book will appear under Graphics/Pictures.

Another way to get the picture to the right place is to export it directly to the game’s folder. When we created the project we set that folder, and it can be opened by choosing Games \ Open Game Folder. Instead of exporting and then importing into pictures we can export directly to {Game Folder}\Graphics\Pictures (where {Game Folder} means the game’s folder).

Now that we have the picture, let’s use it. Edit the cutscene event and as a first command add Show Picture. Now you can select Book and OK the dialogue. After the scrolling text command add an Erase Picture command (using the default value) and test the game.

I’m not sure that the text colour is precisely what I want. The text colour can be changed by entering \C[1] (or another number) before the text. It’s possible to see the list of colours by going to the Resource Manager, selecting Graphics/System and Window and clicking Preview. The colour squares at the bottom right are the colours that can be used. There are 32 of them, 8 per row, and their numbers start from 0. So the top row has colours 0 to 7, the second has colours 8 to 15 and so on. The black colour at the end of the second row is 15, so writing \C[15] at the start of the text will show the text in black.

Playing around with colours I didn’t find another one to my liking. However, there’s another problem that needs to be fixed: the event starts a little after the map loads, which means that we see the scene before the prologue text is shown. I want that text to be shown first thing. Luckily choosing Parallel Process for the trigger instead of Autorun solves this problem. The Parallel Process is actually meant to run alongside player input, but it seems to work fine in this context.

Okay, I think that’s enough content for this floor. At least, enough for me to describe here. I plan to include a couple more events on this floor in the full demo.

Going down

Before we go to add events to the bottom floor, we need a way for Eric to get there. Luckily that’s quite simple: just add a transfer event to the stairs.

So right click the stairs and choose Quick Event Creation \ Transfer.

2015-09-25 11_14_44-New Transfer EventClick on the ellipsis, select the first floor’s map, House CF1F, click on the space to the left of the stairs and OK the dialogue.2015-09-25 14_51_38-LocationSelect the Left direction in the New Transfer Event dialogue and okay it. This will make Eric face to the left after going down the stairs.

Now we can go down, but no, things are never that simple (with me). Eric went up to get his stuff, and I don’t want him to go down without it. So let’s make sure that doesn’t happen.

Edit the stairs’ event and add as a first command a Conditional Branch (page 1 under Flow Control, remember?). On the 4th tab select Weapon, select the short sword, and tick Include Equipments, which makes the check consider items which are equipped (such as Eric’s sword).2015-09-25 22_17_57-Conditional BranchMake sure that ‘Set handling when conditions do not apply’ is also checked, and OK the dialogue.

Cut and past the other commands (Play SE and Transfer Player) into the first part of the condition (before the else), so they’d happen if Eric does have the sword (and shield).

In the Else part, enter a text command with the text ‘I need to get my sword and shield first.’

(Note that this isn’t necessarily the perfect solution. It could be possible that Eric would lose his sword and then go to this map and try to get out, and he won’t be able to. That could be solved by setting a switch when the sword and shield are taken, which will be tested here. Given what I plan for this tutorial, I don’t feel that’s necessary.)

You can now test the game and get Eric to the bottom floor with his sword and shield equipped.

An NPC encounter

Eric can now go down, and frankly it’s about time he met someone. Took me so long to finish the other floor that I thought I’d almost have to postpone that to another post. So let me stop chatting and let’s get down to business.

There’s a girl in the house, just lounging in the lounge. Eric doesn’t know her, he doesn’t know why she’s there, but she’s standing there (because anything more complex is beyond our current understanding of RPG Maker), ready to be interacted with.

Her name is Brenda, she’s actor 006 in the database, and I picked her because she’s an archer and that appealed to me. Technically, she an event, like everything else.

So let’s add a Brenda-shaped event.

2015-09-25 22_44_09-Tutorial - RPG Maker VX AceFor the event’s Graphic pick the second set from Actor 5.

2015-09-25 22_47_21-GraphicAdd the following text commands:

Who are you? What are you doing in my

Oh, hello. I'm Brenda. I'm looking for a
knight to quest with.

And you break into people's homes for
this? What happened to inns?

Look, are you a good knight going on a
quest or not?

These are 4 different text commands, those marked with Eric will have his image (Actor 4, first image), those marked Brenda will have hers (Actor 5 second image).

Now it’s time to add some real meat, give the player a choice of how to respond.

2015-10-03 20_14_00-Show ChoicesAdd a Show Choices command with the choices: ‘I’m the incarnation of evil.’, ‘Well, yes.’ and ‘Yes, but you broke into my home.’

There are various ways to go about choices during dialogue. In general choice text is quite short, so (barring the use of scripts) when used in dialogue it’s either necessary to stick to short phrases or expand on them later.

In this case I’m using the choices as the text Eric is saying, and Brenda will then reply with further text. The first choice has Eric joking, the second shows a willingness to join Brenda, and the third means he doesn’t want to join her because of what she did.

I chose ‘disallow’ for When Cancel because I want the player to choose something. I put ‘I’m the incarnation of evil’ as the first choice simply because it’s likely to get more attention that way, and it’s the response that leads to most fun.

(To be continued. I hope to update this post at a later date with the full dialogue and then continue with other stuff in further posts.)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s