Quote: Morpheus: Ever wonder how many losls it takes to...
blade2k » articles & tutorials

jump to:
Tutorials » Game Creation » RPG Maker 2000

Sub-CMS Tutorial


Reading Article
Author: Neo
Posted on 08/02/2004
print :: back to list

S

ub-CMS Tutorial- By Neo



Sub-Custom Menu System Tutorial | Advanced - Neo862k, Neo-Glitch


--------------------------------------------------------------------------------
Table Of Contents:
| Purpose
| Requirements
| Programming
| Additions
| Conclusion
| Legal


--------------------------------------------------------------------------------
| Purpose
--------------------------------------------------------------------------------
The purpose of this tutorial is for Advanced RM2K Programmers, that know how to use variables, and Fork Conditions, and Switches, but don't know how to start in making a Sub-Custom Menu System. The programming in this tutorial is alot shorter, and easier to add to, but is confusing if you don't have the advanced understanding of all of the commands.


--------------------------------------------------------------------------------
| Requirements
--------------------------------------------------------------------------------
You have to have an advanced understanding of Variables, Switches, Fork Conditions, Pictures, and most of the commands in RM2K. You will need:

A picture of the cursor

A picture of the menu

Here is the lay-out of the menu in this tutorial:
Main Menu

Save Menu

Quit Menu

It is extremely encouraged to have the spacing for the menu selections spaced equally apart. A good distance is 8, 12, or 16 pixels apart. This will make the coding much simplier, and if not, then it is advised to use the other guide, as you set where the cursor goes.


--------------------------------------------------------------------------------
| Programming

--------------------------------------------------------------------------------
Alright, first, you need to make a common event, and set it to parallel process. Name the event: "Menu System"

Disable the Menu

Disable the Save Menu

Enter Password into a varable [S-CMS], and only select the escape key, and wait until key pressed.

Fork Condition, If variable [S-CMS] is equal to 6, then:

Show Picture 1, the Menu.

Move Event: Hero, Wait

Set Screen Tone: 75, 75, 75, 75.
Here, your going to have to use trial and error to determine what the coordinates for your menu selections are. Find the one for the very top on.

Change Variable: [CMS Cursor X] equal to the X coordinate for the top selection.

Change Variable: [CMS Cursor Y] equal to the Y coordinate for the top selection.

Make a Cycle Command after the Fork Condition End case.

Show Picture 2, the Cursor, Coordinate X is set to Variable [CMS Cursor X], and Coordinate Y is set to Variable [CMS Cursor Y].

Enter Password into a variable [S-CMS Cursor], with the direction, decision, and escape keys selected, and wait until key pressed.

Fork Condition: [S-CMS Cursor] is equal to 1 then:
Here, you have to find the coordinates for the bottom menu selection, and find out what the Y coordinate is equal to.

Fork Condition (With Else Case): [CMS Cursor Y] is equal to the Y coordinate for the bottom menu selection then:

Change Variable [CMS Cursor Y] equal to the Y coordinate for the top menu selection.

Else Case: Change Variable [CMS Cursor Y] add X, where X is the distance between the selections, like 16, or 8.
After the End Case for the Fork Condition that [S-CMS Cursor] is equal to 1, and add:

Fork Condition: [S-CMS Cursor] is equal to 4 then:

Fork Condition (With Else Case): [S-CMS Cursor] is equal to the Y coordinate for the top menu selection then:

Change Variable [CMS Cursor Y] equal to the Y coordinate for the bottom menu selection.

Else Case: Change Variable [CMS Cursor Y] subtract X, where X is the distance between the selections.
After the End Case for the Fork Condition that [S-CMS Cursor] is equal to 4, and add:

Fork Condition: [S-CMS Cursor] is equal to 5, then:

Fork Condition: [CMS Cursor Y] is equal to the top menu selection, then:

Erase Picture 1

Erase Picture 2

Call System Menu

Set Screen Tone: 100, 100, 100, 100.

Move Event: Hero

Break Cycle
After the End Case for the Fork Condition: [CMS Cursor Y] is equal to the top menu selection, add:

Fork Condition: [CMS Cursor Y] is equal to the middle menu selection, then:

Erase Picture 1

Erase Picture 2

Call Save Menu

Set Screen Tone: 100, 100, 100, 100.

Move Event: Hero

Break Cycle
After the End Case for the Fork Condition: [CMS Cursor Y] is equal to the middle menu selection, add:

Fork Condition: [CMS Cursor Y] is equal to the bottom menu selection, then:

Erase Picture 2

Show Message: "Quit:"

Show Choice: [Yes]/[No]

Yes Case: Goto Title Screen

Break Cycle.

