Search the web with Google

Android install

Android installation weblog

Enter your email address:

Jeroen´s weblog

Ubuntu install

Ubuntu installation weblog

Tuesday, November 10, 2009

Supertux2 cheats

Not really cheats, but a console with scripts to manipulate the program.

It's found here

Console for SuperTux 2

Jump to: navigation, search

SuperTux 0.3.x: This text describes features that can be found in SuperTux 0.3.0 or later

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. (Default of ^) Use --noconsole to disable it again.

To disable or enable the console if you don't want to pass command line parameters, you will have to edit the edit the SuperTux configuration file. Depending on your operating system, this varies:

Operating System Config file location
Linux ~/.supertux2/config
Windows %USERPROFILE%/.supertux2/config
Mac OS X Home/Library/Application Support/SuperTux/config.txt
Mac OS X Leopard %USERPROFILE%/.supertux2/config

You may have to enable viewing hidden files or folders. Anyway, open the file up with a text editor, and

 (console #t)

will enable the console, and

 (console #f)

will disable the console. Find one to change it to the other.


Following is a list of predefined scripts to run in the console:

flip()Flips the current level vertically. Make sure you have something to stand on!
edit()Puts the level into a state suitable for testing out edits. Tux can't exit the level; if he dies or reaches the end he goes into ghost mode.
play()Goes out of edit mode and restarts the level.
kill()Kills Tux
grow()Grows Tux into big Tux
shrink()Shrinks Tux into little Tux (currently broken)
fire()Gives Tux the fire powerup
ice()Gives Tux the ice powerup
lifeup()Gives Tux 100 more coins
finish()Finish the current level
worldmapfinish()Finish all the levels on the worldmap
functions(x)Gives a list of the functions available in an object or table. If no argument is given, this prints out the functions in the root table.
display(*** object) Displays the string value of object in the Console. Object can be of any data type.
print_stacktrace() Displays contents of the current stack.
load_worldmap(string filename) Loads and runs the worldmap specified in filename. (The path is relative to the data root.)
load_level(string filename) Loads and runs the level specified in filename. (The path is relative to the data root.)
get_current_thread() Returns the currently running thread.
display_text_file(string filename) Displays the SuperTux text file named filename. (The path is relative to the data root, e.g. "/home/joe/src/supertux-trunk/data") See also: SuperTux file format reference, SuperTux texts
wait(float time) Pauses execution of the Squirrel code for time seconds.
wait_for_screenswitch() Pauses execution of the Squirrel code until a new screen is displayed (e.g. menu → worldmap or worldmap → level).
exit_screen() Exits the current screen, returning to the previous one or, if the active screen is the last one, exiting SuperTux.
fadeout_screen(float seconds) Does a fadeout for the specified number of seconds before next screenchange.
shrink_screen(float dest_x, float dest_y, float seconds) Does a shrinking fade towards the destposition for the specified number of seconds before next screenchange.
translate(string text) Returns: translated string. Translates text into the user's locale. Note: This construct is unfortunately not yet recognized by XGetText, so translation files have to be written manually.
import(string filename) Imports and runs the Squirrel script filename. (The path is relative to the data root.)
save_state() Dumps the current state into the user's save game file.
update_worldmap() Update worldmap from worldmap state ( variable)
play_music(string musicfile) Changes music to musicfile
play_sound(string soundfile) Plays a soundfile
debug_collrects(bool enable) Enables or disables drawing of collision rectangles.
debug_show_fps(bool enable) Enables or disables drawing of the FPS. (Also affects config file)
debug_draw_solids_only(bool enable) When enabled, only draws solid tilemaps. (No background/foreground tiles)
set_game_speed(float speed) Set speed to run the game at. (Doesn't affect menus/gui)
grease() Speeds Tux's horizontal velocity by a factor of 3.
ghost() Makes Tux a ghost, letting him float around and through objects.
invincible() Make Tux invincible for 10000 units of game time.
mortal() Recall Tux's invincibility or ghost status. (Even when not given with above 2 commands)
restart() Reinitialize and respawn Tux at the beginning of the current level.
whereami() Print out Tux's coordinates to the console.
gotoend() Moves Tux horizontally 2 screens away from the end.
camera() Display the current camera's coordinates. (top-left corner)
quit() Exits the game. (Not recommended for use in levels!)
int rand() Returns a random evenly-distributed integer between 0 and 2147483647, inclusive.

There are many more, see ScriptingGlobals for the full list of utility functions and Scripting reference for all the interesting things you can do.

Console Features

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.

No comments:

Post a Comment