Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Eventing]How to Make Menu-like screens!, No scripting required!
Stern
post Jun 6 2011, 08:59 AM
Post #1


~Derpy Musician~
Group Icon

Group: Revolutionary
Posts: 278
Type: Musician
RM Skill: Undisclosed
Rev Points: 20




Hello everyone!
(Download Link)

This is a tutorial on how to make a custom menu-like system using nothing but events and pictures. I will try to explain everything in detail so that everyone will understand, no matter your skill level with events. If you're an advanced user you might just want to look at the pictures to get it.
For this tutorial, I'm going to assume that you already have basic knowledge about switches and variables.

List of Switches and Variables used.
S: 0001: Menu Allowed?
S: 0002: Menu Open?
V: 0001: Cursor Position

These are all the basic switches and variables needed. I recommend that you use the same names as I am, because I will be referring to them by name.


The first thing you will want to do is to make the pictures you want to use for your menu.
Here are the graphics I'm going to use for this tutorial. I made it very basic for the sake of keeping it simple.

[Show/Hide] Menu Preview
"


It is important that you separate Background, Content (menu items) and the cursor in different pictures. All the parts of this image are included in the example demo above. I've used the method of 1 picture per position for the cursor. You can use move picture if you like, but this tutorial won't be covering that.


When you're happy with how your menu looks it's time to move on to the next step; Common Events.


Common Events

For the menu to be accessible from any point in your game you'll want to make sure it's called from a common event. This is an easy way of doing it;

In this example I'm making this menu to replace the standard menu. Therefore it will be called using
the cancel button, B (Esc, X, Num 0). Other ways of doing it is to have it called from the menu to complement
the basic menu with more interesting features.

[Show/Hide] Common Event 001: Menu-Open-Close


[Show/Hide] Reference Picture


I've marked 1-7 in Red in the text. Just look at this picture if you're confused.


Make the first common event and call it whatever you want. I'm going with [001: Menu-Open-Close]
to make it simple. Set this common event's trigger as Parallel(1) with the condition switch set to: [0001: Menu Allowed?](2). This means that this event will be active as long as you have turned ON the switch [0001: Menu Allowed?] Now to the actual event!

We want to make sure the menu comes up only when you want it to so we need to add a conditional branch. Set this conditional branch to check if the script below was ran.(3)
CODE
Input.trigger?(Input::B)


This simply means it's checking if you are pressing your B-key (Again; Esc, X, Num 0).

Now that the event knows when you press B, you want it to do something when that button is pressed.
Before we get into that we will need another conditional branch. This conditional branch will be checking if the menu is already open or not and then act upon that (4). This conditional branch needs to be set to; If Switch [0002: Menu Open?] = OFF. Don't forget to tick the box called "Set handling when conditions do not apply", otherwise you will not be able to close your menu.
Now that all the conditional branches are properly set up all we need to do is set the cursor position and show the actual graphics for the menu.
(5)
  • To set the cursor position, simply set variable [0001: Cursor position] to 1. (I will explain why a bit further down in this tutorial.)
  • To show your graphics simply use the Show Picture command.


Now end this branch with turning ON the switch [0002: Menu Open?]
This is to let your common event know that the menu is open and next time you press escape it is to close the menu.

Now go to your second conditional branch and find the : else:(6). Under this you need to do the following;
(7)
Turn OFF the switch [0002: Menu Open?] - This will let your event know that the menu is no longer open.

You will also have to erase all the pictures used. The amount of pictures used may vary depending on how advanced your system is. In this case we are only using 3 pictures and therefore we only have to add:

Erase Picture: 1
Erase Picture: 2
Erase Picture: 3


You're now finished with the first common event. Two more to go!


[Show/Hide] Common Event 002: Menu-Graphics


[Show/Hide] Reference Picture


I've marked a-e in Red in the text. Just look at this picture if you're confused.


Now make the second common event. I called it Menu-Graphics.

