Thursday 17 February 2011

Supertux2 console scripting hacks/tricks

SuperTux is a classic 2D jump and run sidescroller game in a similar style like the original SuperMario games. It is similar to mario with its hero as the Tux, the official mascot of the linux kernel. Well there are few interesting tricks that can be used in the console mode of this game so enjoy this post.

For the cheats to work, you need to enable the console mode either by editing the config file situated at $HOME/.supertux2/ or by running the supertux2 with the --console argument. IInd way is easier.
So we first need to start the program by typing in the Run command[Alt+F2]

supertux2 --console

Now console mode can be toggled by using a specific keyboard input which is ^ by default and can be modified from the options menu. I prefer ` as the console key.

Now while playing the game, we will press the console key and then a new overlapping console will be seen. There we will be typing the commands which will be listed in this post.

There are different kinds of functions that can be enlisted by pressing Tab when console screen is on.

Following are few interesting global functions that can be called by typing as they are below:



play_music(string musicfile) Changes music to musicfile

play_sound(string soundfile) Plays a soundfile

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!)

Apart from these global ones, we can access the other objects such as Tux(object of Player class), Camera, etc. In the following list of Player class's function, you can access each of them by typing sector.Tux.function_name(). For example, to call do_cheer(), you would type sector.Tux.do_cheer() in the console.

add_bonus(string bonusname) Gives Tux the specified bonus. Replace bonusname with either of "grow", "fireflower" or "iceflower".

add_coins(int number) Gives Tux number coins.

make_invincible() Makes the player invincible for either a predefined amount of time.

deactivate() Stops the player and blocks the movement controls.

activate() Reactivates the player's movement controls.

walk(float speed) Make Tux walk

set_visible(bool visible) Shows or hides Tux according to the value of visible. Note: Tux doesn't interact with objects or badguys while invisible.

get_visible() Returns: bool; is Tux visible?

kill(bool completely) Hurts a player, if completely=true then the player will be killed even if he had grow or fireflower bonus.

set_ghost_mode(bool enable) Switches ghost mode on/off.
Lets Tux float around and through solid objects.

get_ghost_mode() Returns whether ghost mode is currently enabled

do_cheer() Makes Tux cheer, if possible.

do_duck() Makes Tux duck, if possible.

do_standup() Makes Tux stand up, if possible.

do_backflip() Makes Tux backflip, if possible.

do_jump() Makes Tux jump, if possible.

For more scripting reference, please visit this link.

Happy Supertuxing :-)

1 comment:

Elando said...

Who is going to teach ne uo some good hacking tips?

Post a Comment