Fractal Block World

Console Commands


This documentation was created for the following version of the program: 1.01.22
One can toggle the console (while in game) by pressing the '~' key.

Commands can be entered while in the console. For example, entering the command "exit" will exit the program.

All commands return a value. One can input complex commands using S-expressions. For example, "echo (vec 1.0 2.0 3.0)" will print "1 2 3" to the console. The outermost S-expression should not have parentheses around it. For another example, "echo (if (== (+ 2 3) 5) 1 0)" will print "1" to the console.

The dollar sign '$' followed by a string literal is syntactic sugar for the "get" command.

One can list all the commands from the console using the help command. This can also be used to print information about individual commands. All that help information is included in this html document. In fact, this document was generated using the "gendoc" command.

Console commands are built into the program. However aliases can be created in user defined scripts. Therefore, in a different configuration of the program, you may not see the same aliases as are listed here.



dumplua
Usage: dumplua

Outputs to Output/lua_env_dump.txtall the global
variables in the game Lua state.


q2md2
Usage: q2md2 cmd

cmd can be one of the following: stand, run,
attack, pain, jump_up, jump_down, flip, salute,
taunt, wave, point, crstand, crwalk, crattack,
crattack, crpain, crdeath1, death1, death2,
death3


game_input
Usage: game_input str

Gives a string to the (package) game code.


use
Usage: use

"Uses" the basic entity that the player is
looking at.


respawn
Usage: respawn passive
respawn force

Respawns the player. The passive version only
respawns the player if he is dead. The forceful
version respawns the player no matter what.


shrink
Usage: shrink

Shrinks player to the level that is one finer.


script
Usage: script

Displays the Lua script for the chunk that
contains the viewer.


tostring
Usage: tostring EXP

Returns the expression EXP converted to a string.


..
Usage: .. STR1 STR2 ... STRN

Returns the strings concatenated together.


+
Usage: + X Y

Returns X plus by Y. If X and Y are both ints,
then an int will be returned. If one of X or Y
is a float, then a float will be returned.


execf
Usage: execf FILENAME

Executes all the commands in the file FILENAME.
Every line of the file should be either a valid
S-expression or a comment line (all whitespace or
starting with the character '#'). FILENAME
should be a path relative to the directory
Input/Scripts/.


seq
Usage: seq EXP_1 EXP_2 ... EXP_N

Evaluates the expressions EXP_1 through EXP_N
from left to right, returning the value that
EXP_N evaluates to. That is, this command can be
used to execute a sequence of commands. For
example, "seq (echo hello) (echo there)" will
print "hello" and then "there" to the console,
and void will be returned (because "(echo there)"
evaluates to void).


god
Usage: god

Toggles godmode (invulnerability).


*
Usage: * X Y

Returns X multiplied by Y. If X and Y are both
ints, then an int will be returned. If one of X
or Y is a float, then a float will be returned.


toggle
Usage: toggle VAR_NAME

Equivalent to "set VAR_NAME (not (get
VAR_NAME))".


==
Usage: == EXP1 EXP2

Returns true if the expressions EXP1 and EXP2 are
equal, otherwise returns false.


shrinkany
Usage: shrinkany

Toggles ability to shrink/enlarge at any time.


let
Usage: let VAR_NAME VALUE
let VAR_NAME VALUE newonly

Creates/sets the environment variable VAR_NAME to
VALUE. Note: VAR_NAME must start with "home.".If
the "newonly" option is used, it will only set
the var if it DOES NOT already exist.


debug_tex_dump
Usage: debug tex_dump
The command "debug tex_dump" prints:

1) the total memory usage for all loaded
textures, 2) how many seconds it has been since
each texture was used, and 3) the size of each
texture.


unalias
Usage: unalias name ALIAS_NAME
unalias all

The command "unalias name ALIAS_NAME" removes the
alias ALIAS_NAME The command "unalias all"
removes all aliases.


get
Usage: get VAR

Returns the value stored by the environment
variable VAR. Note that the dollar sign followed
by a string literal is syntactic sugar for the
get command. That is, "$VAR" is equivalent to
"(get VAR)".


help
Usage: help
help NAME

The command "help" lists all commands in white
and aliases in pink. The command "help NAME"
prints help information about the command or
alias NAME.