Set the trigger to Parallel(a) and the Condition switch to [0002: Menu Open?]. (b)
In this event we will be controlling all the graphics that will change in the menu. With this simple menu it will only be controlling the cursor. Let's get started!

Start off by making a conditional branch with If Switch [0002: Menu Open?] is ON©. Make sure you don't forget to tick the box Set handling when conditions do not apply.

Allow me to explain how we'll be using the variable [0001: Cursor Position]

This variable will be controlled through the third common event and will essentially be the base for any keypresses made except for opening and closing the menu. The variable will have a value for each individual menu-item (Save,Exit, Option1, etc) Then the third common event will be registering keypresses depending on what value this variable has. Now let's get to it.

Inside your conditional branch you need to make one conditional branch per value of the variable [0001: Cursor Position] and also two extra branches to loop your cursor. I will explain more about this further down.

First we make one conditional branch per menu-item. In this case I've made 5 menu-items (d) (Option 1, Option 2, Option 3, Save, Exit). Set each branch to If variable [0001: Cursor Position] = X. Replace X with the number of the current menu-item.

In each branch we need to show the corresponding picture. So in branch number 1 you'll be displaying picture number one. In my case it looks like this;



The erase picture is necessary to erase any previously used cursor picture. Now repeat this procedure with all the menu-items you've made.


Now let's get to the "looping branches".(e) These will move the cursor back to the top if you go all the way down and vice versa.

Simply make a top branch that will check if the value of the variable [0001: Cursor Position] is less than 1. If it is, make the event move your cursor to the highest number in your menu. In this case it's 5. To do this simply set the variable to 5. Easy as that.

Now repeat the same procedure but make a branch that checks if the variable is more than 5. If it's more than five it will move to 1. By using the same command of course.


[Show/Hide] Common Event 003: Button-Presses


[Show/Hide] Reference Picture


I've marked I-IV in Red in the text. Just look at this picture if you're confused.



Now we're going to take a look at the third common event. I called it 003: Button Presses. This event will act upon the players key inputs. You want to be able to navigate properly in your menu, right? Let's start!

Set the event's trigger to Parallel(I) and the Condition Switch to [0002: Menu Open?].(II)

Now make a conditional Branch for each key input (III) , except open/close. I prefer having left and right scrolling up and down as well. So I'll be setting up the keys: Left, Right, Up Down and C. (C is the action button or confirm button if you like.)

Let's start with the directional arrows.

I want Down and Right to move my cursor down so here's the setup for them;


Make sure you add the Set Player Route: Wait 10 Frames. This will prevent your player from moving around while you're navigating the menu. It's important that you untick the box called "Wait for completion". Otherwise your whole menu will stop for 10 frames before it continues. Because we already have set up the graphics display in the previous event, this is all we need to do.

I do the exact same with Up and Left. The only difference is that instead of adding 1 to the variable
It will subtract. This will make my cursor go up.


Simple so far, right?
Now we need to decide what happens when we press C (Enter, Space, Z), for each menu item.

First make sure the event knows that we're pressing C by using the same script as I've mentioned above.
Make a conditional branch with the script;
CODE
Input.trigger?(Input::C)
(IV)

Now inside this branch we add another branch for each Menu option we have.
Currently I have nothing In my option 1-3 so I will just have the game give off a buzzer sound effect when those are pressed.

Let's take a closer look at the Save and Exit commands. When my cursor variable is at 4 and I press enter, I will open the save screen. When it's 5, I will return to title screen. It's pretty simple.


In this case it's a very simple event, however if you're planning on taking this a bit further, this particular
Event will be a bit of a hassle to set up. I will explain that in the next part of this tutorial.



Now the important thing you need to do for this to work in your game, is to disable menu access and enable the switch [0001: Menu Allowed?]

If you have any questions, fire away! :)

I hope this helps or inspires at least someone :)

This post has been edited by Stern: Jun 7 2011, 05:40 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Stern
post Jun 6 2011, 09:10 AM
Post #2


~Derpy Musician~
Group Icon

Group: Revolutionary
Posts: 278
Type: Musician
RM Skill: Undisclosed
Rev Points: 20




