Evan's Debug Console

EvanSki

King of Raccoons
This is the first of my on going goal of building tools for quick game creation. The tools would be used to iron out the kinks or just provide abilities to my games, be them full projects or quick game jams.
This first tool will be my main focus and will constantly be tweaked and edited to suit different needs or just to mess around with.

If anyone has and Ideas, questions, code improvements, grammatical/speiling mistakes PLEASE comment them down below, thanks.

THE DEBUG CONSOLE

The debug console is a refined and rewritten project that I was working on a while ago that being a command prompt simulation [view here]
From that base I've made the Debug menu a single object that can be dragged and dropped into any project. With the precise goal of being completely customize-able to the users needs.
The object handles user text input and phrases it to run a user defined command script.

How to use
The user would create the command scripts they need for there game.
There is a provided blank default template script for creating your own command script.
When the user presses enter it saves what they typed in a variable which holds the input string.
As of now it runs a chain of scripts to filter what commands have been typed and matches those words to a ds_grid holding the commands we want, then sets the value of the command to true in a different grid.
Once we have done that we read the grid and check how many are true, if more then one we give an error, if none we give an error, if one we then move on to running the command. We pull the command name from the grid and then add "scr_cmd_" to it, (so we can execute the script through code and so we dont have one worded named scripts).
The user would need to go into the debug menu object to user_event[0] and update the command grid, if more scripts are needed they will need to update the size of the grid.
(I will make a video on how to do this in detail when the tool is ready for full release)

In obj_debug_menu Event: Create
codeblock.png
GML:
#region //CON LIST
    cmd_list_size = 10; //max size of grid
    cmd_list = ds_grid_create(2,cmd_list_size); //create grid
    ds_grid_clear(cmd_list,0); //clears it of junk memory allocation

    var grid = cmd_list; // local variable for calling the grid

    //set all commands to false
    for (var i = 0; i < cmd_list_size; i++)
    {
        ds_grid_add(grid, 1, i, false);
    }

//COMMANDS   NEEDS TO BE UPPER CASE       
    grid[# 0, 0] = "SYSTEM";
    grid[# 0, 1] = "PRINT";
    grid[# 0, 2] = "HELP";
    grid[# 0, 3] = "SET";
    grid[# 0, 4] = "SCRIPT_EXECUTE";
    grid[# 0, 5] = "PH";
    grid[# 0, 6] = "PH";
    grid[# 0, 7] = "PH";
    grid[# 0, 8] = "PH";
    grid[# 0, 9] = "PH";
#endregion
Might rewrite this later for the grid to get the size dynamically based on the amount of commands set up in the create event


Default Commands implemented

Help
:
Displays info about given command,
Help [Command to get help]

Print:
Prints the value of a given global variable, if using a resource name it will give the value of the given variable for the given resource name,
print [Global Var/Resource name] [local var (FOR RESOURCE NAME ONLY)]

Set:
The Set statement can change a given value, to the given global variable or an local variable that is in an object. The New value must be a real number. The type can only be an object or a global.
Set [ Type (object/global) ] [ ( global.Varname / object_name.Varname ) ] [ Value ]
note: this does have the ability to crash the game if used without cation

Script_execute:

script_execute [script_id] : runs the given script.
note: this will not run any command script that must be called by the debug console
note: this does have the ability to crash the game if used without cation

System:
The system command exists to combine smaller function commands into one. These are typically game related commands.
system [command] (Quit, Fullscreen, room_next, room_last, restart)
note: Ideally you'd replace the fullscreen script for just being a on/off switch for your fullscreen code

Debug:
The Debug command exists to combine smaller function commands into one. These are typically debug/engine style commands. ex: (show_debug_overlay)
Debug [command] [Bool]

GIFS
help.gif
print.gif
set.gif

CURRENT BUGS
memory leak with syntax adding (FIXED in V1.0)
-a hot patch for release version is to just remove the code that adds the syntax to the syntax grid

DOWNLOAD!
CURRENT VERSION: 0.5
NEXT VERSION: 1.0


I will release the final (1.0) on the marketplace for a few dollars nothing major.
You are free to use the in development build of the debug console as long as you credit me and your use of it in your project. please be respectful thanks.
its currently in the form of a local package that you can import into your project.
[Download Link]
 
Last edited:

Bearman_18

Member
Looks pretty cool! I'll mess around with it and get back to you on it. Having a dev console always makes a game just 100 times more professional.
 

EvanSki

King of Raccoons
V: 0.3.1
Fixed an oversight where I left some leftover code that made files in the local appdata folder

*forgot some more code, just commented it out for future use, wont be in release unless I use it for something
fixed in V: 0.4.0
 
Last edited:

EvanSki

King of Raccoons
V: 0.4
Fixed 0.3's bugs.

Removed quit and fullscreen scripts
Added System script that combines quit and fullscreen under one script.

Set command has been changed. It now needs a type argument, the command no longer allows expressions and can only change global variables or local variables in instances.
It will only change the values of the instance given that is closest to the mouse.

*Accidentally left fullscreen in command list [FIXED V0.5.0]
*Pressing up when the debug object is first created crashes your project [FIXED V0.5.0]
 
Last edited:

EvanSki

King of Raccoons
(FIXED)
While working on version 5 I found a funny glitch in the way my debug console handles UTF-8
Heres a video I made on it if anyone is interested
oh yeah, I also figured out syntax highlighting so i guess this is also a sneak peek at that
 
Last edited:

EvanSki

King of Raccoons
Worked on syntax highlighting and auto-fill, Version 5.0 is going to have a lot of new features and improvements
syntax.gif
 

EvanSki

King of Raccoons
V: 0.5
Currently waiting for a stable GMS 2.3 update for First Full Release


BUG FIXES:
Fixed 0.4's bugs.
Fixed some low-end syntax errors in the gamemaker IDE

NEW FEATURES:
+Commands now accept object id's
+ADDED SYNTAX HIGHLIGHTING!!
+ADDED COMMAND SUGGESTIONS
Highlighting and suggestions are found in the step event and must be setup for your command if you want autofill to work

+Moved the command grid to the create event and made it easier to customize

+Added new system commands:
room_next will do as it implies,
room_last will take you to the previous room,
restart will restart the room
game_restart will restart the game
version will return the version you currently have

+Added Debug command
smaller functions under one command. These are typically debug/engine style commands. Debug [command] [Bool]
for the bool argument you can type out true or false, t/f, 1/0
The commands for the debug command are:
show_debug_overlay (debug_overlay)
audio_debug
draw_id

+Added Built in commands
Theses are in the object and do not use the system setup for custom commands
I might make all the scripts I've made be built in commands in the future
for now if you type "qqq" the game will quit automaticlly


CHANGES:
-Removed unused leftover code
-Removed UTF-8 key check code
-Removed Debug menu's global variables
(this was back when the entire debug console was a list of scripts, I also didnt realize its a call stack and the scripts can access all the values from the object, so now there all regular variables)
 
Last edited:

EvanSki

King of Raccoons
Its been a while but I have been working on this
Fixed a lot of bugs, made the code more efficient and faster
made the code blocks easier to read
 
Top