This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.
The Console is a panel normally hidden from view. Its usage is twofold:
- It displays informational, warning and error messages that occur during gameplay, alerting players of things like low diskspace, broken levels, ...
- It helps debug the engine and test levels by allowing direct execution of Squirrel script commands (see Scripting reference)
The Console pops into view for a short time whenever new messages are printed. To review old messages and enter commands, the console needs to be activated.
To do so, you will have to run supertux using the --console option. The key assigned to opening the console can be changed in the keyboard setup as soon it is activated.
To disable the console again you have to edit the SuperTux configuration file ~/.supertux2/config (%USERPROFILE%/.supertux2/config for Windows users). Change
Following is a list of useful scripts to run in the console:
|restart()||restarts the current level|
|whereami()||prints Tux' coordinates|
|debug_collrects(true)||shows a transparent hitbox image over badguys for debuging|
|ghost()||lets Tux float around and through solid objects|
|mortal()||reverts Tux back to normal|
|grow()||Grows Tux into big Tux|
|shrink()||Shrinks Tux into little Tux|
|fire()||Gives Tux the fire addon|
|ice()||Gives Tux the ice addon|
|invincible()||Makes Tux invincible|
|lifeup()||Gives Tux 100 more coins|
|finish()||Finish the level|
|display(x)||Prints out x. Very useful for tables / arrays, as it also shows the contents.|
|functions(x)||Gives a list of the functions available in an object or table.|
There are many more, see data/scripts/console.nut, data/scripts/default.nut, and src/scripting/functions.hpp for the full list.
The console currently supports autocomplete, through use of the tab key, line editing with left/right/home/end/delete keys, and viewing past messages using the up, down, page up, and page down keys. To run a command, simply press the enter or return key.