Creating a SNES RPG style name creation screen
Author: | cake
|
Submitted: | 10th November, 2003
|
Views: | 5913
| Rated: |
|
|
MMF Only i *think*
This was created in response to the question on the boards. Basically if you've ever played Zelda on SNES or any RPG on SNES really you will know the screen with a grid of letters and numbers and you move a box around over the characters to create your name. Here's how to do it in 9 events .
OBJECTS:
You need -
* 3 counters, called say "CursorX" and "CursorY" and a third counter called something like "CharControl"
* 2 string objects, one which will store all the character data called "sTemp" for example, on one to show the name called
"sName" for example
* 1 active object to act as the selector box that the player moves around, say called "actSelector"
sTemp is going to store your character data, so it will need to look something like this:
abcdefghijklmnopqrstuvwxyz123456789! .#%
<]Note: the # and % characters arent actually going to be used, they represent the "Backspace" and "End" buttons,
respectively.The backspace button isnt really required, you could have the user presses fire button 2 to backspace[>
Set up your screen with the letters and characters and End and Space and <- and all the other typical SNES things into an
even grid, for this i recommend go into Cnc/TGF/MMF preferences and set your grid size to however big the letter blocks are
(for example 32x32, or 24x24, which is what I would recommend). Make sure you have a REGULAR grid pattern, that is, each row
has a specific number of characters in it, like 10. The last row does not need to conform to this convention.
EVENTS:
-=[Navigational]=-
You need to create navigational events to move your selector object around.
* player 1 pressed left, CursorX > 0:
set CursorX to CursorX - 1
* player 1 pressed right, CursorX < <number of characters in a row - 1>:
set CursorX to CursorX + 1
* player 1 pressed up, CursorY > 0:
set CursorY to CursorY - 1
* player 1 pressed down, CursorY < <number of rows>:
set CursorY to CursorY + 1
* Always:
set X position of actSelector to CursorX * <Width of characters (ie 32, or 24, etc)>
set Y position of actSelector to CursorY * <height of characters (should be same as width, unless you didnt make the
characters square)>
-=[Characters]=-
Now to configure character selection
* Always:
set CharControl to ((CursorY * <number of characters in a row (10 for example)> + CursorX)
set Alterable string of sTemp to <Get middle substring(<text of paragraph number 1 of sTemp>, Value of CharControl, 1)
-=[Name Entry]=-
Finally to set up adding and removing characters to the name string. For backspace you could replace the conditions with
"player 1 pressed fire button 2" if you want to.
//Add character
* player 1 pressed fire button 1, Alterable string of sTemp <> "#", Alterable string of sTemp <> "%":
set alterable string of sName to <alterable string of sName> + <alterable string of sTemp>
display alterable string for sName
//Backspace
* player 1 pressed fire button 1, Alterable string of sTemp = "#":
set alterable string of sName to <Get left substring(<alterable string of sName>, <length of alterable string of sName> -
1)
display alterable string for sName
//Complete/End
* player 1 pressed fire button 1, Alterable string of sTemp = "%":
<whatever, play sound, write name to INI file for later use, jump to desired frame, etc>
>End of Document<
|
|
cake
Registered 13/12/2002
Points 1173
|