In a previous tutorial, we had tested the built-in Window class. We can use the same knowledge to construct a quick debugger, which can be used as a probe to collect data very quickly during development. P.S: RPG Maker has a debugger, but for personal reasons I prefer to use this quick debugger. This one I’m sharing here is a ‘lite’ version of the one I’m using for RPG Maker scripting development.
Without further ado, let’s follow these steps:
1-) Open RPG Maker VX and open the Script Editor. Hotkey is F11.
2-) Delete every file-based section of code. Absolutely everything. Hotkey is Del for each entry.
3-) Create three new files. Hotkey is Ins in the file-like explorer section.
4-) Enter the following pieces of code in the editor, each in a different file-based entry.
def initialize(x, y, width, height)
filename = "Window"
path = "Graphics/System/" + filename
bmp = Bitmap.new(width, height)
self.windowskin = Bitmap.new(path)
self.contents = bmp
self.arrows_visible = false
draw_text(0,-10,width, height, text)
@windows = 
x = 0
y = Graphics.height - 48
height = 45
width = Graphics.width
@windows.push( QWindow.new(x, y, width/2, height) )
@windows.push( QWindow.new(x+width/2, y, width/2, height) )
def refresh(index, string)
def update(param1, param2)
def update_info(obj, param)
@debug = QDebug.new
@debug.refresh(0, "hello world")
@debug.refresh(1, "This is a quick debugger.")
I won’t explain every bit of the code, but QWindow stands for Quick Window. This window is a child of the built-in Window class and allows to display a string on the screen. QDebug stands for Quick Debug. This class allows to hold many instances of QWindow objects as a single object. In this version, I’m only using two windows to keep things simple, but in larger projects I’m allowing at least 8 CWindow objects to display information, but you can add more of them when necessary. By the way, the QDebug class can adapt different size of the screen automatically, you can test it by commenting out the Graphics.resize_screen(640, 480) line.
This debug script will be just perfect for analyzing data in upcoming demos.