vec
Usage: vec X Y Z

Returns the vector whose components are the
floats X,Y,Z.


delete
Usage: delete VAR_NAME

Deletes the environment variable. Note: VAR_NAME
must start with "home.".


ls
Usage: ls
ls PATH
ls PATH v

The command "ls" lists all variables in the
"current working directory" (See also: cd, pwd).
The command "ls PATH" lists all variables in the
name directory PATH. The command "ls PATH v"
lists the name and values of all variables in the
name directory PATH.


set
Usage: set VAR_NAME VALUE

Sets the environment variable VAR_NAME to VALUE.


exit
Usage: exit

Exits the program, performing the usual cleanup.


print
Usage: print STR

Prints the string STR to standard output.


type
Usage: type EXP

Returns the type of the expression EXP. For
example, "echo (type (vec 1.0 2.0 3.0))" will
print "vector" to the console.


noclip
Usage: noclip

Toggles noclip mode (moving through walls).


save
Usage: save
save nosound

Saves the game.


+=
Usage: += VAR X

Multiplies the environment variable VAR by X.
Note: The types of $VAR and X must agree.


debug_levs_dump
Usage: debug_levs_dump

Outputs how many chunks are on each level.


telehome
Usage: telehome

Teleports you back to your EMERGENCY waypoint.


alias
Usage: alias ALIAS_NAME CMD_STRING

Adds a new alias called ALIAS_NAME which
evaluates to the command CMD_STRING. Although an
existing alias can be replaced by a new alias, a
command cannot be replaced.


exec
Usage: exec COMMAND_STR

Executes the command stored by COMMAND_STR. For
example, "exec $foo" will execute the command
string stored in the environment variable foo.


dumpenv
Usage dumpenv

Prints all of the environment variables to
standard output.


not
Usage: not BOOL

Returns the negation of the bool BOOL.


man
Usage: man ENV_VAR

Displays the documentation for the given
environment variable.


cheat
Usage: cheat PASSWORD
cheat PASSWORD nosound
cheat off
cheat chpasswd newpassword

Enables cheat codes if password is correct. Or
disables cheat codes if "cheat off" is used. Can
change the password using "cheat chpasswd".


grow
Usage: grow

Grows player to the level that is one coarser.


gendoc
Usage: gendoc

Generates an html file with documentation about
all commands.


screenshot
Usage: screenshot

Takes a screenshot and saves to
"Output/Screenshots/" folder.


gen
This is an alias for the command
"toggle game.package.genesis".


debug_wc_dump
Usage: debug_wc_dump
Prints information about the "chunk changes" objects (wc stands for "world changes").

A chunk changes object stores all changes that
have been made to a chunk since the begining of
the player's game (game time zero). When a
player saves the game, these objects are written
to "chunk files" on the hard drive and the chunk
changes objects are destoyed.


debug_cf_dump
Usage: debug_cf_dump

Outputs the number of chunk files, and their
revert times.


close
Usage: close

Closes the game, but does not exit the program.


clear
Usage: clear

Clears the console screen.


saveexit
Usage: saveexit

Saves the game and then immediately exists the
program.


*=
Usage: *= VAR F

Multiplies the environment variable VAR by the
float F.


load
Usage: load

Loads the last saved game.


path
Usage: path
path last
path pos
path dump

path hex The command "path last" prints the name
of the Lua script for the chunk containing the
viewer. The command "path" prints the names of
the scripts for all chunks in the path from the
root of the chunk tree to the viewer. The
command "path listpos" does with list does but
also prints the chunk path from the root. The
command "path dump" prints the chunk path to the
file Output/path.txt". The command "path hex"
prints the path from the root of the chunk tree.


echo
Usage: echo STRING

Prints the string STRING to the console.


pathpink
Usage: pathpink

The command "pathpink" prints the name of the
chunks containing the viewer, with two
modifications. First: if you were to use Pink
Rings, the chunk you would be teleported to is
displayed in pink. Second: if you were to use
Blue Rings, you would be teleported towards the
root of the tree to a "Top Chunk", at which point
you will be teleported down. The Top Chunk is
displayed in blue.


debug_chunk_dump
Usage: debug_chunk_dump

Dumps information about the chunk that contains
the player. The commands "path" and "script"
also dump useful information about that chunk.