ConsoleX - Customizable Debug Console

ConsoleX - Customizable Debug Console

Note: ConsoleX now supports both JavaScript and C#!

Quick Info:
Documentation
Asset Store Link
Price: $20.00
Version: 1.1

What is it?
ConsoleX is an easy to use collection of scripts for creating an in-game debug console. The goal behind the project is to require as little effort from you as possible to implement it, and it delivers – the entire console can be initialized with one line of code, and each additional command requires only one more line of code to add a link between the console and your custom method.

What does it do?
After writing the (minimal) code to link your methods with the console, ConsoleX scans for linked methods at the start of your game and builds a list of commands which can be accessed via the provided default console GUI, or used to implement your own custom GUI.

How does it work?
Implementation is a very easy two part process. The first part involves building the console. The easiest method is to simply use the provided default console. The second part involves linking your methods to the console, which is done via attributes. Simply add the attribute at the top of your method, and you’re done.

For those who wish to create their own console, you can build your own GUI and then pass the text input from it to the console via ConsoleX.SendCommand(textInput). The linking method stays the same.

Full documentation with examples is available, and the scripts are documented for those who wish to delve deeper.

Example of the code required to create your console:

void Start()
{
     // This is it
     ConsoleX.Init();
}

void OnGUI()
{ 
    // Assume you store your text input to this variable
    string textInput = "";

    // When you press the enter key
    ConsoleX.SendCommand(textInput);
}

Example of the code required to link your methods with ConsoleX

// Call the "yourMethod" function when you input /doMyMethod into the console.
// and print "/doMyMethod - Does your method" when you type /help."
[ConsoleCommand("/doMyMethod", "yourMethod", "Does your method")]
public void yourMethod()
{
     // do your stuff here.
}

Features
The primary features of ConsoleX include:

  • Easy to use.
  • Create your own custom commands with minimal code (one line!), and link them to your own custom methods.
  • Supports additional parameters
  • ConsoleX framework can be used in a console with a custom built UI.
  • A default console is provided if you don’t want to build your own – just drag and drop in seconds.
  • Two commands are provided in all consoles that use ConsoleX: /log (logs all console output to a text file), and /help (shows a list of all commands and their documentation).

Future Support
ConsoleX is in an early version and as such the hope is that as many people as possible will provide feedback as to requested features. For now, the following updates are planned (in no particular order):

  • Parameter support for MonoBehaviors (parameters are currently supported for non-MonoBehavior scripts.
  • A more advanced default console, including the ability to split the output shown between Warnings, Errors, Log Statements, or All Statements.
  • A Unity Editor GUI for flagging your methods to be callable via the console without touching your code.

Screenshot of the default console:
**Default console GUI is based off of a script provided by Matthew Miner licensed freely for public use - see documentation for details.

Just a quick note with some updates. I’ll be adding an “Editor GUI” to the Future Support list, though work won’t begin on it until some of the other updates have been addressed. Also expecting to submit an update in the next couple days which adds support for logging all output to a text file, as well as a few minor fixes.

Cheers :slight_smile:

Update:

The /log to text file support is taking longer than expected (weekeeenndddd ;)) but should be submitted by early next week.

A full list of incoming updates:

  • Adding a /log command to output everything in the console to a text file.
  • Easier customization for the default console.
  • Minor fixes/quality of life improvements.

The update has been submitted to the asset store and is pending review! The following changes have been made:

  • The default console windowID can now be set via the inspector. This will be useful to anyone who experiences GUI errors related to the current windowID.
  • The default console’s x position, y position, width, and height can now be set via the inspector. These variables are expressed as the percentage of the screen that they should be located at/take up. For example, to place the console at the top of the screen, halfway in the middle, taking up half the screen in width, and extending the entire screen in height, you would set the x position to 0, the y position to 50, the width to 50, and the height to 100.
  • Fixed some quality of life issues with the ConsoleCommand attribute.
  • Added extensive documentation to the default console’s code. This should assist any users who wish to use it as a reference when creating their own custom console.
  • Added support for logging console output to text files. The default output location is in the projects Application.dataPath (in the editor), or Application.persistentDataPath (in a standalone), but you can set a custom output path by calling ConsoleX.RegisterTextLogOutputPath(pathAsaString) immediately after initializing the console. Documentation of this feature along with examples will be added to the pdf documentation file.

Cheers :smile:

A couple more quick notes:

  1. The documentation has been updated to reflect the latest changes.
  2. Another update will be submitted tomorrow morning (when I’m back at the computer to submit it) which has a few other minor fixes that were intended to be in the original update, including a fix to the issue of private methods not being detected.

Just a quick note:

The documentation has been updated to show how ConsoleX can be used with JavaScript. An update will be submitted tomorrow which handles the simple change required to allow this.

News for today:

Preparing to start work on adding support for mono behavior parameters.As a reminder, non-monobehavior scripts can already utilize parameters!

More info to come when this gets closer to completion!

A quick note on the submitted updates:

The asset store reviewers have been experiencing a bit of a backlog, so the updates have not been reviewed yet, but they should be out soon :slight_smile:

More Updates:

Another update has been submitted with more quality of life changes/bug fixes. In addition, there is a part missing from the documentation for those wishing to use the console with JavaScript. The “Scripts” folder must be moved to the “Standard Assets” folder before it will compile. Note that any JS scripts which make use of ConsoleX must be outside of Standard Assets. Anyone experiencing trouble getting this set up can of course contact me, and I will see what can be done to assist you :slight_smile:

The documentation will be updated in the next few days with this information.

Update:

An update has been submitted, dropping the price from $20.00 to $15.00! Cheers, to those who were looking at this but unsure. :slight_smile: