coyotecraft
Sponsor
Intro:
Needless to say, most people stick to using the default menu in the projects.
You could script a CMS. But there aren't many tutorials on how to script a CMS, you just
plug in one thats already made and you don't learn anything from it. In the past people
created CMS using events, but now people use scripts to do theses types of things. I guess
the knowledge was never passed on to the new generation. I'm writing this tutorial to show
you how to make a menu using events, and maybe you can take what you learn and expand on it.
Demo to follow along: Here
I made this for another project that someone else is making. But I felt people could benefit from it if I made a tutorial. This is the first tutorial I've made so let me know if some parts are hard to follow. There is more on the Demo that isn't covered here.
Needless to say, most people stick to using the default menu in the projects.
You could script a CMS. But there aren't many tutorials on how to script a CMS, you just
plug in one thats already made and you don't learn anything from it. In the past people
created CMS using events, but now people use scripts to do theses types of things. I guess
the knowledge was never passed on to the new generation. I'm writing this tutorial to show
you how to make a menu using events, and maybe you can take what you learn and expand on it.
http://i143.photobucket.com/albums/r134/coyotecraft/LvHPTPmockup.png[/img]
I made this for another project that someone else is making. But I felt people could benefit from it if I made a tutorial. This is the first tutorial I've made so let me know if some parts are hard to follow. There is more on the Demo that isn't covered here.
In this method the menu is actually a map. So you need to be able to go between
those maps at a touch of a button. First you need to create 2 maps. One its the field and the other
is the menu. Create a common event "Call menu" and set 3 variables
1: "X map" set equal to Players X map possision
2: "Y map" set equal to Players Y map possision
3: "Map ID" Set equal the the Maps ID
then teleport character to the Menu Map
http://i143.photobucket.com/albums/r134 ... llmenu.png[/img]
On the Field map Create a event (parallel process) that disables the menu (you won't be using the Default)
And add a condional brach "when ever B button is pressed" Call common event "Call menu".
For some reason "B" is actually "X/esc" in rmxp. In fact all the button letters are not correctly set to the letters on the key board.
I've gone throu and found what buttons the letters actually go to.
RMXP=>Keyboard
a=z
b=x
c=c
x=a
y=s
z=d
l=q
r=w
On the menu map create a event (parallel process) and Call is "Inputs". Enter a condional branch "When B button is pressed" teleport the character with "appoint with variables"
Map Id, X pos, and y pos are saved in the variables made in the common event and will transfer the character back to where they were.
http://i143.photobucket.com/albums/r134 ... leport.png[/img]
Try a test run to make sure you've set everything up properly.
When you press x/esc you should be transported to the menu map. Press x/esc again to go back.
those maps at a touch of a button. First you need to create 2 maps. One its the field and the other
is the menu. Create a common event "Call menu" and set 3 variables
1: "X map" set equal to Players X map possision
2: "Y map" set equal to Players Y map possision
3: "Map ID" Set equal the the Maps ID
then teleport character to the Menu Map
http://i143.photobucket.com/albums/r134 ... llmenu.png[/img]
On the Field map Create a event (parallel process) that disables the menu (you won't be using the Default)
And add a condional brach "when ever B button is pressed" Call common event "Call menu".
For some reason "B" is actually "X/esc" in rmxp. In fact all the button letters are not correctly set to the letters on the key board.
I've gone throu and found what buttons the letters actually go to.
RMXP=>Keyboard
a=z
b=x
c=c
x=a
y=s
z=d
l=q
r=w
On the menu map create a event (parallel process) and Call is "Inputs". Enter a condional branch "When B button is pressed" teleport the character with "appoint with variables"
Map Id, X pos, and y pos are saved in the variables made in the common event and will transfer the character back to where they were.
http://i143.photobucket.com/albums/r134 ... leport.png[/img]
Try a test run to make sure you've set everything up properly.
When you press x/esc you should be transported to the menu map. Press x/esc again to go back.
You'll have to make your own graphics for this part. But thats the best part, you can make it look any way you want.
Because the menu is a map when the player is teleported the characterset remains the same. You could set the players characterset invisible in the
common event "call menu" and change is back when you exit the menu. Or you can use the character as a cursor to interacte with the menu.
In this example the player is set to invisible. And the Menu graphics are panorama with a blank tileset.
Create events for each option on the menu. Goto the common event "Call menu" and add variable "menu count" set equal to 1.
Each option is going to have a number. Since "Items" is at the top it will be 1, the next option will be 2 and so on...
Goto the event you created for Items add a condional brach "If variable "menu count" = 1 Change this event graphic to cursor, If not set Graphic to none.
Do this for every event you made for the menu options only change the "menu count" = # to the number you assigned that option.
For example: The save option is the fifth on the list so it will only change it's graphic if "menu count"=5
http://i143.photobucket.com/albums/r134 ... ucount.png[/img]
GO to the event "Inputs" you created earlier and add conidional branches "when up button is pressed" -1 to "menu count" and "When down button is pressed" +1 to "menu count"
Now when you are on the menu map and press up or down, the events made for each graphic will turn on and off when the "menu count" = their number.
Addionaly you need to set caps on the menu count. If "menu count"< or = to 0 set to 5 and if "menu count">5 set to 1
This was the cousor is loop back around.
You'll want to add Wait 2 frames after + or - the menu count because its very sensative to the key pad and by the time you lift your finger off the button
it +\- the menu count so fast who knows what number it will be on.
http://i143.photobucket.com/albums/r134 ... arrows.png[/img]
NOTE: I've also added left and right arrows that toggle between characters and their stats in a similar way the menu toggles though options. I'll get to how
I made the stats and numbers to appear later.
Because the menu is a map when the player is teleported the characterset remains the same. You could set the players characterset invisible in the
common event "call menu" and change is back when you exit the menu. Or you can use the character as a cursor to interacte with the menu.
In this example the player is set to invisible. And the Menu graphics are panorama with a blank tileset.
Create events for each option on the menu. Goto the common event "Call menu" and add variable "menu count" set equal to 1.
Each option is going to have a number. Since "Items" is at the top it will be 1, the next option will be 2 and so on...
Goto the event you created for Items add a condional brach "If variable "menu count" = 1 Change this event graphic to cursor, If not set Graphic to none.
Do this for every event you made for the menu options only change the "menu count" = # to the number you assigned that option.
For example: The save option is the fifth on the list so it will only change it's graphic if "menu count"=5
http://i143.photobucket.com/albums/r134 ... ucount.png[/img]
GO to the event "Inputs" you created earlier and add conidional branches "when up button is pressed" -1 to "menu count" and "When down button is pressed" +1 to "menu count"
Now when you are on the menu map and press up or down, the events made for each graphic will turn on and off when the "menu count" = their number.
Addionaly you need to set caps on the menu count. If "menu count"< or = to 0 set to 5 and if "menu count">5 set to 1
This was the cousor is loop back around.
You'll want to add Wait 2 frames after + or - the menu count because its very sensative to the key pad and by the time you lift your finger off the button
it +\- the menu count so fast who knows what number it will be on.
http://i143.photobucket.com/albums/r134 ... arrows.png[/img]
NOTE: I've also added left and right arrows that toggle between characters and their stats in a similar way the menu toggles though options. I'll get to how
I made the stats and numbers to appear later.
This part can seem complected because it involves math and a lot of copying and pasting. It's easy to slip up and get errors here.
Create a common event for each of the character's Lv,HP,and MP. First you need to create a variable set equal to each of the character's lv/hp/mp.From now on I'll stick with just displaying HP.
In my demo, the numbers are actually just pictures of numbers. You could use charactersets to display numbers but unless you do a little scripting you can't change the spacing between letters and are limited to where they go on screen.
The event takes the variable set equal the the character's HP and divides it into 4 new variables: thousands,hundreds,tens and ones.
I'm going to direct you to RpgMakerMaster's thread on how to do this, Look under Modulo, here
Using conditional branches you display the number thats in the thousands/hundreds/tens/ones with the corrisponding picture of that number.
So if the number in the ones unit is 9 you display the picture of 9.http://i143.photobucket.com/albums/r134 ... ndions.png[/img]
Some things to remember when displaying pictures. Every picture displayed is labeled a different number. You can't display more then one picture with the same number. In the example picture, the picture number for the ten's unit is 33.
In my demo, Instead of manually setting each picture a "x" and "y" position on screen I assign a group of number's x and y positions to variables.http://i143.photobucket.com/albums/r134 ... icture.png[/img] So if I want to go back and change where on the screen the numbers are displayed I don't have to go back through every "show picture" for every number for every unit! and change the x and y coordinates. Instead I just change the variable that they are all assign too and can easily change the spacing between them
http://i143.photobucket.com/albums/r134 ... berpos.png[/img]
Its also a good Idea to space things out with comments so if you ever need to go back you'll know what you are looking at you how far down the page you'll need to scroll.
Yes, the pages do get very long. But like I said earlier you could use charactersets on the menu map and change their graphic with the variables instead of setting up a long list of pictures and messing with screen X and Y positions.
Create a common event for each of the character's Lv,HP,and MP. First you need to create a variable set equal to each of the character's lv/hp/mp.From now on I'll stick with just displaying HP.
In my demo, the numbers are actually just pictures of numbers. You could use charactersets to display numbers but unless you do a little scripting you can't change the spacing between letters and are limited to where they go on screen.
The event takes the variable set equal the the character's HP and divides it into 4 new variables: thousands,hundreds,tens and ones.
I'm going to direct you to RpgMakerMaster's thread on how to do this, Look under Modulo, here
Using conditional branches you display the number thats in the thousands/hundreds/tens/ones with the corrisponding picture of that number.
So if the number in the ones unit is 9 you display the picture of 9.http://i143.photobucket.com/albums/r134 ... ndions.png[/img]
Some things to remember when displaying pictures. Every picture displayed is labeled a different number. You can't display more then one picture with the same number. In the example picture, the picture number for the ten's unit is 33.
In my demo, Instead of manually setting each picture a "x" and "y" position on screen I assign a group of number's x and y positions to variables.http://i143.photobucket.com/albums/r134 ... icture.png[/img] So if I want to go back and change where on the screen the numbers are displayed I don't have to go back through every "show picture" for every number for every unit! and change the x and y coordinates. Instead I just change the variable that they are all assign too and can easily change the spacing between them
http://i143.photobucket.com/albums/r134 ... berpos.png[/img]
Its also a good Idea to space things out with comments so if you ever need to go back you'll know what you are looking at you how far down the page you'll need to scroll.
Yes, the pages do get very long. But like I said earlier you could use charactersets on the menu map and change their graphic with the variables instead of setting up a long list of pictures and messing with screen X and Y positions.
cooming soon
cooming soon