Why would you want to use this system when the standard system is available? You might ask.

There's several reasons and it all depends on what your game needs. The eventing tools are powerful if you know how to use them
and there are many ways this can be used. I'll show a few examples of common usages.


In this first example I'll show how you can make an interface for a Dragon Age: Origins-Inspired system where you can engage in conversation with your party and how you can control their mood and standings with you.

Example 1: Party Interactions

DISCLAIMER: This example is a bit more advanced than the basic menu and therefore I will only go into what and why I've done and not how. If you're having troubles grasping how the menu works I don't recommend bothering with this just yet. Also, In this explanation I will assume that you've read the above tutorial for the basic menu layout and that you understand the basic concept of how it works.

Let's get started!

I will first list all the common events, switches and variables we will be looking at.

List
Common Events
C: 001: Menu-Open-Close - We will be doing some changes to this.
C: 002: Menu-Graphics - We will be doing some changes to this.
C: 003: Button-Presses - We will be doing some changes to this.
C: 006: Chat-Menu-Display - To show standings and moods
C: 007: Dialogues-Ulrika - Dialogue options
C: 008: Dialogues-Bennet - Dialogue options
C: 009: Dialogues-Ylva - Dialogue options

Switches
S: 0003: Chat-With-Party - This switch decides which menu you'll be in. If it's ON, you're viewing the Party Interaction Screen.
S: 0004: Chat-With-Ulrika - This switch triggers the conversation with Ulrika
S: 0005: Chat-With-Bennet - This switch triggers the conversation with Bennet
S: 0006: Chat-With-Ylva - This switch triggers the conversation with Ylva

Variables
V: 0001: Cursor Position - Again!
V: 0002: Ulrika-Mood - This variable is used to store the value of Ulrika's mood
V: 0003: Ulrika-Standing - This variable is used to store the value of Ulrika's standing
V: 0004: Bennet-Mood - This variable is used to store the value of Bennet's mood
V: 0005: Bennet-Standing - This variable is used to store the value of Bennet's standing
V: 0006: Ylva-Mood - This variable is used to store the value of Ylva's mood
V: 0007: Ylva-Standing - This variable is used to store the value of Ylva's standing


You'll notice that I listed the first 3 Common Events here as well. These events will need some modifications. Let's start with 001: Menu-Open-Close.

Common Event 001: Menu-Open-Close

Reference Picture


Just by looking at this picture you might already have spotted what I have edited. I've added one more conditional branch that checks if you're in the "Party Interaction Menu". I also added what happens if you press ESC if you are indeed in the party window. In this case, pressing escape will take you back to the main menu. Not much else have been changed.


Common Event 002: Menu-Graphics

Reference Picture


Here you can see that I've basically done the same thing as I did in common event 001: Menu-Open-Close. I've added an additional conditional branch that checks if the player is viewing the "Party interaction menu" or the standard menu. If the player is viewing the party menu, the cursor will behave sligthly different. This is because this menu doesn't have as many choices as the main menu.


Common Event 003: Button-Presses

Reference Picture


Start looking at the red line. You can see that yet again I've done the same thing. A conditional branch that checks if I'm viewing the "party interaction menu" or not. If I am, all my C-presses (Enter, X, Numpad) will be registered differently. In this case the top 3 will engage you in conversation with your various party members.
If you select the 4th option, it will bring you back to the initial menu.

We also need to make your 2nd Menu reachable. So I've changed conditional branch with Cursor position = 1. It will turn on the switch [0003: Chat-With-Party].
That's about all of the changes to this event. Now let's take a look at the next one!


Common Event 006: Chat-Menu-Display

Reference Picture


If you look at this picture you probably realize that this event is strangely similar to event 002. This is because it does the same thing. It only shows graphics. The difference here is that it shows graphics depending on the other variables that I mentioned at the top of this post. (V: 0002 - 0006)


Common Events 006 - 009: Dialogues

Reference Picture


