Console User Manual
Console user manual for CP Console Version 1.0. Revision 7.23.2012.
To use the script, first “install” it by placing it in the script editor in rpg maker VX Ace anywhere below “materials” and above “main”. Once you have installed it, begin by customizing the settings in the script. Since this manual is meant to be for the console, the other settings will not be covered. Rather, skip down to line 103 in the script to begin editing the console settings related to the script.
The necessary lines of code in the script editor and their default values.
The first setting in the script is related to the access key used to bring up the console. To use an access key enter a virtual key code in the line. You can find a list of virtual key codes by following this link. The selected key will both bring up the console and close it and so it can not be typed in the input box. For this reason be sure to select a key that you may not need to use, such as the tilde or a function key. Avoid using letter or numbers to call up the console. By default, the tilde key is used.
The second setting is the console access setting. This simply determines if you want the console to be accessible during normal play or only during test play through the editor. If you set this line to false, the console can be accessed during normal play, even from an encrypted project, so it is advisable to set a password if you do this to avoid cheating.
Finally, you can set a password that is required to unlock the console. This can allow you to have the console available while still preventing an average player from accessing any of it’s commands. The password you enter must be in a string surrounded by quotes in order to be recognized and may containing any characters. You will be required to enter this password in order to gain console access. If you choose not to have a password, rather than entering a string, simply enter the value nil with no quotes. This will cause console to be accessible without requiring a password.
When you finished setting up the basic settings for the console and would like to test the console out, apply the changes to the scripts and close the script editor, save your project, and open the project in test play mode.
The console can be opened at almost any time and during any screen simply by pressing the console key. Pressing the key will open up two windows: the console display window, and the console input window. Once the console has been opened, type in the console password to continue.
The basic console screen after entering the password.
After the console has been unlocked you have access to the console and may use any commands you choose. By entering “commands” you will get a list of commands available on the console and by typing “help” followed by a command, you can get more detailed information and syntax of any commands.
This console allows full use of the keyboard for typing and entering commands. The console is somewhat liberal as far as how commands may be entered and does not require any particular spacing as long as commands and arguments have at least one space between them. Commands may also be entered in both plural and singular format, that is, the command “variable” is the same as the command “variables” and will not cause any errors. Finally, variable names may be entered with or without a “@” in front of them and will still be recognized. Module and variable names must still have the proper capitalization in order to be recognized, however, such as “Audio”.
Aside from simple commands that gather information, there are a few more advanced commands meant mostly to be used by other scripters or other advanced users. Here are some examples of operations that may be performed for ease of use.
Certain commands such as the “variable” or “method” which check aspects of the current scene or windows within the scene can be simplified by locking a window or module for evaluation. This allows you to shorten type commands for a window or module as you would the scene. To set a window, type in the command “window” followed by the name of a window. The window can now be used without needing to type in it’s name as an argument.
The input window after setting a window.
You can set a module in the same way by entering “module” followed by the name of the module you wish to set. If you want to set a module within a module, you can type the full module path or you can type each module in turn.
Setting a module within a module.
“Eval” is a simple script evaluation command which exists for performing simple script tasks or complex tasks alike. The command functions the same way as the ruby command “eval” by taking the entered argument and evaluation it. It will then attempt to return the evaluated command as a string in the console. This allows you perform calculations in the console, for example “eval 2 + 2” will return “4” in the console screen. You are also able to perform more complex operations with this method, for example, “eval $game_party.gain_item($data_items, 1)” will give the party a potion. Be aware that the game is paused while the console is open, so some scripts may not start until the console has been closed.
Displays a list of all commands available in the console. Type “commands” to use.
Displays the names of all constants and other modules within a module. This command can be used with a set module. Other modules within the module will be displayed with “::” in front of their names. This command cannot be used on scenes or windows. To use this command type in “constants” or “constants Module” where “Module” is the name of the module you wish to check.
Opens the standard RPG Maker VX debug menu to allow changing of switches and variables. Type “debug” to use.
Opens the save game delete menu. This allows you to delete saved games. Type “delete” to use.
Allows you to enter a line of code for evaluation. Attempts to return the evaluation as a string on the next line in the console. Type “eval script” to use where “script” is the line of code you wish to evaluate.
Forces the game to exit. Type “exit” to use.
Gets the value of a variable within a scene, window, or other class. To use this command type in “get variable” or “get window.variable” where “variable” is the name of the variable and “window” is the name of the window or other class you want to check a variable from. This command works with set windows but will not work with modules at all.
Check help on a particular command. Type “help command” to use where “command” is the name of the command.
Shows a list of all imported scripts that use the “$imported” global variable (if anyone even uses them anymore). This will also show the version number of all other CP scripts. Type “imported” to use.
Opens the load game menu. Type “load” to use.
Locks the console requiring password use to continue.
Changes the value of a variable in a scene, window, or module. This will work with a set window or a set module. To use this command type “make variable value”, “make Module.variable value”, or “make window.variable value” where “value” is the new value for the variable, “variable” is the name of the variable to modify, and “Module” is the name of the module whose variable to modify or “window” is the name of the window whose variable to modify.
Displays the names of all methods within a scene, window, or module. Works with a set window or module. To use this command type “method”, “method Module”, or “method window” where “Module” is the name of the module to check or “window” is the name of the window to check.
Sets the module to use for evaluation with commands such as the “constants” and “methods” commands. Type “module” to clear the set method or type “module Foo” to set the module where “Foo” is the name of the module. If a module is currently set and you type the name of a module within the set module, the console will automatically set both, for example, if Bar is a module within Foo and Foo is the currently set module, you can type “module Bar” to set the current module to “Foo::Bar”.
Gains information about a window such as X and Y position, size, transparency, and other settings. This can be used with a set window. To use this command type “peek” or “peek window” where “window” is the name of the window to peek at.
Resets the console to it’s default state. Type “reset” to use.
Displays previous revision information of the script in a list format. Type “revision” to use.
Opens the save menu allowing the user to save the game anywhere. Type “save” to use.
Checks the names of all variables within the current scene or a window. This can be used with set windows. To use this command type “variable” or “variable window” where “window” is the name of a window to check.
Displays current version information. Type “version” to use.
Similar to the “module” command. Switches the set window to allow commands such as “variable” or “peek” to be used more easily. To cancel the set window type “window”. To set a window type “window foo” where “foo” is the name of the window.