Is there a commented object definition that's accessible in the MV files I could use as a reference?
Most of this kind of stuff is defined in rpg_objects.js, but no, other than a brief introduction for each class, most things aren't commented. You have to work out what methods/properties do from their name and code, or you can often look at the Game_Interpreter.prototype.commandxxx methods (luckily these
are commented with their corresponding event command) to give you some helpful hints as well. "this" in an event page context is an instance of this Game_Interpreter class by the way.
On top of that you have to deal with inheritance so some methods will be defined elsewhere on superclasses, not necessarily in the same file. And the files are very long, it makes finding stuff a little annoying (ctrl + f is your friend).
This is partly why I recommend getting used to the F8 console - as long as you can get a reference to some object, adding a dot after it will pop up an autocomplete list of every property/method available on that object, and you can view those method definitions and execute them from right there in the console. Sometimes you may have to assign a variable to an object for this to work (i.e. if the object is returned by a method itself), e.g:
// In the console:> $gameMap.event(1). // won't give you an autocomplete popup> var blah = $gameMap.event(1)> blah. // will give you an autocomplete popupIf there's a specific object that you want to check out and play around with, but isn't accessible from global variables (at least easily), you can do a script command from within the editor to assign it to one. For instance, if we want the Game_Interpreter instance for an event page accessible in the console, we could add a script command at the top of that event page to assign "this" to a global variable:
window.blah = this // global variables are actually just properties on the window object// if we used `var blah = this` the resulting variable wouldn't be available in the console because it's limited to the current scopeThen all you have to do is activate that event ingame, and "blah" will be available in the F8 console just like it was in the event example. Note that this is all for testing/debugging purposes, it's bad practice to be assigning global variables and leaving them lying around normally.
There are also a bunch of methods that just print out data to the console that you can use in script commands, like console.log(...), console.warn(...), etc. Or you can use alert(...) to pop up an alert window with some information.
And then there's slightly more advanced methods like setting breakpoints, or using a "debugger" call (basically a breakpoint set from within the editor).
Anyway yeah, sorry for the wall of text, console use should probably have its own topic or something, but yeah I find it invaluable for discovering script commands, which is why I think it's relevant.