In these 3 events you can really put what you want, because these are just the actual dialogues. To show the functionality of this system I've made each character state their mood and standing. This is simply to show that there are an option to display a message for every mood and standing that you've added. Obviously you'd want to write some actual dialogue in your own game.

(Download Link)

Example 2 - Journal - Will be written later.

This post has been edited by Stern: Jun 7 2011, 05:32 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Celianna
post Jun 6 2011, 08:27 PM
Post #3


Level 3
Group Icon

Group: Member
Posts: 35
Type: Artist
RM Skill: Skilled




Pretty good explanation, I like it when people event their own menus and stuff. Glad to see you paid attention to the looping part, I hate it when I get to the bottom of something, and it won't automatically go up when I go all the way down.

Anyways, just two little nitpicks:

QUOTE
The erase picture is necessary to erase any previously used cursor picture.


That's not really true, only for when you're exiting the menu and you need to erase all pictures. If you have a picture on screen, with an ID of 3, you don't need to erase it before showing a different picture using the same ID. It will simply replace the picture with ID 3 even without using the erase picture command.

As for restricting the player's movement, all you need to do is add a common event and set it to autorun. Add a wait command in there if your game starts to lag a bit, but there's no need to use the set move route to make the player wait. All autoruns restrict player movement, but still allow button input. In fact, just making one of your parallel common events for the menu set to autorun will eliminate the entire player restriction problem.
Go to the top of the page
 
+Quote Post
   
Stern
post Jun 6 2011, 10:42 PM
Post #4


~Derpy Musician~
Group Icon

Group: Revolutionary
Posts: 278
Type: Musician
RM Skill: Undisclosed
Rev Points: 20




Thanks for the input! ;D

QUOTE (Celianna)
As for restricting the player's movement, all you need to do is add a common event and set it to autorun. Add a wait command in there if your game starts to lag a bit, but there's no need to use the set move route to make the player wait. All autoruns restrict player movement, but still allow button input. In fact, just making one of your parallel common events for the menu set to autorun will eliminate the entire player restriction problem.


I hadn't actually tried it using an autorun common event before so I wasn't sure that'd work, because of different uses of the menu system. Since the previous method I used worked I didn't bother trying it either. You're right though, it's easier and I've updated the tutorial to reflect the change.

EDIT: The autorun event which limits the player movement conflicts with the autorun event for dialogues. This makes the dialogues unable to appear. See post 2 for examples. Now I remember why I didn't use it to begin with happy.gif. Changing the limit-movement to a more smoother method. Adding it under 002: Button-Presses.

As for the erase picture, I guess that's just something I always do to make sure nothing goes wrong wink.gif

This post has been edited by Stern: Jun 7 2011, 05:54 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Helskyth
post Jun 10 2011, 11:02 PM
Post #5


Level 3
Group Icon

Group: Member
Posts: 39
Type: Developer
RM Skill: Intermediate




I like that Dialogue variable system you have there. smile.gif

I had plans later when adding extra's to the game to have random NPC's give out different dialogue based on game progression and your party members. This has actually made it look more simpler to do than I'd anticipated.


__________________________



My Deviant Art
My Youtube

~Rock Hard - Dead or Alive~

Other items

Perfect World International character accounts (last active in game in April)

Go to the top of the page
 
+Quote Post
   
banditred1
post Jul 16 2011, 01:37 AM
Post #6


Level 4
Group Icon

Group: Member
Posts: 53
Type: Event Designer
RM Skill: Skilled




This is really creative smile.gif This really shows the flexibility of RPG maker. I'll be sure to try it out in future games biggrin.gif
Nice job! wink.gif


__________________________
Recruiting for my project ~Luna RPG~
Mappers Writers and Spriters needed!

Check out my youtube channel for RMVX and RMXP Tutorials :D http://www.youtube.com/user/banditred2/

Skills=
RPG Maker VX-
Eventing: Highly Skilled
Mapping: Skilled
Music: Average

RPG Maker XP-
Eventing: Skilled
Mapping: Average
Music: Average

Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 02:54 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker