Evan's Debug Console

Status
Not open for further replies.

Evanski

Raccoon Lord
Forum Staff
Moderator
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.

POSTPONED

THE DEBUG CONSOLE
Evanski_DebugConsole_logo.png

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
LICENSE:
EvansDebugConsole

Copyright © 2020 EvanskiStudios

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

1. The end-user (you) must supply credit for use of the software in any shape way or form that it is used in.
2. The end-user (you) must not redistribute the software in an opensource forum.
Note: you are allowed to release what you use the software for in an open-source fashion being you have removed the source of this software from your use of said software, Condition 1 still applies.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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

Fruit Stand Deadbeat
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

Raccoon Lord
Forum Staff
Moderator
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

Raccoon Lord
Forum Staff
Moderator
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

Raccoon Lord
Forum Staff
Moderator
(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

Raccoon Lord
Forum Staff
Moderator
Worked on syntax highlighting and auto-fill, Version 5.0 is going to have a lot of new features and improvements
syntax.gif
 

Evanski

Raccoon Lord
Forum Staff
Moderator
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

Raccoon Lord
Forum Staff
Moderator
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
 

Evanski

Raccoon Lord
Forum Staff
Moderator
Hello! Its been a while, I've lost motivation on this project, but I've not forgotten about it, the release on the marketplace will take a while longer to come out then first anticipated.
I have not abandoned this project, but I need to go and over view it, my thinking is releasing 1.0 on the marketplace after some bug fixes im having issues with. Then making a complete re-write as GMS2.3 as added features that will improve the code for this. That will be a separate copy as a 2.0 version.

For users
@Ninety
@HyprBlu
@GameDevDan @NAL
@ericossiqueira
@Lukan
@sylvain_l

Sorry for the notif, but
I have not forgotten your reward of a copy of version 1.0 (the release) from the GMC 38 Jam
Just letting you all know its probably going to be a while until I work out the details.

Thank you.
 
Last edited:

Evanski

Raccoon Lord
Forum Staff
Moderator
Working on Release version.
  1. Going to be writing a written users manual for the commands and how to use,
  2. publish to marketplace
  3. Create new thread
  4. Make video how-to's for the console
 

Evanski

Raccoon Lord
Forum Staff
Moderator
So the state of this project is up in the air as I've shifted focus onto different projects and the development of Hansha,
as well as the new function changes from 2.3.1 making this code even more redundant, I'd need to spend a long time scraping it all and re-writing the code to make it work easier and more efficient.
So as it stands this is most likely postponed, That being said

For users
@Ninety
@HyprBlu
@GameDevDan @NAL
@ericossiqueira
@Lukan
@sylvain_l

I did promise a copy of the release which looks to be in the void, so now I offer this.
If you still want a copy, DM me and I'll send you a copy of the debug console and a run down of its functions and uses,
I apologize for any inconvenience or any reneging I have done.
 
Status
Not open for further replies.
Top