|Editing the battle command menu|
|Click here for more tutorials!|
This tutorial has not yet been completed.
This tutorial describes how to edit the positioning of the "Fight", "Bag", "Pokémon" and "Run" commands in the battle screen. There are three levels to this: swapping the commands around, moving them all the same amount, and creating a completely new command menu. The tutorial also describes how to restrict the use of certain commands, or add in new ones.
Swapping the commands around
PokeBattle_ActualScene is where it's at (as usual). Firstly, find a def called
pbCommandMenu. That lists all the menu options. You'll be swapping them around, but not yet!
Instead, look up a bit at the def
pbCommandMenuEx. In there you'll see two instances of the number sequence [0,2,1,3] - this is the order the commands are positioned in. 0 is "Fight", 2 is "Bag", etc., and the order is top left, top right, bottom left, bottom right. Swap the numbers around here to swap the options around. Now you can swap the command options from above around as well, so make sure you swap them in the same way as you did the numbers. The list of commands changes where the text is placed, while the numbers change what happens when you click on one (they're not linked together, so you could end up with a menu where you click "Bag" but end up running away).
Moving the command box around
The commands can be shifted around as a whole by editing the coordinates of the command box (highlighted below) at the top of the class
The other two numbers are the size of the command box, and shouldn't be changed.
Requires use of the "commandbox" graphic.
Let's assume, now, that you wanted a way to freely position each command (e.g. put them all in a line, or in a <> shape, or whatever). Unfortunately, you can't do this (not easily, anyway). The positioning is done by the class
Window_CommandPokemon (in SpriteWindow), but the fight screen also uses this (as do the menus in the party screen, and the confirmation yes/no message box, and lots of other things throughout the game). So you can't simply edit that class to make it look how you want.
However, there is an alternative. You have the class
CommandMenuDisplay to work with (very top of PokeBattle_ActualScene). What you can cunningly do is move the existing commands window off-screen, and draw some other stuff instead. The cunning part lies in making sure the graphics refresh themselves properly (see the end of that class for the
But wait. Even if you do this, you'll still be restricted to the four corner design of the original command window, i.e. you can only go right and down from the "Fight" option, etc. Surely this limits how creative you can be? Actually, no (and don't call me Shirley). There's a def called
pbNextIndex, and that decides what happens when you press a direction key. Simply (well, cunningly) edit this to suit your new command layout. One problem is that this is also used for the fight screen, and if you want the geometry to be different between the two, you can simply copy-paste the def and rename the new (edited) one, and refer to that from the def
There are four commands in the command menu:
- Run (or "Call" if the foe is a Shadow Pokémon)
However, you may want to add some more commands, or restrict certain commands in certain conditions (e.g. forbid the use of the Bag).