No Case: Erase Picture 1

Set Screen Tone: 100, 100, 100, 100.

Move Event: Hero

Break Cycle
After the End Case for the Fork Condition: [S-CMS Cursor] is equal to 5, then add:

Fork Condition: [S-CMS Cursor] is equal to 6, then add:

Erase Picture 1

Erase Picture 2

Set Screen Tone: 100, 100, 100, 100.

Move Event: Hero

Break Cycle

That is it. Here is what is will look like in the Common Event DataBase:
TTT- Coordinate for Top Menu Selection
MMM- Coordinate for Middle Menu Selection
BBB- Coordinate for Bottom Menu Selection
DDD- Distance between Menu Selections

Disable System Menu: Disable
Disable Save: Disable
Enter Password: [XXXX: S-CMS]
FORK Optn: Varbl[XXXX:S-CMS]-6
Show Picture: 1, Menu, (XXX,YYY)
Move Event...: Hero , Wait
Set Screen Ton:(R075,G075,B075,S075),0.1sec(W)
Variable Ch:[XXXX:CMS Cursor X] Set, TTT
Variable Ch:[YYYY:CMS Cursor Y] Set, YYY

END Case
CYCLE
Show Picture: 2, Cursor, (V[XXXX],V[YYYY])
Enter Password: [XXXX:S-CMS Cursor]
FORK Optn: Varbl[XXXX:S-CMS Cursor]-1
FORK Optn: Varbl[XXXX:S-CMS Cursor Y]-BBB
Variable Ch:[XXXX:S-CMS Cursor Y] Set, TTT

ELSE Case
Variable Ch:[XXXX:S-CMS Cursor Y]+ , DDD

END Case

END Case
FORK Optn:Varbl[XXXX:S-CMS Cursor]-4
FORK Optn:Varbl[XXXX:S-CMS Cursor Y]-TTT
Variable Ch:[XXXX:S-SCMS Cursor Y] Set, BBB

ELSE Case
Variable Ch:[XXXX:S-CMS Cursor Y] - , DDD

END Case

END Case
FORK Optn:Varbl[XXXX:S-CMS Cursor]-5
FORK Optn:Varbl[XXXX:S-CMS Cursor Y]-TTT
Erase Picture : 1
Erase Picture : 2
Call System Menu
Set Screen Tone:(R100, G100, B100, S100),0.1sec(W)
Move Event... : Hero
BREAK Cycle

END Case
FORK Optn:Varbl[XXXX:S-CMS Cursor Y]-MMM
Erase Picture : 1
Erase Picture : 2
Call Save Menu
Set Screen Tone:(R100, G100, B100, S100),0.1sec(W)
Move Event... : Hero
BREAK Cycle

END Case
FORK Optn:Varbl[XXXX:S-CMS Y]-BBB
Erase Picture : 2
Show Choice: Yes/No
[Yes] Case
Goto Title Screen
BREAK Cycle

[No] Case
Erase Picture : 1
Call System Menu
Set Screen Tone:(R100, G100, B100, S100),0.1sec(W)
Move Event... : Hero
BREAK Cycle

END Case

END Case

END Case
FORK Optn:Varbl[XXXX:S-CMS Cursor]-6
Erase Picture : 1
Erase Picture : 2
Call System Menu
Set Screen Tone:(R100, G100, B100, S100),0.1sec(W)
Move Event... : Hero
BREAK Cycle

END Case

END Cycle




--------------------------------------------------------------------------------
|Additions
--------------------------------------------------------------------------------
To make room for additions, just add the menu selection onto the menu, at the same distance as the others, and then adjust the coordinates accordingly, and adjust the coordinates for the Up, and Down max postition. Then for the Enter Key, get the coordinates for it, and then input the event you want to happen.


--------------------------------------------------------------------------------
|Conclusion
--------------------------------------------------------------------------------
I wrote this guide, because it can be a burden for advanced RM2K users to input the S-CMS Tutorial for Begginers, because they already know the commands, and this guide leaves more room for additions, and simplifies the coding greatly. I hope that this guide has helped all that have read and applied it. For any feedback, email me at Neo862k@aol.com.


--------------------------------------------------------------------------------
|Legal
--------------------------------------------------------------------------------
As the author of this tutorial, I hold all rights to it, and the power to enforce upon the maximum legal punishment for plagerism, or other right violitions of this document, or that of likeness. I entrust the reader with the ability to use this tutorial, and to print it out, as long as there is no profit, and that it is printed in its entireness. The current websites with the ability to contain this tutorial are:
Black Rainbow | http://www.blackrainbowrpg.cjb.net


© 2002; Josh Smith (AKA Neo)