If you want to get the most out of RPG Maker, learn Ruby. In the meantime, lots of talented scripters have done the work for you. Every Friday, The Iron Shoe features a fun script and goes into detail about how to use it. It also covers a little bit of Ruby each time so you can make even more out of the script.
This week we look at another Yanfly script – the Menu Engine! After exploring its use a bit, I’ll show you how I’m using it in Vidar.
Grab the script, install it, and let’s make an awesome menu.
What It Does
The menu manager lets you do two very important things: change the look of your menus, and change the contents of your main menu.
One of the fastest ways to identify an RPG Maker game is to open the menu. They all look the same unless some work has been done, and this is the fastest way to give your game a fresh look. At the top of the script, you’ll see a few variables you can change.
“HELP_WINDOW_LOCATION ” set this to put the help window in your menus at the top, middle, or bottom
“COMMAND_WINDOW_ALIGN” you can’t move the command window itself, but you can determine how the text inside it is aligned.
“MAIN_MENU_ALIGN” text alignment for the main menu
“MAIN_MENU_RIGHT” move the menu around on your screen!
“MAIN_MENU_ROWS” eliminates that extra space at the bottom of
Changing the location of things is quite simple!
We can also add and remove commands to our main menu (shown above). By default, RPG Maker gives us:
- Game End
Some of these may not apply to our game, and it’s a simple matter of deleting them in Yanfly’s script. But we can also add our own unique entries that call a common event. Look for this area of the script, around line 121:
Those two “events” are just demos. What you need is this: an event name (preceded by a : ), an arrow, and a bracketed list of 4 things. Those 4 things, in order, are the name to show in your menu, an enable switch, a show switch, and the common event to call.
What are enable and show switches? Here you supply a switch id (you know, the number next to a switch in your Big List of Switches). If the switch in the show switch slot is ON, the item will show up in your menu, otherwise it won’t. If the switch in the enable switch slot is ON, the player can use the menu item, otherwise it will be grayed out. Don’t want to bother with these functions? Just set the ID to 0.
About 6 weeks ago, I released a demo of Vidar which was roughly the first fifth of the game, although without many puzzle options. In that demo, I included puzzles which use a concept I’m currently calling Purple Ice – a normal ice tile which breaks when you pass over it. This adds an extra challenge, forcing the player to use certain tiles only once, and anticipate when they’d need them. But what happens when they failed? Not only would I need to reset them at the entrance (which is handled in every ice puzzle), the purple tiles would have to be reset.
For the demo, I put together a reset funciton I made in about 30 minutes. Predictably, it broke often and made the later portion of the demo nearly unplayable.
The past few days have been spent making the reset function more robust. First, each option now keeps track of its own reset function, which gives me more adaptability going forward into the other biomes.
Second, and more important to the topic of this post, I’m using Yanfly’s Menu to build my own menu. I don’t need most of RPG Maker’s defaults, so those have been removed, and in their place, I’ve added a reset function.
The menu item only shows up at all once you’ve reached puzzle 7, when you receive a short note about resetting a puzzle in case you get stuck. It’s only enabled if the “Reset Available” switch is on – in sidequest caves, and in the town, it’s disabled and grayed out. And it calls a common event.
The common event prompts the player with a confirmation screen, and if the player chooses yes, reset is finally called.
How I get from there to the puzzle option is a little gross right now, and is perhaps best saved for another dev blog post once I’ve fleshed it all out.