Console Commands and Cheats

The in-game console is part of the User Menu: while playing, press Escape and open the Console tab (in the editor, the same console is available as the Console panel). It supports auto-completion (Tab) and command history (Up / Down).

Cheats

Cheats are console commands that players can execute in your game using the in-game console. You can create new console commands directly in Daslang by using the [cheat] annotation. For example, let’s write a command that allows you to start a specific level in the game:

[cheat(name="game.start_level")]
def start_level(num : int) {
    set_current_level(num)
}

This command will be available in the console as game.start_level. Note that the name parameter of the [cheat] annotation specifies the name of the command in the console. This parameter is optional; if it is not specified, the function name will be used as the command name.

You can add a hint parameter to provide a detailed description of what the command does. This is especially useful for AI agents (e.g. Claude Code via MCP) that can discover and use your commands automatically:

[cheat(name="game.start_level", hint="Start a specific game level by its number. Level 0 is the tutorial, levels 1-10 are campaign missions.")]
def start_level(num : int) {
    set_current_level(num)
}

All user defined console commands are available in the editor mode only. Add allow_in_release annotation argument to make the command available in release builds as well ([cheat(allow_in_release)]).

Cheat Commands Window

You can quickly run any no-argument cheat command from the Cheat Commands window. Open it via Window > Cheat Commands… in the main menu. The window displays a grid of buttons for all registered zero-parameter [cheat] commands; clicking a button executes the command immediately.

Built-in Console Commands

Besides your own cheats, the engine provides a set of built-in commands:

Application

app.play (hotkey: Ctrl+P or F5) - start/stop the game

app.pause (hotkey: Ctrl+Shift+P) - pause/unpause the game

app.next_frame (hotkey: Ctrl+Alt+P) - advance the game by one frame

app.editor (hotkey: F10) - open/close the editor

app.game_reload (hotkey: Ctrl+Shift+R) - reload the game (restores the game state)

app.hard_reload (hotkey: Ctrl+Shift+X) - hard reload the game (reloads all modules and restarts the game)

app.auto_restore_global_state - if true, the global state will be restored after a game reload (enabled by default)

app.set_target_fps - set an upper limit for the game’s frame rate; use 0 to disable the limit

app.set_time_scale - set the scale for game time (default is 1.)

app.inc_speed (hotkey: Ctrl+Shift+=) - increase the time scale

app.dec_speed (hotkey: Ctrl+Shift+-) - decrease the time scale

app.take_screenshot (hotkey: F11) - take a screenshot (saved to the game/.project/screenshots folder)

app.listen_editor_shortcuts - enable/disable listening to editor shortcuts when the editor is open (enabled by default)

Garbage Collector

gc.collect_strings - collect unused strings; all unused heap objects will be collected too

gc.collect_heap - collect unused objects in the heap

gc.collect_all - collect both unused strings and objects in the heap (default strategy)

gc.enabled - enable/disable the garbage collector

gc.validate - validate the heap and report any issues. Useful for debugging memory-related problems

gc.report - print a report of the current memory usage. Very verbose output, prints only in text log, can freeze the game for a long time

MCP Server

app.mcp_status - show MCP server status and registered tools

app.mcp_start - start MCP server on specified port

app.mcp_stop - stop MCP server

app.mcp_call - call an MCP tool: app.mcp_call tool_name [val1] [val2] ...