Jump to content


Developer Console

debug console

This topic has been archived. This means that you cannot reply to this topic.
12 replies to this topic

#1 Neon Black

Neon Black

    The Classy Prostitute

  • RPG Maker Web Staff
  • 722 posts

User's Awards


Posted 23 July 2012 - 01:12 AM

Developer Console Script V1.3

Created by Neon Black

What is it?
This script adds a developer console to your RPG Maker Ace game similar to the developer console in valve games created in the source engine. This console can be accessed by pressing the assigned key (tilde by default). With the console you can perform a number of simple functions such as checking methods or variables or performing short lines of code.

How can I use it?
I designed it with a few functions I knew I would use myself while scripting (such as "peek" which lets me see where a window is or "make" which lets me set variables). I can't really say how it will be useful for any individual use, though I plan to add a few more extra uses to it. For full information on how to use it and all current commands check the user manual on my blog-in-progress here.

What does it look like?

What does it work with?
Technically it should work with everything, unless someone was brazen enough to modify the "Scene_Base" class. In any case, put this above all the other scripts in materials and it should work with everything. This DOES NOT mean you can OPEN it in everything. This script will actually pause the currently running scene in order to start working through some kind of forceful tactics. As always, if you notice any compatibility issues, let me know and I'll look into them.

How can I get the script?
Version 1.3 (base script, 11.15.2012) is available from my pastebin account here.
This script also requires version 1.0 or higher of the keyboard module now that I've split them. You can get that from my pastebin account here.

I would like to use this code.
Posted Image
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Permissions beyond the scope of this license may be available at http://cphouseset.wo...d-terms-of-use/.

Author's Disclaimer:
While I feel this script is really powerful, I also fear that for the most part people will find it pretty worthless. Sure it's really neat looking, but its uses are currently pretty limited if you don't really know how to use it. I do plan to add a few graphical user interfaces to it for debugging purposes, but I need to code those up first. I kinda hope I didn't disappoint anyone that was wondering what kinda console I was talking about, though I guess you can't really expect that much from me.... Or maybe I'm jumping the gun and people will find a use for this script. I guess I'll see how it goes.

I feel like saying it again. The user manual is here on my wanna-be blog. Please read it to get an idea of what it can do. I'll certainly answer any questions you might have about it. And I don't really know much else to add to it, so I'm looking for ideas. Seriously, let me know what you want, I'll try to add it.

Edited by Neon Black, 19 November 2012 - 09:48 AM.

#2 hyde9318


    Go to sleep....

  • Members
  • 1,572 posts

Posted 23 July 2012 - 02:59 AM

Oh wow, you really came through, didnt you? This is amazingly cool. And the things I can do with this.... Oh lord.... this is going to be fun.

Click a button below to visit each link!

#3 AlaiaVee


    Advanced Member

  • Early Adopter+
  • 74 posts

Posted 23 July 2012 - 04:07 PM

Very nice, going to be useful for testing.

“Let yourself be silently drawn by the strange pull of what you really love. It will not lead you astray.”

― Rumi

#4 Tsukihime


    Advanced Member

  • Members
  • 6,295 posts

User's Awards


Posted 23 July 2012 - 05:43 PM

lol I would need to see how people are using it to determine whether it's good for debugging.
My Scripts. Go here for Bugs and Requests.


Want to write a tutorial? Submit a community tutorial!

Like on Facebook: HimeWorks
Follow me on Twitter for the latest updates! @HimeWorks
I also make RPGMaker and gamedev videos on Youtube

#5 Death10



  • Members
  • 28 posts

Posted 24 July 2012 - 10:48 AM

I will use this script for sure :D

#6 estriole


    Advanced Member

  • Members
  • 581 posts

Posted 04 September 2012 - 02:25 AM

