- Add the repo as a submodule in your project. This can be done by opening a terminal in your addons folder (
res://addons/), and runninggit submodule add https://github.com/vektor451/vek-dev-tools. You need to have git installed for this to work. - Build the C# solution. If you are placing the addon in a new project, you might have to make a random empty C# script first to be able to build it.
- Enable
Vekkie's Dev Console and Toolsin the plugins tab of your project settings. - Add a
dev_consoleaction into your project's input map, which can also be found in the project settings (this is necessary for opening the console). If you want to be able to use the popout functionality to have the console as a seperate window, you need to disable the Embed Subwindows setting in your project settings. The property path is:Do not follow this step without first reading the below important note. If you still wish to use the popout functionality and replace the scene instance, you may still follow it.display/window/subwindows/embed_subwindows.
Important
The popout functionality is currently disabled due to a large number of present bugs within it's implementation that are proving to be quite frustraing and difficult to fix. With recent improvements to the engine, the output text can now be made floating, which can be used instead of the popout functionality for monitoring console output.
If this feature is still desired, you can try to replace the ConsoleUnpoppable.tscn instance within DevTools.tscn with ConsolePoppable.tscn.
Note
This version of the console has backwards compatibility with the previous developer console I have made, and any projects using that plugin will also work with this one so long as you delete the previous console.
To add a command to the console, use the DevConsole's AddCommand(name, command) method. This is static, and will be accessed anywhere in your project as DevConsole.AddCommand The name property is a generic string, however the command is a class consisting of 4 notable properties:
- Action: The main method to execute with the console command. Supports arguments of type int, float, string or bool, and is required.
- ReadAction: An alternate method executed if the command was submitted with no arguments. Usually used to retrieve the value of a property, but can be used for other means (for instance with the help command, printing all commands and their descriptions). Doesn't support arguments, and is optional.
- Description: The command's description used when getting help. Technically optional, but not advised to omit.
- UseSingleStringArg: A bool that specifies that the command is intended to work with a single string argument, similar to how
echoworks, or something likesayin source games.
You can also remove commands with RemoveCommand(name)
This will not work natively in GDScript, and will require you to create a C# script with methods that call the GDScript from there, and then create commands for those methods.
- Support for enum types.
- Support for scripts, which execute a particular set of commands with the console.
- A flexible interface for displaying variables on the screen. This will be one of the tools rather than a specific part of the console.
