-
Notifications
You must be signed in to change notification settings - Fork 11
Console Commands
Valk edited this page Jan 29, 2026
·
7 revisions
Note
The in-game console can be brought up with F12
Registering new commands is easy.
public override void _Ready()
{
Game.Console.RegisterCommand("help", CommandHelp);
Game.Console.RegisterCommand("quit", CommandQuit).WithAliases("exit");
Game.Console.RegisterCommand("debug", CommandDebug);
}
private void CommandHelp(string[] args)
{
IEnumerable<string> cmds = Game.Console.GetCommands().Select(x => x.Name);
Logger.Log(cmds.ToFormattedString());
}
private async void CommandQuit(string[] args)
{
await Global.Instance.ExitGame();
}
private void CommandDebug(string[] args)
{
if (args.Length <= 0)
{
Logger.Log("Specify at least one argument");
return;
}
Logger.Log(args[0]);
}