i want to ask you permission to mod this script.
i'm planning to mod this script to have two modes : administrator and player.
administrator have password, player also have password (shown when finishing the game so after you know the password you can start new game and use console)
if password administrator inputted. it's the same function.
but if player the command is different. i want to make some sort of input cheat code function :D. ex: type whosyourdaddy will grant immortal state to all members LOL. or greedisgood that will increase your money by 100000 :D (just some example i don't want to sued by blizzard LOL).

edit : sorry apparently i didn't read this:
I would like to use this code.
You are free to use, modify, copy and distribute this code at your own leisure and you do not need to credit me directly, however if you use this code or modify it in any way, please leave the names in the credits box at the top of the code and do not remove that section. For those wishing to use this in a commercial project, please contact me first.

Edited by estriole, 04 September 2012 - 02:26 AM.

#7 Neon Black

Neon Black

    The Classy Prostitute

  • RPG Maker Web Staff
  • 722 posts

User's Awards


Posted 04 September 2012 - 02:31 PM

Sure, go ahead and modify it. Sorry, though, I'm just getting around to modifying all of my stuff this weekend; I do have a few more terms of use, but you're still free to use it. Double check my terms of use here: http://cphouseset.wo...d-terms-of-use/

It's similar, only real difference is now there is a license you have to abide by, but yeah, go ahead and make those modifications!

EDIT: I updated the terms of use saturday, and as far as I recall I changed the terms of use in the headers of all my scripts. I only haven't gotten around to editing all the topics on this site yet, that's all. Since I'm free right now, I'll do it now.

Edited by Neon Black, 04 September 2012 - 02:32 PM.

#8 Neon Black

Neon Black

    The Classy Prostitute

  • RPG Maker Web Staff
  • 722 posts

User's Awards


Posted 08 September 2012 - 03:36 AM

UPDATE: I've updated this script to version 1.2. It doesn't really have any bugfixes and the changes are mostly for scripters. Note that this script now requires another script that I have not technically released yet, however I have linked to it in the main post right under the console script.

The main feature of this update is the ability for a scripter to easily add commands to the console. This can be done with a few simple steps.
First of all, create a method for your new command and a help method for the new command noting that the command must receive 3 arguments and the help command will not receive any. Next alias the new_console_commands method. Then within that method call the alias and use "new_command('name', :do_command, :help_command)" to tell the console where your commands are. Below is an example of how to do this.
module Console ## All methods must be in the Console module to work.
  class << self ## First we alias new_console_commands.
    alias aliased_new_console_commands new_console_commands

  def self.new_console_commands
    aliased_new_console_commands ## Do the alias method first.
    new_command("world", :do_world, :help_world)
  end ## Our new command is added with "new_command"

  def self.do_world(arg1, arg2, arg3) ## This method must have 3 arguments.
    push_string("Hello world!")

  def self.help_world ## And here we have the help command.
    push_string("Displays a programmers greeting.")

Two useful command are "push_string('string')" which displays a line of string in the console window, and "show_list(list, string)" which will show the elements of "list" and finish by displaying "string" as a line of string.

Hopefully this will help the console be a little bit more useful. As always, enjoy.

#9 Neon Black

Neon Black

    The Classy Prostitute

  • RPG Maker Web Staff
  • 722 posts

User's Awards


Posted 15 November 2012 - 10:59 AM

Updated script from version 1.2 to 1.3. Also did a bugfix to the keyboard input script, updating it from version 1.0 to 1.0a. Here is a list of the console changes:
  • Changed how commands and help options are called. Commands are now given ALL words listed after the command as individual argument or a while string. Please ensure that custom commands use an argument method such as (*args) to receive the arguments or you will get a bug. To receive all text after the command as a single string, when setting up your command set it up in the following format:
new_command("name", :do_method, :help_method, true)
The 4th argument listed here as "true" tells the script to return all arguments as a single string rather than breaking them down into individual arguments.
  • The debug function has changed. Debug is now a separate command that will bring up a debug scene. The "Save", "Load", and "Delete" commands are now considered debug scenes. To call these, use the command "debug save" or a similar command. To bring up the old debug scene, use "debug variable" or "debug switch". To add your own debug scene, use the console command "new_debug("name", Scene_Name)".
  • Console updating has been separated from the keyboard window. This means that the console updates without the console window being open. This change should not be noticeable.
  • A new command "bitsize" has been added. Bitsize will check the length of the following string in pixels. It's syntax is "bittype This string's size is determined".
  • The skip title screen function has been changed. It will now open the load menu if any save files are found. Closing the load menu will start a new game. This option is only available in test play.
  • Pressing "up" will copy the last command you used into the console input box. This will allow you to use the same command several times in a row to test something if needed. Useful for debug menus and "peek".
  • Other numerous small bugfixes.
For any scripter who wants to make their own add on functions, there have been some changes to commands. Here are 4 main commands to allow data to be displayed in the console:
  • push_string(string) - Displays "string" as a line of text in the console.
  • push_space - Inserts a blank line into the console.
  • push_wrap_string(string) - Takes the entire string sent to it and places it into as many lines as are required to keep the text at normal size. This is pretty much "push_string" with word wrap.
  • push_list(list, string) - Displays each element of "list" and lists them for the user in the console, pausing at the end of a full screen of items. After all items have been displayed, "string" is displayed.
  • pause - Pauses the console and waits for user input.

Edited by Neon Black, 15 November 2012 - 11:03 AM.

#10 Mudgrunt


    Advanced Member

  • Members
  • 34 posts

Posted 17 November 2012 - 03:23 PM

What key is kTILDE? Whenever i change it to the C key or something it dosnt work...

#11 Neon Black

Neon Black

    The Classy Prostitute

  • RPG Maker Web Staff
  • 722 posts

User's Awards


Posted 17 November 2012 - 03:35 PM

"kTILDE" is an identifier for the keyboard script. If you would like to use another key, check the keyboard script for the names of the keys. They all start with ":k", so if you wanted to set it to the C key, you would need to use :kC. However, I don't recommend using any letters, number, spacebar, enter, or backspace since they are needed for typing and you would end up closing the console once you pressed those keys.

#12 estriole


    Advanced Member

  • Members
  • 581 posts

Posted 19 November 2012 - 01:39 AM

kTILDE is ~
(that key located left of '1' and above 'tab'. but the '1' is not the one in numpad)

hope that helps

#13 Neon Black

Neon Black

    The Classy Prostitute

  • RPG Maker Web Staff
  • 722 posts

User's Awards


Posted 19 November 2012 - 08:36 AM

Oh, yeah, I guess that could have been that question, too. Sorry, not use to such simple questions. =x