AssaultCube Documentation

CubeScript

CubeScript is the scripting language of AssaultCube and it is similar to scripting languages of other games, except that its a bit more powerful because it is almost a full programming language.

CubeScript consists of the command itself, followed by any number of arguments separated by whitespace. You can:

It is recommended to read examples of this in your ./config/ folder to understand them better. The documentation below contains a reference of ALL of the CubeScript commands at your disposal. Have fun!

CubeScript

This section describes identifiers that are closely related to the CubeScript language.

- A B
Performs a subtraction.
ArgumentDescriptionValues
Athe minuend
Bthe subtrahend

Return value: the difference

-= A B
Subtracts a value from an alias.
ArgumentDescriptionValues
Athe alias to subtract from
Bvalue to be subtracted
Example: -= foo 1337
-=f A B
Subtracts a floating-point value from an alias.
ArgumentDescriptionValues
Athe alias to subtract from
Bvalue to be subtracted
Example: -=f foo 13.37
-f A B
Subtracts two floating-point numbers.
ArgumentDescriptionValues
Athe minuendfloat
Bthe subtrahendfloat

Return value: the difference

! A
Performs a negation.
ArgumentDescriptionValues
Aargument
!= A B
Determines if two values are not equal.
ArgumentDescriptionValues
Afirst value
Bsecond value

Return value: the inequality, 1 (not equal) or 0 (equal)

!=f A B
Determines if the first floating-point value is not equal to the second floating-point value.
ArgumentDescriptionValues
Athe first value
Bthe second value

Return value: (true)1||0(false)

!b A
Performs the operation NOT using binary arithmetic on integer values (32-bit signed).
ArgumentDescriptionValues
Aargument
Integer values are 32-bit signed values, so for example "echo (!b 1)" returns "-2".
See also: &b, |b, ^b
* A B
Performs a multiplication 2 or more numbers.
ArgumentDescriptionValues
Athe multiplicand
Bthe multiplier(s)

Return value: the product

*= A B
Multiplies an alias by a value.
ArgumentDescriptionValues
Athe alias to be multiplied
Bthe multiplier
Example: *= foo 1337
*=f A B
Multiplies an alias by a floating-point value.
ArgumentDescriptionValues
Athe alias to be multiplied
Bthe multiplier
Example: *=f foo 13.37
*f A B
Performs a floating point multiplication 2 or more numbers.
ArgumentDescriptionValues
Athe multiplicand
Bthe multiplier(s)

Return value: the product

\f N
Adds color to a string.
ArgumentDescriptionValues
Ncolor id0-9, A-Z
The whole string has to be included in quotes.

Example: echo "\f3Hello \f0world!"Output: a red "Hello" and a green "world!"

See also: cncolumncolor
&& A B
Logical AND.
ArgumentDescriptionValues
Afirst value
Bsecond value

Example: echo (&& 1 1)Output: 1

Example: echo (&& 1 0)Output: 0

Return value: A AND B

&b A B
Performs the operation AND using binary arithmetic on integer values (32-bit signed).
ArgumentDescriptionValues
Athe first argument
Bthe second argument
See also: |b, ^b, !b
^b A B
Performs the operation XOR using binary arithmetic on integer values (32-bit signed).
ArgumentDescriptionValues
Athe first argument
Bthe second argument
See also: &b, |b, !b
+ A B
Performs an addition 2 or more numbers.
ArgumentDescriptionValues
Athe first summand
Bthe summand(s)
Example: echo the sum of x and y is (+ $x $y)

Return value: the sum

+= A B
Adds a value to an alias.
ArgumentDescriptionValues
Athe alias to add to
Bvalue to be added
Example: += foo 1337
+=f A B
Adds a floating-point value to an alias.
ArgumentDescriptionValues
Athe alias to add to
Bvalue to be added
Example: +=f foo 13.37
+f A B
Adds up two or more floating-point numbers.
ArgumentDescriptionValues
Athe first summandfloat
Bthe summand(s)float

Return value: the sum

< A B
Determines if a value is smaller than a second value.
ArgumentDescriptionValues
Athe first value
Bthe second value

Return value: the comparison, 1 (smaller) or 0 (not smaller)

<= A B
Determines if a values is less than or equal to a second value.
ArgumentDescriptionValues
Athe first value
Bthe second value
<=f A B
Compares if a particular floating-point value is less than or equal to another floating-point value.
ArgumentDescriptionValues
AThe first value.
BThe second value.

Return value: (true)1||0(false)

<f A B
Compares if a particular floating-point value is smaller than another floating-point value.
ArgumentDescriptionValues
AThe first value.
BThe second value.

Return value: (true)1||0(false)

= A B
Determines if two values are equal.
ArgumentDescriptionValues
Afirst value
Bsecond value

Example: echo there are only (concatword (= 1 1) (= 1 0)) types of people in the worldOutput: there are only 10 types of people in the world

Return value: the equality, 1 (equal) or 0 (not equal)

=f A B
Compares if a particular floating-point value is equal to another floating-point value.
ArgumentDescriptionValues
AThe first value.
BThe second value.

Return value: (true)1||0(false)

> A B
Determines if a value is bigger than a second value.
ArgumentDescriptionValues
Athe first value
Bthe second value

Return value: the comparison, 1 (bigger) or 0 (not bigger)

>= A B
Determines if a values is greater than or equal to a second value.
ArgumentDescriptionValues
Athe first value
Bthe second value
>=f A B
Determines if the first floating-point value is greater than or equal to the second floating-point value.
ArgumentDescriptionValues
Athe first value
Bthe second value

Return value: (true)1||0(false)

>f A B
Determines if the first floating-point value is greater than the second floating-point value.
ArgumentDescriptionValues
Athe first value
Bthe second value

Return value: (true)1||0(false)

|| A B
Logical OR.
ArgumentDescriptionValues
Afirst value
Bsecond value

Example: echo (|| 1 0)output: 1

Example: echo (|| 0 0)output: 0

Return value: A OR B

|b A B
Performs the operation OR using binary arithmetic on integer values (32-bit signed).
ArgumentDescriptionValues
Athe first argument
Bthe second argument
See also: &b, ^b, !b
This will append the passed 2nd argument to any existing content of the alias named in the 1st argument.
ArgumentDescriptionValues
Athe alias to add to
Ethe new element to add
Several popular aliases have predefined shortcuts using this scriptalias: addOnLoadOnce, addOnLoadAlways. Check config/scripts.cfg for possible omissions in that list.

Example: foo = "one" add2alias foo two echo foo Output: one twoThis will output the string and override any other actions that might've been defined.

See also: add2bind, add2list
Appends a new element to a list.
ArgumentDescriptionValues
Athe alias (list) to add to
Ethe new element to add

Example: tmp_list = []; add2list tmp_list Hello; add2list tmp_list world!; echo $tmp_listOutput: Hello world!

See also: add2alias, add2bind
Injects cubescript punctuation.
ArgumentDescriptionValues
Sa string
NID or name0 (quotes), 1 (brackets), 2 (parenthesis), 3 (_$_), 4 (quote), 5 (percent)

Example: echo (addpunct hello)Output: "hello"

Example: echo (addpunct hello 1)Output: [hello]

Example: echo (addpunct hello 2)Output: (hello)

Example: echo (addpunct hello 3)Output: $hello

Example: test = (concat echo (addpunct fov 3)); testOutput: 90.0

alias N A
Binds a name to commands.
ArgumentDescriptionValues
Nthe name of the aliasstring, must not contain '$'
Athe commandsstring

Example: alias myalias [ echo "hello world"; alias myalias [ echo "I already said hello" ] ]It is possible to re-bind an alias, even during its evaluation.

Example: test = [ echo "successful" ]There is also the shorthand version of defining an alias via the "=" sign.

Initializes a group of aliases using checkinit.
ArgumentDescriptionValues
Lthe list of aliases to check for
Bthe block of code to ensure the aliases contain (optional)
at S N
Grabs a word out of a string.
ArgumentDescriptionValues
Sthe string
Nthe index of the word
Negative index number returns "".

Example: echo (at "zero one two three" 2)output: two

Return value: the word from the specified idex

Aborts a loop created with a 'loop', 'looplist' or 'while' command.

Example: loop i 10 [ if (= $i 4) [ break ]; echo $i]output: 0 1 2 3

See also: continue, loop, while
ceil F
Upper value of a float number.
ArgumentDescriptionValues
Fthe float number to get the ceil from

Return value: the ceil value (integer)

Defines an alias only if it does not already exist.
ArgumentDescriptionValues
Aalias name
Valias value
Uses check2init on a list of aliases.
ArgumentDescriptionValues
Llist of alias names
Valias value
Determines if the argument given is an existing alias or not.
ArgumentDescriptionValues
Athe alias to check for

Example: hello = ""; echo (checkalias hello)Output: 1

Example: echo (checkalias oMgThIsAlIaSpRoLlYdOeSnTeXiSt)Output: 0

See also: checkinit, aliasinit
Ensures the initialization of an alias.
ArgumentDescriptionValues
Athe alias to check for
Bthe block of code to ensure that the alias contains (optional)

Example: checkinit mapstartalwaysOutput: if alias mapstartalways does not exist, this command initializes it.

Example: checkinit mapstartalways [ echo New map, good luck! ]Output: if alias mapstartalways does not exist, it is initialized, and if the block of code "[ echo New map, good luck! ]" does not exist within the aliases contents, this command adds it.

concat S ...
Concatenates multiple strings with spaces inbetween.
ArgumentDescriptionValues
Sthe first string
...collection of strings to concatenate

Example: alias a "hello"; echo (concat $a "world")output: hello world

Return value: The newly created string

concatword S ...
Concatenates multiple strings.
ArgumentDescriptionValues
Sthe first string
...collection of strings to concatenate
The newly created string is saved to the alias 's'.

Example: alias a "Cube"; echo (concatword $a "Script")output: CubeScript

Return value: The newly created string

const N A
Set an alias as a constant.
ArgumentDescriptionValues
Nthe name of the aliasstring, must not contain '$'
Athe value (optional)string
A constant cannot be redefined in the same AC session: its value cannot be changed. To get rid of a constant, use "delalias".
Constant alias is temporary that will not be written to saved.cfg, and thus will not persist after quitting.

Example: myalias = myvalue; const myalias;Set "myalias" value to "myvalue" then "lock" it as a constant.

Example: const myalias myvalue;You can directly set a value for your alias when you define it as a constant.

Example: const myalias myvalue; myalias = anothervalue;Assigning a value to a const will throw you an error. Output: myalias is already defined as a constant

See also: alias, tempalias, isconst
Skip current loop iteration.

Example: loop i 5 [ if (= $i 2) [ continue ]; echo $i]output: 0 1 3 4

See also: break, loop, while
Deletes the passed alias.
ArgumentDescriptionValues
Nthe name of the aliasstring, must not contain '$'
div A B
Performs an integer division.
ArgumentDescriptionValues
Athe dividend
Bthe divisor

Return value: the quotient (integer)

div= A B
Divides an alias by a value.
ArgumentDescriptionValues
Athe alias to be divided
Bthe divisor
Example: div= foo 1337
div=f A B
Divides an alias by a floating-point value.
ArgumentDescriptionValues
Athe alias to be divided
Bthe divisor
Example: div=f foo 13.37
divf A B
Performs a division with floating-point precision.
ArgumentDescriptionValues
Athe dividend
Bthe divisor

Return value: the quotient (floating-point)

Interactively edits an alias in the console buffer.
ArgumentDescriptionValues
Aalias to editthe alias name, without $
This takes the current value of the alias, and inserts it into the command line / text entry box.
If the alias doesn't exist, it is created.

Example: alias test "Hello World"; editalias testResult: edit test: Hello World

Interactively edits an existing alias in the console buffer.
ArgumentDescriptionValues
Aalias to editthe alias name, without $
This takes the current value of the existing alias, and inserts it into the command line / text entry box.

Example: alias test "Hello World"; editsvar testResult: edit test: Hello World

Lists all persistent aliases that start with prefix.
Returns a table with two entries per alias: 1) full name and 2) name without prefix.
See also: alias
Replaces control characters in a string with escaped sequences.
ArgumentDescriptionValues
Sstring to escape

Example: echo (escape (concat (c 3) "Hello World"))Output: "\f3Hello World"

Executes the specified string as cubescript.
ArgumentDescriptionValues
Sthe string to execute

Example: execute (concat echo (addpunct fov 3))Example output: 90.0

Searches a list for a specified value.
ArgumentDescriptionValues
Lthe list
Ithe item to find

Return value: the index of the item in the list

Floor value of a float number.
ArgumentDescriptionValues
Fthe float number to get the floor from

Return value: The floor value (integer)

Forcibly sets a list of aliases to a specified value.
ArgumentDescriptionValues
Llist of alias names
Valias value

Example: alias1 = 0; alias2 = 0; alias3 = 0; alias4 = 0; alias 5 = 0Can be written as:

Example: forceinit [alias1 alias2 alias3 alias4 alias5] 0

format F V
Replaces "%" format specifiers in the string by the values specified in subsequent arguments.
ArgumentDescriptionValues
Fformatuse %1..%9 for the values
Vvalue(s)
In addition, it allows access to more than nine parameters. Parameter numbers of 10 and higher have to be prefixed with an additional zero. For example "%010" accesses parameter number ten.

Example: echo (format "%1 bottles of %2 on the %3, %1 bottles of %2!" 99 beer wall)output: 99 bottles of beer on the wall, 99 bottles of beer!

See also: format2
format2 F V
Replaces "%" format specifiers in the string by the values specified in subsequent arguments.
ArgumentDescriptionValues
Fformatuse %1..%9 for the values
Vvalue(s)
Like "format" command, but all parameters are treated as lists and are exploded first.
In addition, it allows access to more than nine parameters. Parameter numbers of 10 and higher have to be prefixed with an additional zero. For example "%010" accesses parameter number ten.

Example: echo (format "_%1_%2_%3_%4_%5_" "A B C" D E F)output: _A B C_D_E_F__

Example: echo (format2 "_%1_%2_%3_%4_%5_" "A B C" D E F)output: _A_B_C_D_E_

See also: format
Returns the value of the alias.
ArgumentDescriptionValues
Nalias name
Gets range attribute for builtin variable.
ArgumentDescriptionValues
Wwhatmin, max, default
Nthe name of any builtin variable (integer or float)
See also: getalias
h0 P V
Returns value as string of hexadecimal digits, padded with leading zeros to a given minimum length (precision).
ArgumentDescriptionValues
Pprecision
Vvalue

Example: echo (h0 2 1024)Output: 400

Example: echo (h0 4 1024)Output: 0400

Example: echo (h0 6 1024)Output: 000400

Example: echo (h0 0 (&b 0xe 0x3))Output: 2

Example: echo (h0 0 (|b 0xe 0x3))Output: f

Example: echo (h0 0 (^b 0xe 0x3))Output: d

Example: echo (h0 0 (!b 0xe))Output: fffffff1

Example: echo (h0 0 (* -1 0xe))Output: fffffff2

See also: l0
if cond true false
Controls the script flow based on a boolean expression.
ArgumentDescriptionValues
condthe condition0 (false) or anything else (true)
truethe body to execute if the condition is true
falsethe body to execute if the condition is false

Example: if (> $x 10) [ echo x is bigger than 10 ] [ echo x too small ]

inputcommand I C P N
Makes an input perform a certain command.
ArgumentDescriptionValues
Iinput
Ccommand
Pprompt
Nnopersist
It opens a custom console buffer with custom prompt, initial buffer text and execution script (which gets the input buffer content in alias cmdbuf). If "nopersist" is not zero, the command will not be stored in console history.
Determines if the argument given is a constant or not.
ArgumentDescriptionValues
Athe alias to check for

Example: const hello ""; echo (isconst hello)Output: 1

Example: hello = value; echo (isconst hello)Output: 0

See also: const
Returns whether or not there is an identifier by that name.
ArgumentDescriptionValues
Nidentifier name
Isolates the given context.
ArgumentDescriptionValues
Ccontext (integer or name)CORE (0), CFG (1), PROMPT (2), MAPCFG (3), MDLCFG(4)
This disables access from this context to identifiers located in other contexts, also it removes all aliases created in this context once the running context changes.
l0 W V
Leading zeros for the number V to make it W chars wide.
ArgumentDescriptionValues
Wwidth
Vvalue
It may look like 10 - which might be considered a mnemonic - but it's lowercase-L and 0!

Example: echo (l0 5 1000)Output: 01000

Example: echo (l0 3 1000)Output: 1000

See also: h0
Returns the average of a list of numbers.
ArgumentDescriptionValues
Lthe list of numberssupports ints and floats

Example: echo (listaverage "2 5 5")Output: 4.0

returns the element count of the given list.
ArgumentDescriptionValues
Lthe list
Lists the argument options for several argument types.

Example: echo (listoptions) Output: "entities ents weapons teamnames teamnames-abbrv punctuations crosshairnames menufilesortorders texturestacktypes cubetypes"

Example: echo (listoptions teamnames)Output: "CLA RVSF CLA-SPECT RVSF-SPECT SPECTATOR"

loop V N body
Loops the specified body.
ArgumentDescriptionValues
Vthe alias used as counter
Nthe amount of loops
bodythe body to execute on each iteration
This command sets the alias you choose, as first argument, from 0 to N-1 for every iteration.

Example: loop i 10 [ echo $i ]

looplist V N body
Browses a list and executes a body for each element.
ArgumentDescriptionValues
Vthe list to browse
Nthe alias(es) containing the current element value
bodythe body to execute on each iteration
It works optionally with several variables.

Example: looplist "zero one two three" number [echo $number]

Example: looplist [0 "is knife" 1 "is pistol"] [n w] [echo weapon $n $w]

looplisti V N body
Browses a list and executes a body for each element.
ArgumentDescriptionValues
Vthe list to browse
Nthe alias(es) containing the current element value
bodythe body to execute on each iteration
The same as looplist, but it automatically counts the loops in "i", starting with 0. It works optionally with several variables.

Example: a = [u v w]; b = [x y z]; looplisti $a m [echo $m (at $b $i) $i]Output: u x 0 , v y 1 , w z 2

See also: break, continue, loop, looplist
mod A B
Performs a modulo operation.
ArgumentDescriptionValues
Athe dividend
Bthe divisor

Return value: the modulo value

modf A B
Performs a floating-point modulo operation.
ArgumentDescriptionValues
Athe dividend
Bthe divisor

Example: echo (modf 7.5 12.5)Output: 7.5

Example: echo (modf 17.5 12.5)Output: 5.0

Return value: the modulo value

The number of arguments passed to the current alias.
Description ValuesRangeDefault
numargs0..240
Controls whether aliases defined afterwards will be saved (1) or not (0).
ArgumentDescriptionValues
Bcontrol option1: persistent, 0: not persistent
Rules:
* aliases created by "const" and "tempalias" are never persistent;
* aliases created or altered by "alias" or "=" become persistent, if the "persistidents" flag is set during that operation;
* "persistidents" is false during the execution of almost all config files during game start - those files can create aliases with default values which will not be persistent (until changed later while the flag is set);
* before saved.cfg is executed, the flag is set and stays set all throughout the game - which means, that all changes (for example from menus or in console) will change the altered alias to "persistent";
* exceptions for map or model config files are unnecessary, since those run restricted and can't create aliases anyway;
* exceptions are necessary for "late run" config files like those in config/opt/ folder.
This command may be used to manually set or clear the flag. It also returns the current state of the flag. If used in a config file, the flag is restored to its original value when the file ends execution.
In short: only late-run config files (meaning: run after saved.cfg was restored) may need to manually set/reset the flag. Use "const" and "tempalias" where appropriate and clear "persistidents" before creating an alias with a not-to-save default value that may be changed and made persistent later.

Example: persistidents 0; foo = [ echo "bar"]foo will not be saved and has to be redefined when restarting AC.

Example: persistidents 1; bar = [ echo "foo"]bar will be saved and persistent across sessions.

See also: alias
pop A
Resets a previously pushed alias to it's original value.
ArgumentDescriptionValues
Aalias
It is allowed to use multiple arguments for "pop". So instead of "pop var_a ; pop var_b" you can write "pop var_a var_b". Also, "pop" will now give back the removed value of the first alias from the argument list. This allows using the pop'd value one last time.

Example: p = 1; push p 2; pop p; echo $pOutput: 1

See also: push
powf A B
Returns A raised to the power of B (floating-point).
ArgumentDescriptionValues
Athe mantissa
Bthe exponent

Return value: A raised to the power of B

push N A
Temporarily redefines the value of an alias.
ArgumentDescriptionValues
Nalias name
Aaction

Example: p = 1; push p 2; echo $pOutput: 2

See also: pop
Resets all current "sleep".
Sets the result value of a cubescript block.
ArgumentDescriptionValues
Rthe result
See also: execute
rnd A
Random value.
ArgumentDescriptionValues
Athe upper limit of the random value

Return value: the random value, larger or equal 0 and smaller than A

Rounds the given float.
ArgumentDescriptionValues
Fthe float number to round

Return value: the rounded integer, the precision is 1 unit

ArgumentDescriptionValues
Ccontext (integer or name)CORE (0), CFG (1), PROMPT (2), MAPCFG (3), MDLCFG(4)
Nid name
Secures this configuration for the rest of the game.
sleep N C P
Executes a command after specified time period.
ArgumentDescriptionValues
Nthe amount of milliseconds
Cthe command to execute
Pignore map change (optional)

Example: sleep 1000 [ echo foo ]Prints 'foo' to the screen after 1 second.

Returns a sorted version of a list.
ArgumentDescriptionValues
Llist to sort

Example: echo (sortlist [1 3 2])Output: 1 2 3

Generates an alias (list) of the current values for the given aliases/CVARs.
ArgumentDescriptionValues
Lthe list of aliases/CVARs
Athe alias to store them in

Example: storesets "sensitivity hudgun fov" tmpExample result: stores "3.000 1 120" into alias "tmp".

See also: getalias
strcmp A B
Determines if two strings are equal.
ArgumentDescriptionValues
Athe first string
Bthe second string

Example: if (strcmp yes yes) [echo the two strings are equal] [echo the two strings are not equal]Output: the two strings are equal

Return value: the equality, 1 (equal) or 0 (unequal)

See also: strstr
Returns the length (in characters, including whitespace) of string S.
ArgumentDescriptionValues
Sstring

Example: echo (strlen "Hello world!")Output: 12

See also: substr
strreplace S T N
Returns a string, with a portion of it replaced with a new sub-string.
ArgumentDescriptionValues
Sthe original string to modify
Tthe target sub-string to replace
Nthe new sub-string to replace the target

Example: echo (strreplace "Hello cruel world" cruel "")Output: Hello world

See also: substr
strstr A B
Determines if string B was found in string A.
ArgumentDescriptionValues
Athe first string
Bthe second string
It returns position of string B in string A (counting from 1) or zero, if not found.

Example: if (strstr "Hello world!" Hello) [echo found Hello in Hello world!] [echo did not find Hello in Hello world!]Output: found Hello in Hello world!

Return value: integer, 0 (not found) or position (if found)

See also: strcmp
substr S A L
Copies a substring out of the original.
ArgumentDescriptionValues
Sthe original string
Astart position
Lsubstring length (optional)
Character indexes begins at 0. If "start position" is negative, the reference is the end of the string. It also counts negative length from total length, if "substring length" parameter is negative.

Example: echo (substr abcdefgh 2 5)Output: cdefg

Example: echo (substr abcdefgh -3 2)Output: fg

Example: echo (substr abcdefgh 2)Output: cdefgh

Example: echo (substr abcdefgh 1 -2)Output: bcdefg

Return value: the substring

switch I C
Takes an integer argument to determine what block of code to execute.
ArgumentDescriptionValues
Iinteger
Ca variable number of 'case' arguments...
This command can only handle up to 23 'cases' (because of cubescript's 24 argument limit).

Example: switch 2 [echo case 0] [echo case 1] [echo case 2] [echo case 3] [echo case 4]Output: case 2

Creates a temporary alias that will not be written to saved.cfg, and thus will not persist after quitting.
ArgumentDescriptionValues
Ntemporary alias name
Ccubescript command(s)
See also: alias, const
Tests a character argument for various things.
ArgumentDescriptionValues
Cthe character to test
Ntype of test to runmin 0/max 7/default 0
See the following c++ functions for more information about the usage of this command:
isalpha(), isalnum(), isdigit(), islower(), isprint(), ispunct(), isupper(), and isspace()

Example: echo (testchar 1)Output: 1 // It is a 0-9 digit

Example: echo (testchar a 1)Output: 1 // It is a a-z or A-Z character

Example: echo (testchar z 2)Output: 1 // It is a a-z or A-Z character or 0-9 digit

Example: echo (testchar b 3)Output: 1 // It is a lowercase a-z character

Example: echo (testchar B 4)Output: 1 // It is a uppercase A-Z character

Example: echo (testchar , 5)Output: 1 // It is a printable character

Example: echo (testchar . 6)Output: 1 // It is a punctuation character

Example: echo (testchar " " 7)Output: 1 // It is a whitespace character

Converts a string to all lowercase characters.
ArgumentDescriptionValues
Sa string

Example: echo (tolower HELLO)Output: hello

See also: toupper
Converts a string to all uppercase characters.
ArgumentDescriptionValues
Sa string

Example: echo (toupper hello)Output: HELLO

See also: tolower
while cond body
Loops the specified body while the condition evaluates to true.
ArgumentDescriptionValues
condthe conditionthe code evaluated before each iteration
bodythe body to execute on each iteration
This command sets the alias "i" from 0 to N-1 for every iteration. Note that the condition here has to have [], otherwise it would only be evaluated once.

Example: alias i 0; while [ (< $i 10) ] [ echo $i; alias i (+ $i 1) ]

See also: break, continue, loop

General

This section describes general identifiers.

Adds a packages source server where to download custom content from.
ArgumentDescriptionValues
SThe server address. Trailing slash not needed.
Ppriority of the server
Only add servers you trust.
The list of servers is saved into config/pcksources.cfg on game quit.
If a priority is given, it influences the sorting of servers. Servers with higher priority are queried first. If servers have the same priority, they are sorted by ping. Default priority is zero.

Example: addpckserver http://packages.ac-akimbo.net

Add the zip package file "mods/zipname.zip" to the virtual file system.
ArgumentDescriptionValues
Nthe name of the zip mod
Add the zip package file "mods/zipname.zip" to the virtual file system. Only files below the path "packages/" are added (and also files below "config/", if zipname starts with "###"). If the size of the zip file is below "zipcachemaxsize", the whole zip file is cached in memory. (Un-cached zip files are kept open at all time, so caching keeps the number of simultaneously opened files lower.)
If defined, this will be executed after saved.cfg is loaded.
Enables or disables the ability of hudecho to output text to the heads up display.
Token Description ValuesRangeDefault
N0 off, 1 on0..11
See also: hudecho
Toggles the showing of the "Apply changes now?" menu when changing certain graphical settings.
Token Description ValuesRangeDefault
N1 = show, 0 = don't show0..11
Determines if the game should try to download missing packages such as textures or mapmodels on the fly.
Token Description ValuesRangeDefault
VNote: This is turned on by default0..11
When the variable autodownloaddebug is set to 1 and/or in debug binaries, more debug output is produced.
Token Description ValuesRangeDefault
VAdd debug info to autodownload0..10
If defined, this will be executed after autoexec.cfg is loaded.
Determines if the current played map should be automatically downloaded if it is not available locally.
Token Description ValuesRangeDefault
Benable auto map download0..11
Automatically get new map revisions from the server.
Token Description ValuesRangeDefault
N0: no, 1: yes0..10
Toggle for taking an automatic screenshot during intermission.
Token Description ValuesRangeDefault
B0=Off, 1=On0..11
Takes a "clean" screenshot with no HUD items.
Your current HUD configuration is stored into a buffer, and is re-enabled afterwards.
Sets the correction value for clockfix.
Token Description ValuesRangeDefault
Vcorrection value990000..10100001000000
Engine source-code snippet (main.cpp): if(clockfix) millis = int(millis*(double(clockerror)/1000000));
See also: clockfix
Enables correction of the system clock.
Token Description ValuesRangeDefault
Benable correction0..10
See also: clockerror
complete C P E
ArgumentDescriptionValues
Ccommandany command or alias
Ppathpath to search
Eextensionextension to match
The completion will work on the first word of your console input.

Example: complete demo "demos" dmoIf you enter "/demo " and press TAB you will cycle through all available demos.

Example: alias mapcomplete [complete $arg1 "packages/maps" cgz]Helper alias for quickly adding complete-definitions for all gamemodes - see config/script.cfg (below "Auto-completions").

Returns text from the last line in the console.
Indicates if a connection to a server exists.
Description ValuesRangeDefault
the connection state1 (connected), 0 (disconnected)0..10
Indicates the state of the console.
Description ValuesRangeDefault
console state0: closed, 1: open in an alternate size, 2: open regularly0..20
Allows to browse through the console history by offsetting the console output.
ArgumentDescriptionValues
Nthe offset


default keys:

- on the keypad - scrolls backwards the console (conskip 5)

+ on the keypad - scrolls forwards the console (conskip -5)

* on the keypad - resets the console (conskip -1000)

'# or \' + mouse scroll - scrolls the console

Compare given version to current version.
ArgumentDescriptionValues
snewest available version
Will show update notifications if the given version is higher than the running one.
Representation of date.
Format: Www Mmm dd hh:mm:ss yyyy
Use timestamp to create your own formatting.

Example: echo (datestring) "Sat Jun 7 17:08:35 2008"

Output statistics and errors when handling zip compressed data.
Token Description ValuesRangeDefault
Bboolean1:yes0..10
Advanced usage: may be helpful in debugging map files not loading.
Dumps all command arguments to STDOUT.
ArgumentDescriptionValues
......
Whether or not to output input events.
Token Description ValuesRangeDefault
Tthreshhold0:off,1/2:on0..20
If set to at least 1 all events will output their type number. Window events and mouse button/wheel events will output status information.
If set to 2 the KEYUP, TEXTINPUT and MOUSEMOVE events will trigger status output too.
See also:
Sets the formatstring for demo filenames.
ArgumentDescriptionValues
Sstring
we use the following internal mapping of formatchars:
%g : gamemode (int) ; %G : gamemode (chr) ; %F : gamemode (full) ;
%m : minutes remaining ; %M : minutes played ;
%s : seconds remaining ; %S : seconds played ;
%h : IP of server ; %H : hostname of server (client only) ;
%n : mapname ;
%w : timestamp "when" (formatted by demotimeformat) .
See also: demotimeformat
Sets the formatstring for demo timestamp.
ArgumentDescriptionValues
Sstringstrftime format
If the string starts with 'U', UTC is used - otherwise local time.
The same format options as in strftime().
Disconnect from a server making us load an incompatible map.
Token Description ValuesRangeDefault
Bboolean1:yes0..11
Maps that have not been converted to the new entity attribute scaling map format can cause this.
Edit it offline and make use of the config/opt/convmap.cfg.
echo L
Outputs text to the console.
ArgumentDescriptionValues
LList of strings
See also: hudecho
Lists files in a directory.
ArgumentDescriptionValues
Ppath to directory
Eextension
If extension is specified, only files of that extension are listed.
If the extension is "dir", only directories are listed.
exec C
Executes all commands in a specified config file.
ArgumentDescriptionValues
Cthe config file
It also allows to pass arguments to and deliver results from script files - when a script file is executed, any additional arguments are passed as execarg1..execargX to the script. The number of arguments is in execnumargs and if the script in the file sets the value of execresult, the exec command returns that value.
Example:
if there is a file testscript.cfg with this content: execresult = (* $execarg1 $execarg2)
then the command: "echo (exec testscript.cfg 6 7)" will output "42".
Executes all commands in all config files in the specified directory.
ArgumentDescriptionValues
sthe directory path from the assaultcube root

Example: execdir scripts

See also: exec
Returns a list of values describing the current engine (rendering) state.
It will only be filled after the first frame was drawn.
The list is: FPS LOD WQD WVT EVT
FPS = Frames Per Second
LOD = Level Of Detail
WQD = World QuaD Count
WVT = World VerTex Count
EVT = Extra VerTex Count (HUD & menu)

Example: echo (getEngineState)

Returns a table with four columns of all configured package servers.
The columns are: host name, priority, ping and resolved. "resolved" is a flag, indicating, if the server answered the ping during game start.
Returns the file extension of the client's current screenshottype setting.

Example: echo (getscrext)Example output: .jpg

See also: screenshottype
Controls how many variables (with similar names) are grouped together on one line in saved.cfg.
Token Description ValuesRangeDefault
NVariables per line0..104
This only pertains to commented variables in saved.cfg caused by omitunchangeddefaults being 0.
Executes the specified command in the command line history.
ArgumentDescriptionValues
Nthe N'th command from the history
For example, binding "history 1" to a key allows you to quickly repeat the last command typed in (useful for placing many identical entities etc.)
Outputs text to the console and heads up display.
ArgumentDescriptionValues
LList of strings
See also: allowhudechos, echo
Sets the JPEG screenshot image quality.
Token Description ValuesRangeDefault
NCompression level10..10070
The image quality is set by it's compression level, a value of 10 sets maximum compression and a small file size but results in a bad quality image
while a value of 100 results in a large file but gives the best quality image.
Sets the language for which a translated server MOTD will be fetched, if the server has one for this language.
Token Description ValuesRangeDefault
Lthe language code..
This is always a two-letter language code as defined in the ISO 639 standard, three-letter codes are currently not allowed.
If lang is not set, or if the server does not have a matching MOTD file, it will fall back to English.
Note: this does not affect the client language, which is derived from the system settings (e.g. on many *nix systems, it may be changed via the "LANG" environment variable).

Example: en, de, fr, ...

Saves an image of the entire radar-overview of the map.
Sets the total number of text lines from the console to store as history.
Token Description ValuesRangeDefault
V10..1000200
Sets how many typed console commands to store.
Token Description ValuesRangeDefault
NTotal of stored commands0..100001000
This value sets how many command lines to store in memory, everytime a command is entered it gets store so it can be recalled using the "/" key along with the arrow keys to scroll back and forth through the list.
Returns the number of milliseconds since engine start.

Example: echo (millis)

Return value: the milliseconds

Enables output of processed network packets.
Token Description ValuesRangeDefault
Benable network debugging0..10
This variable only has an effect if the client binary is compiled in debug mode.
Hold the current number of lines on the console.
Omit unchanged default binds from saved.cfg.
Token Description ValuesRangeDefault
N0 = print; 1 = print, but commented out; 2 = omit0..21
Omit variables with unchanged default values from saved.cfg.
Token Description ValuesRangeDefault
N0 = print, but commented out; 1 = omit0..11
If this value is 1, variables that are at their default values are omitted from saved.cfg. If 0, the variables are written to saved.cfg, but commented out.
Toggles physics interpolation.
Token Description ValuesRangeDefault
B0..11
Sets the PNG screenshot file compression.
Token Description ValuesRangeDefault
NCompression level0..99
A value of 9 sets maximum data compression and a smaller file size while a value of 0 results in a large file image, quality is always the same since PNG its a loosless format.
Gets an integer representing the game protocol. READ ONLY
As example, the protocol of version 1.2.0.2 is represented as value 1201.
Quits the game without asking.
Determines if all settings should be reset when the game quits.
Token Description ValuesRangeDefault
Benable reset0..10
It is recommended to quit the game immediately after enabling this setting. Note that the reset happens only once as the value of this variable is reset as well.
See also: resetbinds, quit
Resets the list of packages source servers where to download custom content from.
Restart AssaultCube to take the effect.
Clears the list of secured maps.
See also: securemap
run N
Executes a config file within "config" folder.
ArgumentDescriptionValues
Nthe file name (without extension)
Puts a prompt on screen.
ArgumentDescriptionValues
S...the text to display in the prompt (optional)
This puts a prompt on screen that you can type into, and will capture all keystrokes until you press return (or ESC to cancel). If what you typed started with a "/", the rest of it will be executed as a command, otherwise its something you "say" to all players.


default keys:

T - opens empty prompt

` or / or ^ - opens a command prompt /

Y - opens a command prompt % (for team chat)

Tab - autocompletes forwards commands/variables/aliases

left Shift + Tab - autocompletes backwards commands/variables/aliases

left Shift + Esc - resets the commandline to the state before using TAB-completion

Up Arrow - browse forwards command history

Down Arrow - browse backwards command history

Takes a screenshot.
Screenshots are saved to "screenshots/[date]_[time]_[map]_[mode].[ext]", where [ext] is the image type selected.


default key: F12
See also: cleanshot
Scales screenshots by the given factor before saving. 1 = original size, 0.5 = half size, etc.
Token Description ValuesRangeDefault
SScale0.1..11
Toggle format of screenshot image. Your choice is for BMP (0), JPEG (1) or PNG (2).
Token Description ValuesRangeDefault
T0=BMP, 1=JPEG, 2=PNG0..21
See also: getscrext
Adds a map to the list of secured maps.
ArgumentDescriptionValues
Sthe name of the map
Secured maps can not be overwritten by the commands sendmap and getmap.
ArgumentDescriptionValues
TText to put in the clipboard.
Seconds since the epoch (00:00:00 UTC on January 1, 1970).

Example: echo (systime)

Determines how fast network throttling accelerates.
Token Description ValuesRangeDefault
Vacceleration0..322
Determines how fast network throttling decelerates.
Token Description ValuesRangeDefault
Vdeceleration0..322
Determines the interval of re-evaluating network throttling.
Token Description ValuesRangeDefault
Vintervalseconds0..305
A list of values for current time.
Format: YYYY mm dd HH MM SS

Example: echo (timestamp) "2008 08 08 08 08 08"

Example: echo (timestamp) "2063 04 05 12 00 00"

Example: echo (at (timestamp) 0) (at (timestamp) 2) (at (timestamp) 1) "2063 05 04"

The current time in (H)H:MM:SS format.

Example: echo (timestring) "12:34:56"

Example: echo (timestring) "1:02:03"

Gets an integer representing the game version. READ ONLY
As example, version 1.2.0.2 is represented as value 1202.
See also: current_version
Writes current configuration to config/saved.cfg - automatic on quit.
Maximal size of the file, which is cached in memory.
Token Description ValuesRangeDefault
Ssize [kB]0..1024512
If the size of the zip file is below "zipcachemaxsize", then during loading the whole zip file is cached in memory. When the size is greater, then zip is just opened as a file and read from disk.
See also: addzipmod
Removes all zip files from the virtual file system.
Reads and returns the first 11 lines from the file "desc.txt" in the named zip file.
ArgumentDescriptionValues
Nthe name of the zip mod
The first line is supposed to contain a descriptive title for the zip (for use in menus) and the next 10 lines should contain a more detailed description (also for use in menus). The command also unpacks "preview.jpg" from the zip and mounts it as a temporary file under the name "packages/modpreviews/zipname.jpg".
Returns the list of files contained in a zip file.
ArgumentDescriptionValues
Nthe name of the zip mod
Returns the revision number of the zip file.
ArgumentDescriptionValues
Nthe name of the zip mod
The number is supposed to be part of a filename: "revision_n". If no such file is found in the zip file, the return value is zero. The content of the revision file is not relevant and a file size of zero is recommended.
Lists zip files in "mods/".
ArgumentDescriptionValues
Wwhatall, active, inactive
By default or if "what" is "all", all zips are listed. If "what" is "active", only those zips, that are already in use, are listed. If "what" is "inactive", only the unused zip files are listed.
Removes one zip file from the virtual file system.
ArgumentDescriptionValues
Nthe name of the zip mod

Gameplay

This section describes gameplay related identifiers.

Whether or not to automatically switch to akimbo upon pickup.
Token Description ValuesRangeDefault
Bboolean1:yes0..11
If you are brandishing your pistol while walking over the pickup you will switch to akimbo every time.
Sets the behavior of weapon switching upon akimbo expiration.
ArgumentDescriptionValues
switch to knife0
stay with pistol1
switch to grenades2
switch to primary3
If no ammunition is detected for the target weapon, it will fallback to the previous weapon until it finds a weapon with ammunition to use.
Fires the current weapon.


default key: left mouse button
Indicates if the weapons should be reloaded automatically.
Token Description ValuesRangeDefault
Bthe autoreload state0: off, 1: on0..11
See also: reload
Moves the player backward.


default key: S or Down Arrow
Moves from active team to spectator during match.
Sets the firing mode of automatic weapons between full auto mode and burst fire mode.
ArgumentDescriptionValues
Nthe weapon number or name4 (subgun), 6 (assault), 8 (akimbo)
Sshots per burstSpecial values: 0: set weapon to full auto, -1: don't set, instead check and return shots per burst
ArgumentDescriptionValues
Ddeltahow many players to shift +/-
See also: setfollowplayer
Swaps your player to the enemy team.
See also: team
Determines if you have any ammunition available for the specified weapon. (uses magcontent and magreserve)
ArgumentDescriptionValues
Nthe weapon number or name0 (knife), 1 (pistol), 2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault), 7 (grenades), 8 (akimbo)
Clear list of ignored players.
ArgumentDescriptionValues
Aclient number, or -1 to clear the whole list
Omit the client number to clear the whole list.
Clears a list of muted players.
ArgumentDescriptionValues
Aclient number, or -1 to clear the whole list
Omit the client number to clear the whole list.
connect N O P
Connects to a server.
ArgumentDescriptionValues
Nthe address of the server (hostname or IP) (optional)
Othe port (optional)
Pthe server password (optional)
If the server name is omitted, the client will try to connect to an available server in the LAN. If the port is omitted or set to 0, the default port will be used.

Example: connect 127.0.0.1 555 myServerPassword

Connects to a server and tries to claim admin state.
ArgumentDescriptionValues
Nthe address of the server (hostname or IP) (optional)
Othe port (optional)
Pthe admin password
This command will connect to a server just like the command 'connect' and try to claim admin state. If the specified password is correct, the admin will be able to connect even if he is locked out by ban, private master mode or taken client slots. If successfully connected, bans assigned to the admin's host will be removed automatically. If all client slots are taken a random client will be kicked to let the admin in.
If the server name ist omitted, the client will try to connect to an available server in the LAN. If the port is omitted or set to 0, the default port will be used.

Example: connectadmin 127.0.0.1 777 myAdminPasswordconnect as admin on port 777 of localhost

Example: connectadmin "" 0 myAdminPasswordwill try to connect to a LAN server on the default port as admin with the given password of "myAdminPassword".

Triggers a crouch.


default key: left Shift
Returns the server's current autoteam state.
Returns the name of played demo.
See also: demo
Returns the current map being played.
See also: gamemode, map, mode
Current map revision number.
Returns the server's current mastermode state.
Returns the nick name of the local player.
See also: name
Returns the server's current pause state (1=paused, 0=resumed).
Returns the size of the players vector.
The return value includes the local player "(you)" and works in both singleplayer and multiplayer scenarios. It can be used, for example, in a loop to find all valid clients (players) on server. Note: it DOESN'T return current number of players.
See also: isclient
Returns the weapon-index the local player currently has selected as primary.
This is not the same as curweapon - which could be a grenade or the knife.
Returns information on the current server - if you're connected to one.
ArgumentDescriptionValues
Iinfo0, 1, 2, 3, 4, 5, 6, 7, 8
If I is 0 (omitted or any other value than the ones below) you will get a string with 'IP PORT'
If I is 1,2 or 3 you will get the IP, HostName or port respectively.
If I is 4 you get a string representing the current state of the peer - usually this should be 'connected'.
If I is 5 you will get a server name.
If I is 6 or 7 you will get a server description.
If I is 8, you will get a serverbrowser-line with the server - this is handled with caution, sometimes empty, #8 will be outdated w/o serverbrowser open.

Example: echo [I am (curserver 4) to (curserver 2)]Output: I am connected to ctf-only.assault-servers.net

Example: last_server = "" remember_server = [ if (strcmp (curserver 4) "connected") [ last_server = (curserver 0) echo "I'm remembering:" $last_server ] [ echo "you are not 'connected' - you" (concatword "are '" (curserver 4) "' !") ] ] bind PRINT [ if (strcmp $last_server "") [ remember_server ] [ say (concat "^L2I was just ^Lfon^L3" $last_server) last_server = "" ] ]This will either remember or retrieve the last server you pressed the PrintScreen-key on.

Returns the weapon-index the local player is currently holding.
demo S
Plays a recorded demo.
ArgumentDescriptionValues
Sthe demo name
Playback is interpolated for the player whose perspective you view.
See also: setmr, rewind, curdemofile
Leaves a server.
Downloads and loads the specified map from an available packages source server.
ArgumentDescriptionValues
Sthe name of the map
See also: getmap, sendmap
drawzone X1 X2 Y1 Y2 C
Draws a zone marker with the specified color and dimensions on the minimap/radar.
ArgumentDescriptionValues
X1X-coordinate - top-left corner
X2X-coordinate - bottom-right corner
Y1Y-coordinate - top-left corner
Y2Y-coordinate - bottom-right corner
Ca color for the zone, in hexadecimal notationdefault: 0x00FF00 (green)
This is primarily intended for the survival mode.
You can draw a few zones at a time. They will be reset (i.e. removed) once a new game starts.
Note that the coordinates must be specified as integers, not as floating-point values.
See also: resetzones, survival
Drops the taken flag.


default key: Backspace
Finds client number (cn) of player with given name.
ArgumentDescriptionValues
Nplayer name
Determines by how much to multiply the fly speeds by.
Token Description ValuesRangeDefault
Nthe multiplier1.0..5.02.0
Moves the player forward.


default key: W or Up Arrow
Sets the frag message corresponding to a weapon (appearing on the hud).
ArgumentDescriptionValues
Nthe weapon number or name0 (knife), 1 (pistol), 2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault), 7 (grenades), 8 (akimbo)
Mthe message you want to appearexample: sniped

Example: fragmessage sniper snipedIt will display "you sniped unarmed" on the hud when you frag unarmed with sniper.

See also: gibmessage, weapon
Sets the gamespeed in percent.
Token Description ValuesRangeDefault
Nthe game speed10..1000100
This does not work in multiplayer.
Returns the time (in milliseconds) of the currently played game. READ ONLY

Example: showtime = [ if (> $lastgametimeupdate 0) [ gmr = (- $gametimemaximum (+ $gametimecurrent (- (millis) $lastgametimeupdate))) gsr = (div $gmr 1000) gts = (mod $gsr 60) if (< $gts 10) [ gts = (concatword 0 $gts) ] [ ] gtm = (div $gsr 60) if (< $gtm 10) [ gtm = (concatword 0 $gtm) ] [ ] echo (concatword $gtm : $gts) remaining ] [ echo gametime not updated yet ] ]

Returns the maximum time (in milliseconds) of the currently played game. READ ONLY
Returns the time (in milliseconds) when the last map was loaded.
getdemo X P
Gets the recorded demo from a game on the server.
ArgumentDescriptionValues
Xnumber in list
Psubpath (optional)
If F10 is pressed earlier than two minutes into the game, the last game will be downloaded.
If F10 is pressed later than two minutes into the game, the current game is scheduled to be automatically downloaded when it ends.
See also: listdemos
getmap S C
Retrieves the last map that was sent to the server using 'sendmap'.
ArgumentDescriptionValues
Sthe name of the map
Ccubescript to execute once map is installed (optional)
If the command is passed an argument, different than the map being played, the game tries to download the specified map from an available packages source server.
See also: sendmap, dlmap
Try to download mods/modname.zip from all configured package servers.
ArgumentDescriptionValues
Nthe name of the mod
Does not automatically activate the mod.
See also: addzipmod
Sets the gib message corresponding to a weapon (appearing on the hud).
ArgumentDescriptionValues
Nthe weapon number or name0 (knife), 1 (pistol), 2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault), 7 (grenades), 8 (akimbo)
Mthe message you want to appearexample: slashed
This command is identical to fragmessage, please see it.
See also: fragmessage, weapon
Toggles between your primary weapon and grenades (must be bound to a key).
See also: sndtoggle, knftoggle
Go to the next match in the servers rotation for the desired gamemode.
ArgumentDescriptionValues
Mgamemode0:TDM,5:CTF,10:OSOK
TODO: elaborate
Switches to grenades, if available (must be bound to a key).
See also "quicknadethrow" command.


default key: 3 - switches to grenades
Determines if the local player (you) are currently carrying a primary weapon.
Returns 0 (false) or 1 (true).

Example: add2bind MOUSE1 [ if (hasprimary) [ echo you attacked with a primary weapon ] ]Everytime you press the left mouse button, assuming you are carrying your primary weapon, the above echo will be executed.

Returns the highest valid client number available.
Ignore a player.
ArgumentDescriptionValues
Aclient number
You won't see any further game chat or hear any more voice com messages from that player.
Ignore all clients currently on the server.
Ignore all clients on the enemy team.
Ignore all clients on the specified team.
ArgumentDescriptionValues
Tthe team to ignore0 or 1 || cla or rvsf
Determines if the client number given is a valid client (player).
ArgumentDescriptionValues
Cclient number

Example: echo (isclient 0)Example output: 1

Example: echo (isclient 32)Example output: 0

See also: curplayers
Triggers a jump.


default key: Space or right Ctrl
Toggles between your primary weapon and knife (must be bound to a key).
See also: sndtoggle, gndtoggle
Tries to connect to a LAN server.
Returns the last time (in milliseconds) the gametime was updated. READ ONLY
Holds the CN of the last client who sent you a private message.
If you haven't recieved any private messages, 'lastpm' is -1
See also: pm, quickanswer
Moves the player left.


default key: A or Left Arrow
Get the game demos listing from the server we are currently connected.
See also: getdemo, cleardemo
Print a list of all players that you are currently ignoring.
Prints a list of all players that you have muted.
Loads a crosshair for given type.
ArgumentDescriptionValues
Ttypedefault, teammate, scope, edit, knife, pistol, carbine, shotgun, subgun, sniper, assault, grenade, akimbo, reset
Iimage

Example: loadcrosshair red_dot.pngLoads the red_dot.png crosshair for all weapons.

Example: loadcrosshair default red_dot.pngSame as above. Loads the red_dot.png crosshair for all weapons.

Example: loadcrosshair knife red_dot.pngLoads the red_dot.png crosshair for your knife only.

Example: loadcrosshair assault red_dot.pngLoads the red_dot.png crosshair for your assault rifle only.

Example: loadcrosshair scope red_dot.pngLoads the red_dot.png crosshair for your sniper rifle scope only.

Example: loadcrosshair resetLoads all default crosshairs (including teammate and scope).

Loads a map directly in the current gamemode (singleplayer only).
ArgumentDescriptionValues
Mmap name
See also: map, votemap, mode
Returns contents of current magazine.
ArgumentDescriptionValues
Nthe weapon number or name0 (knife), 1 (pistol), 2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault), 7 (grenades), 8 (akimbo)
A knife will always return 1.
Weapons that aren't available will return -1.
Returns contents of magazine reserve.
ArgumentDescriptionValues
Nthe weapon number or name0 (knife), 1 (pistol), 2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault), 7 (grenades), 8 (akimbo)
map M
Loads up a map in the gamemode set previously by the 'mode' command.
ArgumentDescriptionValues
MName of the map to loadstring
If connected to a multiplayer server, it votes to load the map (others will have to type "map M" as well to agree with loading this map). To vote for a map with a specific mode, set the mode before you issue the map command.
A map given as "blah" refers to "packages/maps/blah.cgz", "mypackage/blah" refers to "packages/mypackage/blah.cgz". At every map load, "config/default_map_settings.cfg" is loaded which sets up all texture definitions, etc. Everything defined there can be overridden per package or per map by creating a "mapname.cfg" which contains whatever you want to do differently from the default.
When the map finishes it will load the next map when one is defined, otherwise it reloads the current map. You can define what map follows a particular map by making an alias like (in the map script): alias nextmap_blah1 blah2 (loads "blah2" after "blah1").
See also: votemap, loadmap, mode
If this alias exists it will be run every time the game starts a new map.

Example: mapstartalways = [ echo "------------------------------" ] This will output the string and override any other actions that might've been defined.

Example: addOnLoadAlways [ echo "------------------------------" ] This will output the string after any previously defined actions have run.

If this alias exists it will be run when the game starts a new map, then it is deleted.

Example: mapstartonce = [ echo "------------------------------" ] This will output the string and override any other actions that might've been defined.

Example: addOnLoadOnce [ echo "------------------------------" ] This will output the string after any previously defined actions have run.

me ...
Action chat message.
ArgumentDescriptionValues
......
Switches to knife (must be bound to a key).


default keys:

4 - switches to knife

middle mouse button - switches to knife and attacks (if the key is held)

Returns the remaining minutes of the currently played game. READ ONLY
modconnect A B C
Connects to a modded server.
ArgumentDescriptionValues
AIP
Bport
Cpassword
The modified server needs to use the original client-server protocol. The protocol version number will be the negated value of an unmodded server.
Connects to a modded server and tries to claim admin state.
ArgumentDescriptionValues
AIP
Bport
Cadmin password
The modified server needs to use the original client-server protocol. The protocol version number will be the negated value of an unmodded server.
Tries to connect to a modified LAN server.
The modified server needs to use the original client-server protocol. The protocol version number will be the negated value of an unmodded server.
Mutes a player.
ArgumentDescriptionValues
Aclient number
You won't hear any further voice com messages from that player.
name N
Sets the nick name for the local player.
ArgumentDescriptionValues
Nthe name
See also: curname
Sets the primary weapon on next respawn.
ArgumentDescriptionValues
Athe weapon number or name2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault)
Adds a command to complete nicknames on.
Your own nick will be ignored.

Example: nickgreet = [ say (concat "Hello," (concatword $arg1 "!")) ]; nickcomplete nickgreetwith this you can enter "/nickgreet " and cycle via TAB to the nickname you want to greet.

See also: complete
onAttack weapon
If defined, this will be executed each time you shot a bullet, throw a grenade or use your knife.
ArgumentDescriptionValues
weaponThe weapon that was used
Remark: it works only in singleplayer.
If this alias exists it will be run every time a vote is called.
If this alias exists it will be run every time a vote is changed.
See also: onCallVote, onVoteEnd
onConnect player
If defined, this will be executed when you or another player join(s) a server.
ArgumentDescriptionValues
playerThe client number of the player who connectedinteger (-1 for local player)
onDisconnect player
If defined, this will be executed when you or another player disconnect(s) from a server.
ArgumentDescriptionValues
playerThe client number of the player who disconnectedinteger (-1 for local player)
onFlag action actor flag
If defined, this will be executed each time a flag action occurs.
ArgumentDescriptionValues
actionThe action that occuredinteger (0 = stolen, 1 = dropped, 2 = lost, 3 = returned, 4 = scored, 5 = ktfscore, 6 = failed to score, 7 = reset)
actorThe client number of the actorinteger
flagThe flag owner teaminteger (0 = CLA, 1 = RVSF)
Remark: it works only in singleplayer.
onHit actor target damage gun gib
If it's defined, this alias will be executed each time a damage is done.
ArgumentDescriptionValues
actorThe client number of the actorinteger
targetThe client number of the targetinteger
damageThe damage doneinteger
gunThe number of the gun usedinteger
gibIs it a gib or a normal fraginteger (0 or 1)
Remark: it works only in singleplayer.
onKill actor target gun gib
If it exists, this alias will be executing when any player get killed, receiving a few arguments.
ArgumentDescriptionValues
actorThe client number of the actorinteger
targetThe client number of the targetinteger
gunThe number of the gun usedinteger
gibIs it a gib or a normal fraginteger (0 or 1)
Remark: it works only in singleplayer.
If this alias exists, it will be automatically executed on the last minute remaining mark.
onNameChange player new name
If defined, this will be executed when you or another player change(s) his name.
ArgumentDescriptionValues
playerThe client number of the player who changed nameinteger
new nameThe new name of the clientstring
The alias is executed before the name is effectively changed, so you can still get the previous name of the client from this alias.
Remark: it works only in singleplayer.
onPickup item q
If defined, this will be executed each time you pick up an item.
ArgumentDescriptionValues
itemThe item that was picked upinteger (0 = pistol clips, 1 = ammo box, 2 = grenade, 3 = health, 4 = helmet, 5 = armour, 6 = akimbo)
qThe quantity that was received
Remark: it works only in singleplayer.
onPM player message
If defined, this will be executed when another player sent you private message.
ArgumentDescriptionValues
playerThe client number who sent you private messageinteger
messageThe private messagestring
If defined, this will be executed each time you reload a weapon.
ArgumentDescriptionValues
Bwas autoreload?0 (false), 1 (true)
Remark: it works only in singleplayer.
onSpawn player
If defined, this will be executed each time a player spawns.
ArgumentDescriptionValues
playerThe client number of the player who spawnedinteger
Remark: it works only in singleplayer.
If this alias exists it will be run every time a vote passes or fails.
If defined, this will be executed each time you switch to a different weapon.
ArgumentDescriptionValues
WThe weapon number that you switched to
Remark: it works only in singleplayer.
Vote to pause or resume the match.
ArgumentDescriptionValues
Ppause or resume1 (pause) or 0 (resume)
This command is only supported on servers that are in 'match' mastermode.
You can use the alias 'togglepause' to switch between pause and resume.
See also: mastermode
Determines if the singleplayer game should be paused.
Token Description ValuesRangeDefault
Bpause game0..10


default key: Pause
player C A
Retrieve an attribute of a player identified by clientnum.
ArgumentDescriptionValues
Cclientnum1,2,3,..
Aattributemagcontent, ammo, primary, ..
If the clientnum does not match a valid player the result will be empty, just as without an attribute passed.
The following attributes can be retrieved: magcontent, ammo, primary, curweapon, nextprimary, health, armour, attacking, scoping, x, y, z, name, team, ping, pj, state, role, frags, flags, deaths, tks, alive, spect, cn, skin_cla, skin_rvsf, skin, ip
See also: player1
Retrieve an attribute of yourself.
ArgumentDescriptionValues
Aattributemagcontent, ammo, primary, ..
See player for all retrievable attributes.
See also: player
pm C L
Sends a private message to a specified client.
ArgumentDescriptionValues
CClient number
LList of strings
See also: say, quickanswer, lastpm
Returns the weapon-index the local player was previously holding.
Switches to your current primary weapon (must be bound to a key).


default key: 1
See also: secondary, melee, grenades
Returns the shot statistics for the player with the given clientnumber.
ArgumentDescriptionValues
Cclient0..N
The list is:
knife/atk dmg pistol/atk dmg carbine/atk dmg shotgun/atk dmg smg/atk dmg sniper/atk dmg assault/atk dmg nade/atk dmg akimbo/atk dmg

Example: echo (pstat_weap 0) Output: 0 0 0 0 0 0 0 0 0 0 1 240 15 312 0 0 3 112 0 0The output is a list of tuples for all weapons, SHOTS-FIRED and DAMAGE-DEALT for each.

Easily respond the last client who sent you a private message.


default key: N
See also: pm, lastpm
Switches to grenades, if available (must be bound to a key).
If grenades are already selected or the key is held, it throws a grenade and switches back to previous weapon.


default keys:

G - for all weapons

right mouse button - for all weapons except sniper rifle

See also: grenades
Disconnects then reconnects you to the current server.
ArgumentDescriptionValues
Pthe server password (optional)
Reloads the weapon.
ArgumentDescriptionValues
Avalue


default key: R
See also: autoreload
Reset all drawn zones.
See also: drawzone, survival
Rewind the current demo to S seconds ago.
ArgumentDescriptionValues
Sthe number of seconds to rewind
Note: you can use a negative value to forward.
See also: demo, setmr
Moves the player right.


default key: D or Right Arrow
say S...
Outputs text to other players.
ArgumentDescriptionValues
S...the text
If the text begins with a percent character (%), only team mates will receive the message.
Determines the FOV when scoping.
Token Description ValuesRangeDefault
V5..6050
See also: fov
Switches to your secondary weapon (must be bound to a key).


default key: 2
See also: primary, melee, grenades
ArgumentDescriptionValues
Cclientnumwhich player to follow
Go to a predefined number of minutes before the end of the game while watching a demo.
ArgumentDescriptionValues
Mthe minutes remaining to skip to
See also: demo, rewind
setnext G M
Call a vote for mode and map.
ArgumentDescriptionValues
Ggamemode0:TDM,5:CTF,10:OSOK
Mmapac_mines,ac_douze,megamap
TODO: elaborate
Displays a scope for the sniper-rifle.
ArgumentDescriptionValues
Yscope on?0 or 1
It is used in the zoom-script (config/scripts.cfg: "const zoom").


default key: right mouse button
Shifts your selected weapon by a given delta.
ArgumentDescriptionValues
Ddelta-N..-1,+1..N
By default the mouse-wheel shifts one up or down according to your scroll direction.


default keys:

MOUSE4 - cycle one up

MOUSE5 - cycle one down

Toggles between your primary weapon and secondary weapon (must be bound to a key).
See also: knftoggle, gndtoggle
Toggles spectator mode.
Returns client number of spectated player.
See also: setfollowplayer
Sets the desired spectating mode.
ArgumentDescriptionValues
Mthe mode2 (1st-person), 3 (3rd-person), 4 (3rd-person transparent), 5 (free flying)


default key: SPACE - switch spectator mode
See also: spectate
Enables persistent spectating concrete player.
Token Description ValuesRangeDefault
N0: enabled in non-arena modes, 1: always enabled0..11
For "spectatepersistent" = 1 persistent spectating is enabled in all game modes in multiplayer (that means, that spectated player isn't changed after his death), for "0" it is enabled only in non-arena modes.
See also: spectate
If this alias exists it will be run when the game reaches intermission.

Example: start_intermission = [ echo "INTERMISSION - STATISTICS TIME" loop p 255 [ pn = (player $p name) if (strcmp $pn "") [ ] [ echo (concatword Player $p ":") (pstat_score $p) ":" (pstat_weap $p) ] ] echo "------------------------------" ] This will output the full statistics line for all players.

Stops demo playback.
Kills your player. You will lose 1 frag point and receive 1 death point when using this command.
team N
Sets the team for the local player.
ArgumentDescriptionValues
Nthe team number or name0 (CLA), 1 (RVSF), 2 (CLA-SPECT), 3 (RVSF-SPECT), 4 (SPECTATOR)

Example: team CLA

See also: changeteam
Returns attributes of a team.
ArgumentDescriptionValues
TTeamcla, rvsf, 0, 1
AAttributeValid attributes: flags, frags, deaths, points, name, players
Cycles through all available spectator modes.
These modes are: Follow-1stPerson, Follow-3rdPerson, Follow-3rdPerson-transparent and Fly.


default key: SPACE - cycle spectator modes
Unignore all clients currently on the server.
ArgumentDescriptionValues
Ssoundmust be a registered voicecom-sound
Ttext


default key: V - opens the voicecom menu, use number keys for your choice
Enables or disables voicecom audio.
ArgumentDescriptionValues
0 (off)
1 (always play voicecom audio)
2 (only play voicecom audio from you and your teammates)
vote V
Agree or disagree to the currently running vote.
ArgumentDescriptionValues
Vvote value1 (yes) OR 2 (no)


default keys:

F1 - votes YES

F2 - votes NO

votemap I M
Sets the next gamemode then calls a vote for a map.
ArgumentDescriptionValues
Imode id
Mmap name
See also: map, loadmap, mode
Determines if there is a vote pending or not.

Example: echo $votependingOutput: if there is currently a vote pending, returns 1, else returns 0.

Returns 1 when the current game is being played from a demo, else 0.

Example: echo I am (at [not now] (watchingdemo)) watching a demo. "so, are you?"

Return value: truth value

Changes the weapon (must be bound to a key).
ArgumentDescriptionValues
Nthe number/name of available weapon0 (knife), 1 (pistol), 2 (carbine), 3 (shotgun), 4 (subgun), 5 (sniper), 6 (assault), 7 (grenades), 8 (akimbo)
Prints the local client's (x,y) coordinates.
Get the IP address of a given clientnumber - only admins get shown the last octet.
ArgumentDescriptionValues
Cclientnum
Returns the team number with the highest score, or if in a non-team mode, returns the CN of the player with the highest score.

Game modes

bdm M T
Starts a map with the mode "Bot Deathmatch".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: bdm ac_complex

blss M T
Starts a map with the mode "Bot Last Swiss Standing".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: blss ac_complex

bosok M T
Starts a map with the mode "Bot One Shot, One Kill".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: bosok ac_complex

bpf M T
Starts a map with the mode "Bot Pistol Frenzy".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: bpf ac_complex

btdm M T
Starts a map with the mode "Bot Team Deathmatch".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: btdm ac_complex

btosok M T
Starts a map with the mode "Bot Team One Shot, One Kill".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: btosok ac_complex

btsurv M T
Starts a map with the mode "Bot Team Survivor".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: btsurv ac_complex

coop M
Starts a map with the mode "Co-operative Editing".
ArgumentDescriptionValues
MThe name of the map you wish to edit
See the "Co-operative map editing" section on the "Tips, tricks and advice" chapter of the map editing guide for more information.

Example: coop ac_newmap

ctf M T
Starts a map with the mode "Capture the Flag".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: ctf ac_mines

Checks the current game mode for certain attributes.
ArgumentDescriptionValues
Aattribute name
Possible attributes are: team, arena, flag and bot.
See also: mode, gamemode, getmode
dm M T
Starts a map with the mode "Deathmatch".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: dm ac_complex

Returns the number of current game mode.

Example: echo $gamemodeOutput: 5

See also: mode, getmode, curmodeattr
ArgumentDescriptionValues
Mmodeinteger
Ddescriptionstring
Returns the name of current game mode.
ArgumentDescriptionValues
N0 = full mode name, 1 = mode acronymmin 0/max 1/default 0

Example: echo (getmode)Example output: capture the flag

Example: echo (getmode 1)Example output: CTF

htf M T
Starts a map with the mode "Hunt the Flag".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: htf ac_mines

ktf M T
Starts a map with the mode "Keep the Flag".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: ktf ac_mines

lms M T
Starts a map with the mode "Survivor". Some players prefer the name "Last Man Standing" for this mode.
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: lms ac_complex

lss M T
Starts a map with the mode "Last Swiss Standing".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: lss ac_complex

mode N
Sets the gameplay mode to N for the next map loaded.
ArgumentDescriptionValues
NTeam Deathmatch0
Co-op edit1
Deathmatch2
Survivor3
Team Survivor4
Capture the Flag5
Pistol Frenzy6
Bot Team Deathmatch7
Bot Deathmatch8
Last Swiss Standing9
One Shot, One Kill10
Team One Shot, One Kill11
Bot One Shot, One Kill12
Hunt the Flag13
Team Keep the Flag14
Keep the Flag15
Team Pistol Frenzy16
Team Last Swiss Standing17
Bot Pistol Frenzy18
Bot Last Swiss Standing19
Bot Team Survivor20
Bot Team One Shot, One Kill21
You will need to define mode before loading the map or it will stay as the last mode played.
There are many aliases for you to use instead of remembering the numeric mapping.

Example: mode 7; map ac_complex; echo "Bot Team Deathmatch on ac_complex"

Example: mode 8; map ac_mines 4; echo "Bot Deathmatch on ac_mines for 4 minutes"

Example: mode 5; map ac_shine; echo "CTF @ ac_shine"

Toggles use of acronyms instead of full modenames in the serverbrowser, scoreboard, voting info.
Token Description ValuesRangeDefault
B0..10
See also: mode, getmode, modenum
Returns the mode number for a specified mode acronym.
ArgumentDescriptionValues
Mthe mode acronym
Returns -1 if not found.

Example: echo (modenum ctf)Output: 5

Example: echo (modenum btosok)Output: 21

See also: mode, modeacronyms
osok M T
Starts a map with the mode "One Shot, One Kill".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: osok ac_complex

pf M T
Starts a map with the mode "Pistol Frenzy".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: pf ac_complex

Enables or disables the showing of game mode descriptions on the console after map starts.
Token Description ValuesRangeDefault
B0 off, 1 on0..11
See also: mode, gamemodedesc
surv M T
Starts a map with the mode "Survivor".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 10 minutes if T is 0 or not specified)1..60

Example: surv ac_complex

tdm M T
Starts a map with the mode "Team Deathmatch".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: tdm ac_complex

tktf M T
Starts a map with the mode "Team Keep the Flag".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: tktf ac_mines

tlss M T
Starts a map with the mode "Team Last Swiss Standing".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: tlss ac_complex

tosok M T
Starts a map with the mode "Team One Shot, One Kill".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: tosok ac_complex

tpf M T
Starts a map with the mode "Team Pistol Frenzy".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: tpf ac_complex

tsurv M T
Starts a map with the mode "Team Survivor".
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: tsurv ac_complex

vip M T
Starts a map with the mode "Hunt the Flag". Some players prefer the name "VIP" for this mode.
ArgumentDescriptionValues
MThe name of the map you wish to play
TThe time limit, in minutes (default 15 minutes if T is 0 or not specified)1..60

Example: vip ac_mines

Keyboard and mouse

This section describes keyboard and mouse related identifiers.

Whether or not the next call to _resetallbinds will remove any and all binds; cleaning up before setting the default bindings.
Token Description ValuesRangeDefault
Bboolean1:yes0..10
Internal – used in config/resetbinds.cfg
See also: _resetallbinds
Clears all binds for all keys and all modes, including self-assigned ones.
Do not use the command manually.
Adds a block of code, if it does not already exist, to a keybind.
ArgumentDescriptionValues
Kthe key to add to
Cthe code to add
See also: add2alias, add2list
Switches between scopesensscale and autoscopesensscale.
Token Description ValuesRangeDefault
Nauto on/off0 (scopesensscale)..1 (autoscopesens)0
Determines how to calculate scoped sensitivity if scopesens is zero. If enabled, derives scoped sensitivity from scopefov and fov.
bind K A
Binds a key to a command.
ArgumentDescriptionValues
Kthe key to bindstring
Athe commandstring, usually an alias
To find out what key names and their default bindings are, look at config/keymap.cfg, then add bind commands to your autoexec.cfg.
Similar to bind, but is only active while editing, where it overrides the regular bind for the specified key.
ArgumentDescriptionValues
Kthe key to bindstring
Athe commandstring, usually an alias
See also: bind, specbind
Returns the name of a key via a specified code.
ArgumentDescriptionValues
Iinteger
Returns -255 if the key does not exist.
See /config/keymap.cfg for a full list of valid key codes.

Example: echo (findkey 8)Output: BACKSPACE

Example: echo (findkey 280)Output: PAGEUP

See also: keybind, findkeycode
Returns the integer code of a key.
ArgumentDescriptionValues
Kthe name of the key
Returns -255 if the key does not exist.
See /config/keymap.cfg for a full list of valid key names.

Example: echo (findkeycode BACKSPACE)Output: 8

Example: echo (findkeycode PAGEUP)Output: 280

See also: keybind, findkey
Sets mouse to "flight sim" mode.
Token Description ValuesRangeDefault
Bsets invmouse1:inverted Y-axis0..10
Inverts movement on the y-axis.
Returns the contents of a keybind, bound with 'bind'.
ArgumentDescriptionValues
Kname of key
Returns the contents of a keybind, bound with 'editbind'.
ArgumentDescriptionValues
Kname of key
keymap K N A
Sets up the keymap for the specified key.
ArgumentDescriptionValues
Kthe key to map
Nthe name for the key
Athe default action
You should never have to use this command manually, use "bind" instead.
See also: bind
If defined, this will be executed every time you press a key.
ArgumentDescriptionValues
Iinteger key code

Example: checkinit KEYPRESS [echo You pressed key: (findkey $arg1)]

See also: KEYRELEASE, findkey
If defined, this will be executed every time you release a key.
ArgumentDescriptionValues
Iinteger key code

Example: checkinit KEYRELEASE [echo You released key: (findkey $arg1)]

See also: KEYPRESS, findkey
Returns the contents of a keybind, bound with 'specbind'.
ArgumentDescriptionValues
Kname of key
megabind K D E C B O
Binds a key to many different actions depending on the current game state.
ArgumentDescriptionValues
Kthe key to bindstring
Dbody of code to execute if watching a demoa body of code
Ebody of code to execute if editing or in coop-edit modea body of code
Cbody of code to execute if connected to a servera body of code
Bbody of code to execute if in a bot modea body of code
Obody of code to execute if none of the other arguments have been meta body of code
This command requires 6 arguments, no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing".

Example: megabind F9 [echo Demo!] [echo Editing or coop!] [echo Connected!] [echo Bots!] [echo Other!]

See also: bind, onrelease
Sets the degree of mouse filtering (0.0 being no filtering).
Token Description ValuesRangeDefault
NAmount of mouse filtration0.0..6.00.0
Indicates if a CTRL key is pressed.
Description ValuesRangeDefault
state of the CTRL key0: unpressed, 1: pressed0..10
Is the CTRL currently key pressed?
Can be used to change the behaviour of keybinds, like the F12 keybind in spectator mode uses it.
See also: screenshot
Sets the mouse acceleration.
Token Description ValuesRangeDefault
Nacceleration factor0.0..1000.00.0
See also: sensitivity
Executes a command on the release of a key/button.
ArgumentDescriptionValues
Athe command
This command must be placed in an action in a bind or in an alias in a bind.

Example: bind CTRL [ echo "key pressed"; onrelease [ echo "key released" ] ]

See also: bind, megabind
The way the mouse movement is handled.
Token Description ValuesRangeDefault
Bboolean0:warped, 1:relative0..11
On Windows this is forced to 1 due to erratic behaviour of SDL_WarpMouseInWindow.
If set to 0 the mouse will be warped to center of the screen if appropriate.
See also: sdl_xgrab_bug
Resets all binds back to their default values.
This command executes the file /config/resetbinds.cfg which will bind all keys to the values specified in that file, thus resetting the binds to their default values.
Mouse sensitivity while scoped.
Token Description ValuesRangeDefault
Nscoped sensitivity0..10000
If zero, autoscopesens determines, how sensitivity is changed during scoping.
Change sensitivity when scoping.
Token Description ValuesRangeDefault
Nfactor to change sensitivity while scoped0.001..1000.00.5
If used, scoped sens = sensitivity * scopesensscale (roughly). Ignored, if autoscopesens is set.
Enable a workaround for buggy SDL X11 pointer grabbing.
Token Description ValuesRangeDefault
Bboolean1:use workaround0..10
On Windows this is variable is not available. X11 is a *nix windowing system.
If set to 1 and relativemouse is on too, the workaround using XGrabPointer will be used.
See also: relativemouse
Searches keybinds (bound with 'bind'), returns keys with matching contents.
ArgumentDescriptionValues
Ssearch string
This is the inverse of 'keybind'

Example: echo (searchbinds "reload")Output: R

See also: bind, keybind
Searches keybinds (bound with 'editbind'), returns keys with matching contents.
ArgumentDescriptionValues
ssearch string
This is the inverse of 'keyeditbind'

Example: echo (searcheditbinds "toggleocull")Output: F5

See also: editbind, keyeditbind
Searches keybinds (bound with 'specbind'), returns keys with matching contents.
ArgumentDescriptionValues
ssearch string
This is the inverse of 'keyspecbind'
See also: specbind, keyspecbind
Sets the mouse sensitivity.
Token Description ValuesRangeDefault
Sthe sensitivityfloating-point0.001..10003.0
Scales all mouse sensitivity values.
Token Description ValuesRangeDefault
Nthe sensitivity scale0.001..1000.01.0
Changes all sensitivity values. If unsure, keep this at "1".
Similar to bind, but is only active while spectating, where it overrides the regular bind for the specified key.
ArgumentDescriptionValues
Kthe key to bindstring
Athe commandstring, usually an alias
See also: bind, editbind
Toggles grabbing of mouse and keyboard input in a game.
Grabbing means that the mouse is confined to the AC, and nearly all keyboard input is passed directly to AC, and not interpreted by a window manager, if any. This is only useful when you run AC windowed.

Visuals

This section describes identifiers to configure the visuals.

Sets the size/resolution of the dynamic shadow data.
Token Description ValuesRangeDefault
the size0..32
Time in milliseconds before the abovehead icon dissapears.
Token Description ValuesRangeDefault
Vabovehead icon display time1..100002000
Sets the size for the icon shown above a player using comunications voices.
Token Description ValuesRangeDefault
VIcon size0..100050
For toggling on the ability for any text to have the blinking bit set.
Token Description ValuesRangeDefault
T0 = Off, 1 = On0..10
See also: menucanblink
Sets the time available for interpolation between model animations.
Token Description ValuesRangeDefault
Nthe amount of milliseconds for the interpolation0..1000100
Sets the level of anisotropic filtering.
Token Description ValuesRangeDefault
Vanisotropic filtering0..160
See also: hwmaxaniso
Token Description ValuesRangeDefault
V0..10
Token Description ValuesRangeDefault
V0..11
Turns on and off the display of blood.
Token Description ValuesRangeDefault
VEnable/Disable blood0..11
Sets the amount of time in milliseconds that blood is displayed on the ground.
Token Description ValuesRangeDefault
VBlood display time0..3000010000
Turns on/off the display of bullet holes.
Token Description ValuesRangeDefault
VEnable/Disable bullet holes0..11
Specifies how long (in milliseconds) to display bullet holes.
Token Description ValuesRangeDefault
VBullethole display time0..3000010000
Returns a name of the current font.
Token Description ValuesRangeDefault
Sname of font<empty>, default, mono, serif..
See also: font, setfont
Sets the bits for the depth buffer.
Token Description ValuesRangeDefault
depth pixels0..320
Token Description ValuesRangeDefault
V..0.005f
Returns a height of the desktop resolution (or zero, if not available).
See also: desktopw, screenres
Returns a width of the desktop resolution (or zero, if not available).
See also: desktoph, screenres
Determines whether dynamic shadows and lights are rendered, provided just incase they slow your fps down too much.
Token Description ValuesRangeDefault
R0 off, 1 on0..11
Sets the alpha value (transparency) for dynamic shadows.
Token Description ValuesRangeDefault
the alpha value0..10040
Token Description ValuesRangeDefault
V0..30001000
Token Description ValuesRangeDefault
V0..10
Sets the display size of the dynamic shadows.
Token Description ValuesRangeDefault
the size4..85
font NAME PATH A B C D E F
Loads a font texture to use as text within AssaultCube.
ArgumentDescriptionValues
NAMEthe font name
PATHthe path to the font texture
Athe default width
Bthe default height
Coffset (co-ordinate X)
Doffset (co-ordinate Y)
Eoffset (width)
Foffset (height)
fontchar A B C D
Specifies a region of an image to be used as a font character.
ArgumentDescriptionValues
AX co-ordinates (from top-left corner)
BY co-ordinates (from top-left corner)
Cwidth
Dheight
See also: font, fontskip
Specifies, at what char the font definition proceeds.
ArgumentDescriptionValues
Athe ascii code of the first char
For example "fontskip 48" means the ascii code of the first char in defined font will be "48", which is '0'; "fontskip 65" would start at 'A'.
See also: font, fontchar
fov N
Sets the field of view (fov).
Token Description ValuesRangeDefault
Nthe FOV value75..12090
Sets the range of FPS (AC will adjust LOD to achieve it).
ArgumentDescriptionValues
Amin
Bmax
See also: maxfps
Sets the level of full-scene antialiasing (FSAA).
Token Description ValuesRangeDefault
Vfull-scene antialiasing-1..160
-1 uses the default settings obtained from the system. 0 disables, 1..16 enables FSAA.
Enables or disables fullscreen.
Token Description ValuesRangeDefault
fullscreen0..11
Enables using always desktop resolution in fullscreen mode.
Token Description ValuesRangeDefault
VUse desktop resolution for fullscreen0..11
See also: fullscreen
Toggles fullscreen on or off.
See also: fullscreen
Sets the temporary (to next map start) hardware gamma value.
Token Description ValuesRangeDefault
Nthe gamma value30..300100
May not work if your card/driver doesn't support it.
Returns a list of available screen resolutions.
See also: screenres
Returns an encoded string to display an inlined image outside the console.
ArgumentDescriptionValues
Mmnemonic
Images are stored in packages/misc/igraph/*.png and loaded during game start. Filenames consist of the image shorthand (mnemonic) and optional frame times, separated by "_". Media file names may only contain letters, digits and "_-.()".
All texts displayed in the game console are scanned for mnemonics prefixed with ":". All found matches are replaced by the image.
The images are displayed as squares with width and height the same as the regular font height. To create animations, put several square images side by side into the file. For example, a 128x32 image is interpreted as four frames. Frame duration is encoded in the filename, so, for example the file "nop_1000_200_100.png" shows the first frame for 1000 milliseconds, the second frame for 200 msec and the third (as the rest) for 100 msec.
Igraphs "1" to "9" are hardcoded and can be manually encoded in menu texts. Use the new escape code "\i" plus the number of the image: "\i\1".."\i\9". Other images can be used in menus as well, but the codes have to be fetched by "getigraph".
If the mnemonic was not found, then "getigraph" returns an empty string.
gib B
Enables or disables the gib animation entirely.
Token Description ValuesRangeDefault
Boff OR on0 (false), 1 (true)0..11
Sets the number of gibs to display when performing a "messy" kill (grenade, knife, sniper headshot).
Token Description ValuesRangeDefault
Nnumber of gibs0..10006
Larger values are more spectacular, but can slow down less powerful machines. Reducing gibttl may help in this case.
See also: gibttl, gibspeed
Adjusts gib/gibnum/gibspeed/gibttl variables collectively.
ArgumentDescriptionValues
0 - Off
1 - Default/Normal values
2 - Good
3 - Messy
4 - Unrealistic
Sets the velocity at which gibs will fly from a victim.
Token Description ValuesRangeDefault
Nvelocity1..10030
See also: gibnum, gibttl
Sets the time for gibs to live (in milliseconds), after which they will disappear.
Token Description ValuesRangeDefault
Ntime to live0..600007000
See also: gibnum, gibspeed
Checks for the searchstring in all loaded extensions.
ArgumentDescriptionValues
Eextension

Example: if (glext shadow_funcs) [echo you have shadow functionality] [echo no shadows for you]

Token Description ValuesRangeDefault
B0..10
Hides inlined images in the console.
Token Description ValuesRangeDefault
N0: show, 1: hide0..10
See also: getigraph
Controls whether textures with a scale higher than 1.0 will be scaled down while loading (0) or not (1).
Token Description ValuesRangeDefault
Sscale down?0..11
See also: texture
Shows the maximum level of anisotropic filtering supported by the graphics hardware.
See also: aniso
Shows the maximum texture size (in pixels) supported by the graphics hardware.
See also: maxtexsize
Ignores per-map overrides to limit waveheight on the client.
Token Description ValuesRangeDefault
Bboolean1:ignore..0
Ignores the overrides set by the mappers (for their maps only). If "1", mapoverride_limitwaveheight is ignored, and "waveheight" is used unchanged.
Ignores per-map overrides to disable stencil shadows on the client.
Token Description ValuesRangeDefault
Bboolean1:ignore..0
Ignores the overrides set by the mappers (for their maps only). If "1", mapoverride_nostencilshadows is ignored.
Ignores per-map overrides to disable water reflection on the client.
Token Description ValuesRangeDefault
Bboolean1:ignore..0
Ignores the overrides set by the mappers (for their maps only). If "1", mapoverride_nowaterreflect is ignored and regular client settings are used.
Enables animation of inlined images with multiple frames.
Token Description ValuesRangeDefault
N0: display only first frame, 1: enable animation0..11
Default frame time for inlined images with multiple frames.
Token Description ValuesRangeDefault
Nframe time for images5..2000200
Used for images with no frame duration specified in the filename.
Scales inlined images (in percent).
Token Description ValuesRangeDefault
Nsize of images (in percent)80..300120
Scales the hardcoded inlined images: "1".."9" (in percent).
Token Description ValuesRangeDefault
Nsize of images (in percent)80..160106
See also: getigraph, igraphsize
Allows to finetune the amount of "error" the mipmapper/stripifier allow themselves for changing lightlevels.
Token Description ValuesRangeDefault
Ethe error value, 1 being the best quality1..1004
If this variable is changed this during play, a "recalc" is needed to see the effect.
See also: recalc
Scaling factor for all light in the game.
Token Description ValuesRangeDefault
Ddivisorvalues will be divided by this1..1004
Any change will not take effect until a new world is loaded.
Per-map override to limit waveheight on the client.
Token Description ValuesRangeDefault
Bboolean1:ignore..0
Set by the mapper, for his map only. The overrides are stored in the map header.
If "1", waveheight is capped at 0.1 max. Useful for small water areas (like puddles), where higher waves would look weird.
Per-map override to disable stencil shadows on the client.
Token Description ValuesRangeDefault
Bboolean1:ignore..0
Set by the mapper, for his map only. The overrides are stored in the map header.
If "1", stencil shadows are disabled. On clients, where stencil shadows are otherwise enabled, blob shadows are used instead. If shadows are disabled anyway, they stay disabled. Useful for dim maps, where hard shadows make no sense.
Per-map override to disable water reflection on the client.
Token Description ValuesRangeDefault
Bboolean1:ignore..0
Set by the mapper, for his map only. The overrides are stored in the map header.
If "1", water reflection is disabled. Useful, when odd water colours are used to emulate other liquids that are not supposed to be that reflective.
Limits the FPS (frames per second) of AssaultCube's video output.
Token Description ValuesRangeDefault
Vmaximum FPS0 disables maxfps25 or 0..1000200
Remark: limit to '200' is optimal.
See also: fpsrange
Sets the maximum value the display will roll on strafing.
Token Description ValuesRangeDefault
Nthe roll value0..200
Sets the maximum value the display will roll when you get damages.
Token Description ValuesRangeDefault
Nthe roll value0..3010
Limits the maximum value the display will roll on strafing or if player gets damages, when spectating other players.
Token Description ValuesRangeDefault
NThe roll value0..5010
The maximum texture size that will be used by the engine, larger textures will be scaled down.
Token Description ValuesRangeDefault
Vmaximum texture size0..40960
If this value is zero, hwtexsize will be used.
See also: hwtexsize
Gets the maximum number of supported textures when performing multitexturing.
Maximum number of smoke particles along shotline of sniper rifle.
Token Description ValuesRangeDefault
Nmaximum number of smoke particles1..10000500
Token Description ValuesRangeDefault
N0..11
Token Description ValuesRangeDefault
V1..322
Token Description ValuesRangeDefault
V1..321
Token Description ValuesRangeDefault
V0..11
Minimal level of detail.
Token Description ValuesRangeDefault
V25..25060
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..10
Scales all particles.
Token Description ValuesRangeDefault
Pthe scale percentage20..500100
Token Description ValuesRangeDefault
V..-3.0f
Token Description ValuesRangeDefault
V..-3.0f
Makes dead players instantly pop out of existence, instead of falling over and sinking into the ground.
Token Description ValuesRangeDefault
BBOOL0..10
See also: gib
Token Description ValuesRangeDefault
V0..1001
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V6..108
Resets the OpenGL rendering settings.
Chooses whether the players hand carrying the weapon appears as right or left handed.
Token Description ValuesRangeDefault
N0: lefty, 1: righty0..11
Sets if dynamic shadows should be saved to disk.
Token Description ValuesRangeDefault
auto save0..11
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..3000010000
Sets the screen height.
Token Description ValuesRangeDefault
Hthe screen height200..10000768
Sets the screen width.
Token Description ValuesRangeDefault
Wthe screen width320..100001024
Returns the actual height of the screen/window.
Description ValuesRangeDefault
the screen/window height..
Changes the screen resolution.
ArgumentDescriptionValues
Wwidth
Hheight
Returns the actual width of the screen/window.
Description ValuesRangeDefault
the screen/window width..
Changes the current font.
ArgumentDescriptionValues
Nfont namedefault, mono, serif
See also: font, curfont
Sets a persistent gamma value for a map.
ArgumentDescriptionValues
Gthe gamma value30..300, default 100
See also: gamma
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..1000075
skin N
Determines the skin of the current player.
ArgumentDescriptionValues
Nskin idvalue
See the player model folder for the according skin-id.
Chooses skin when playing for team CLA.
ArgumentDescriptionValues
Nskin id
Chooses skin when playing for team RVSF.
ArgumentDescriptionValues
Nskin id
Token Description ValuesRangeDefault
V0..11
Determines the valid distance when extrapolating a players position.
Token Description ValuesRangeDefault
Vdistance0..168
Determines the speed when extrapolating a players position.
Token Description ValuesRangeDefault
Vmovement speed0..10075
Specifies the Field Of View when in spectating/ghost mode.
Token Description ValuesRangeDefault
VSpectate FOV size5..120110
See also: fov, spectfovremote
Chooses between local or remote player's FOV when spectating.
Token Description ValuesRangeDefault
V0: uses 'spectfov' and the local 'scopefov', 1: uses 'fov' and 'scopefov' of the spectated player0..10
See also: fov, spectfov, scopefov
Token Description ValuesRangeDefault
V0..320
Sets the transparency/opacity level of stencil shadows.
Token Description ValuesRangeDefault
VAlpha level0..10040
Token Description ValuesRangeDefault
V1..1000200
Token Description ValuesRangeDefault
V1..1000105
Token Description ValuesRangeDefault
V1..1000200
Token Description ValuesRangeDefault
V1..1000105
Sets the team display mode.
Token Description ValuesRangeDefault
Nthe team display mode0 (none), 1 (color vests), 2 (color skins)0..21
In mode 0 team display is disabled In mode 1 players will be rendered with a colored vest to make the teams distinguishable. In mode 2 almost the whole suit of the players will be colored. These display modes are only applied in team gameodes.
Reduces the size of all texture by the selected factor:
Token Description ValuesRangeDefault
Sscale selection-1..30
Token Description ValuesRangeDefault
V0..11
Swaps vertices of model triangles.
Token Description ValuesRangeDefault
V0..11
Checks for new files in packages/misc/igraph/ folder.
Only necessary, if new files are added during the game - for example, by mod package download.
See also: getigraph
Enables or disables vsync.
Token Description ValuesRangeDefault
Vvsync-1..1-1
-1 uses the default settings obtained from the system. 0 disables, 1 enables vsync.
Turns on/off the reflections in the water surface.
Token Description ValuesRangeDefault
Venable/disable water reflections0..11
Turns on/off water refractions.
Token Description ValuesRangeDefault
Venable/disable water refractions0..10
Determines the subdivision of the water surface in maps.
Token Description ValuesRangeDefault
Nthe subdivisioin value1..644
Must be a power of 2: 4 is the default, 8 is recommended for people on slow machines, 2 is nice for fast machines, and 1 is quite OTT. See "waterlevel" (edit reference) on how to add water to your own levels.
See also: waterlevel
Sets the wave height of water, between 0 (completely still, no waves at all) and 1 (very choppy).
Token Description ValuesRangeDefault
Fwave height (floating-point value)0..10.3

Heads-Up Display

This section describes the identifiers to configure the head-up display (HUD).

Sets whether or not to display the accuracy information window.
Token Description ValuesRangeDefault
N1: on, 0: off0..10
Accuracy is displayed for current weapon and only then, if scoreboard is turned on.
Shows in the console accuracy of all used weapons.
See also: accuracy
Resets accuracy counters.
See also: accuracy
Sets the percent of screen height for text lines on an alternate F11 history display.
Token Description ValuesRangeDefault
V0..1000
See also: consize, fullconsize
Hides most of elements on the HUD for X frames.
Token Description ValuesRangeDefault
Xblank out the HUD0..100000
Used for "clean" screenshot. The parameter is "frames", so for example 1000 will take 20 seconds at 50 fps or second at 1000 fps.
See also: cleanshot
Recreates the minimap for the current map.
See also: minimapres
Colour of CN column in scoreboard.
Token Description ValuesRangeDefault
Ccolor0 (green), 1 (blue), 2 (yellow), 3 (red), 4 (gray), 5 (white), 6 (dark brown), 7 (dark red), 8 (purple), 9 (orange)0..95
Sets the transparency of the console.
Token Description ValuesRangeDefault
NAlpha value0..255255
Sets how many seconds before the console text rolls (disappears) up the screen.
Token Description ValuesRangeDefault
Vtime before the text rolls up0..6020
Sets how many lines of text the console displays.
Token Description ValuesRangeDefault
V0..1006
Turns on or off crosshair effects.
ArgumentDescriptionValues
Vturn off all effects0
turn on all effects (color and size change)1 (default)
turn on color change/turn off size change2
turn off color change/turn on size change3
When on, the crosshair will go orange when health is 50 or red when is 25. Size change of crosshair occurs when player holds assault rifle and has more than 3 shots in a row.
Sets the size of your crosshair.
Token Description ValuesRangeDefault
Nthe crosshair size0..5015
The crosshair is turned off entirely if the size is set to 0.
Turns on/off display of team warning crosshair.
Token Description ValuesRangeDefault
Venable/disable warning crosshair0..11
Sets the level of transparency of the damage indicator, 100 = totally solid.
Token Description ValuesRangeDefault
Vdamage indicator alpha value1..10050
Sets the separation of the arrows in the damage indicator.
Token Description ValuesRangeDefault
Vdamage indicator separation size0..10000500
Sets the size of the damage indicator.
Token Description ValuesRangeDefault
Vdamage indicator icon size0..10000200
Sets how long the damage indicator stays on screen.
Token Description ValuesRangeDefault
Vdamage indicator display time1..100001000
Show the blood-spat overlay when receiving damage?
Token Description ValuesRangeDefault
Ndamagescreen0 (false), 1 (true)0..11
If overlay of blood-spat, at what blending (transparency) level?
Token Description ValuesRangeDefault
Ndamagescreen transparency1..10045
If overlay of blood-spat, use which factor?
Token Description ValuesRangeDefault
Ndamagescreen factor1..1007
If overlay of blood-spat, at what speed does it fade?
Token Description ValuesRangeDefault
Ndamagescreen fade0..1000125
Displays local player's current x,y,z position in map, showstats 1 must be enabled.
Token Description ValuesRangeDefault
Vdisplay current position0..10
See also: showstats
Options for flag score hud transparency.
Token Description ValuesRangeDefault
Vflag score hud transparency 0: no transparency, icon set 'flag gone'; 1: transparency, icon set 'flag gone'; 2: transparency, classic icon set0..22
Sets the percent of screen height for text lines on the F11 history display.
Token Description ValuesRangeDefault
V0..10040
See also: consize, altconsize
Show the game-time clock on the HUD.
Token Description ValuesRangeDefault
Doff (0), count backward (1), count forward (2)0..21
The clock can count backward (from time limit to 0s) or forward (from 0s to time limit).
See also: wallclockformat
Turns on/off the radar compass.
Token Description ValuesRangeDefault
Venable/disable radar compass0..10
Turns on or off the display of console text.
Token Description ValuesRangeDefault
Venable/disable console text0..10
Turns on/off the damage indicator.
Token Description ValuesRangeDefault
Venable/disable damage indicator0..10
Turns on or off the display of equipment icons.
Token Description ValuesRangeDefault
Venable/disable equipment icons0..10
Turns on or off the display of messages at the bottom of the screen.
Token Description ValuesRangeDefault
Venable/disable messages0..10
Turns on or off the display of ktf flag direction indicator.
Token Description ValuesRangeDefault
Venable/disable ktf indicator0..10
Turns on or off the display of the on-screen radar.
Token Description ValuesRangeDefault
Venable/disable radar0..10
Turns on or off the display of spectator status.
Token Description ValuesRangeDefault
Venable/disable spectator status0..10
Turns on or off the display of local player team icons.
Token Description ValuesRangeDefault
Venable/disable team icons0..10
Turns on or off the display of team score icons.
Token Description ValuesRangeDefault
Venable/disable team score icons0..10
Turns on or off the display of vote icons.
Token Description ValuesRangeDefault
V0=on; 1=on, but hide after own vote; 2=off0..20
Turns on or off the display of the current selected gun.
Token Description ValuesRangeDefault
Vshow/hide guns 3D models0..11
Sets the level of transparency of ktf flag direction indicator, 100 = totally solid.
Token Description ValuesRangeDefault
Vktf indicator alpha value1..10070
See also: hidektfindicator
Sets the resolution for the minimap.
Token Description ValuesRangeDefault
Nthe resolution7..109
See also: clearminimap
Shows ammo statistics like in version 1.0.
Token Description ValuesRangeDefault
N0: new, 1: old0..10
Rendering options for the flags in the overview spectator mode.
ArgumentDescriptionValues
real0
askew1
radar2
Viewed from directly above the pole is barely visible and the undulating canvas never comes out of perfect alignment so is invisible. To compensate for the realistic rendering there are two variations on rendering flags when in the overview - either we rotate the models a bit so they become visible or we use the radar display of bases and flags instead.
Sets the icon size of the players shown in the radar and the minimap.
Token Description ValuesRangeDefault
Vsize of icons inside radar4..6412
Changes at what height you are floating in the radar-view.
Token Description ValuesRangeDefault
Hheight5..500150
Sets the order priority for the column cn on the scoreboard.
Token Description ValuesRangeDefault
Vlow priority: left, high priority: right0..1006
Sets the order priority for the column deaths or disables it on the scoreboard.
Token Description ValuesRangeDefault
V-1: disable, low priority: left, high priority: right-1..1002
Sets the order priority for the column flags on the scoreboard.
Token Description ValuesRangeDefault
Vlow priority: left, high priority: right0..1000
Sets the order priority for the column frags on the scoreboard.
Token Description ValuesRangeDefault
Vlow priority: left, high priority: right0..1001
Sets the order priority for the column pj/ping or disables it on the scoreboard.
Token Description ValuesRangeDefault
V-1: disable, low priority: left, high priority: right-1..1005
Sets the order priority for the column name on the scoreboard.
Token Description ValuesRangeDefault
Vlow priority: left, high priority: right0..1007
Sets the order priority for the column ratio or disables it on the scoreboard.
Token Description ValuesRangeDefault
V-1: disable, low priority: left, high priority: right-1..100-1
Sets the order priority for the column score or disables it on the scoreboard.
Token Description ValuesRangeDefault
V-1: disable, low priority: left, high priority: right-1..1004
Determines if the mini-map should be shown on screen.
Token Description ValuesRangeDefault
Bshow mini-map0..10


default key: left Alt - toggles minimap
Determines whether to have a see-through map overview (0), or render it on a black backdrop (1) or a combination of both (2).
Token Description ValuesRangeDefault
Bbackdrop-style0..20
Transparency of the black map backdrop (in percent) rendered if showmapbackdrop is set to 2.
Token Description ValuesRangeDefault
Ttransparency0..10075
See also: showmapbackdrop
Shows or hides the scores.


default key: TAB
Determines if scores should be shown on death.
Token Description ValuesRangeDefault
V0..11
See also: showscores
Enables or disables showing the player's horizontal speed (vector).
Token Description ValuesRangeDefault
N0: off, 1: on0..10
Turns on/off display of FPS/rendering statistics on the HUD.
Token Description ValuesRangeDefault
N0: Show no stats, 1: Only show FPS stats, 2: Show all stats0..21
Enables or disables showing the player name on the HUD when in your crosshair.
Token Description ValuesRangeDefault
N0: off, 1: on0..11
Turns on/off the display of the hudgun while spectating a player in first-person view.
Token Description ValuesRangeDefault
Vshow/hide hudgun when spectating0..11
Works in demo mode as well.
Toggles the console.


default key: F11
Sets the transparency of the vote display.
Token Description ValuesRangeDefault
NAlpha value0..255255
Show the wall clock with time (usually local, not game-time) on the HUD.
"wallclockformat" alias should contain string in strftime format to show the clock with proper time. If the alias is empty, the wall clock is hidden.
See also: gametimedisplay

Sound

This section describes all identifiers related to music and sound effects.

The distance from the source emitting the sound to the listener.
Token Description ValuesRangeDefault
V0..1000000400
This value indicates the relative "strength" of a sound (how far away the sound can be heard).
Token Description ValuesRangeDefault
V0..1000000100
Enables or disables the audio subsystem in AC.
Token Description ValuesRangeDefault
Benable0..11
Enables verbose output for debugging purposes.
Token Description ValuesRangeDefault
Benable audio debug0..10
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..10008
Token Description ValuesRangeDefault
V0..100015
Token Description ValuesRangeDefault
V0..10008
Token Description ValuesRangeDefault
V0..11
Token Description ValuesRangeDefault
V0..100015
Lists sound index numbers and short descriptions for all sounds of one or more categories.
ArgumentDescriptionValues
Clist of sound categories (flags)PAIN, OWNPAIN, WEAPON, PICKUP, MOVEMENT, BULLET, OTHER, VOICECOM, TEAM, PUBLIC, FFA, FLAGONLY
All sounds with at least one of the flags will be listed. Flag names prefixed with "!" will exclude all matching sound from the list. If no such entities exist or the entity type could not be recognised, the list is empty.

Example: echo (enumsounds "VOICECOM !PUBLIC")It will list all voicecom sounds that are for teams only

Example: echo (enumsounds (listoptions soundcategories))It will list all sounds

See also: sound, registersound
Indicates if the footsteps sound should be played.
Token Description ValuesRangeDefault
Benable footsteps1 (true), 0 (false)0..11
See also: localfootsteps
Each subsequent played sound's gain-value is scaled by this percentage.
Token Description ValuesRangeDefault
Npercentage0..100100
This lowers the gain of the sounds before they are mixed, this might be useful in cases when the mixer has problems with too high gain values.
Defines the health level at or below which a heartbeat sound will be played.
Token Description ValuesRangeDefault
Hhealth value0..990
Plays a sound upon every successful hit if enabled.
Token Description ValuesRangeDefault
Boff OR on0 (disabled), 1 (server), 2 (local)0..20
If hitsound is set to 2, the sound will be played instantly rather than after server acknowledgment.
Indicates if the footsteps sound for the local player should be played.
Token Description ValuesRangeDefault
Benable footsteps1 (true), 0 (false)0..11
See also: footsteps
Specifies the interval for checking mapsounds.
Token Description ValuesRangeDefault
Ninterval in milliseconds0..100010
If set to value 0, the map sounds will be checked in every frame without any interval limitation.
Token Description ValuesRangeDefault
V0..10032
music A B C
Plays music in the background.
ArgumentDescriptionValues
Amusic file name
Bplaytime
Ccommand to be executed, when music is done
Preloads the sound track.
ArgumentDescriptionValues
Nsoundtrack number0 (flag grab), 1 (last minute #1), 2 (last minute #2)
Can be helpful if you experience a delay, e.g. when picking up a flag.
Sets the music volume.
Token Description ValuesRangeDefault
Nthe volume0..255128
See also: soundvol
Mutes a specific game sound.
ArgumentDescriptionValues
NID of the sound to mutesee 'enumsounds', starting at ID 0
Aaudible?(mute) 0 or 1 (unmute)
Registers a track as music.
ArgumentDescriptionValues
Mmusic file
The first three tracks have special meaning: Track #1 is for "flag grab" the second and third are used as "last minute" tracks.
registersound N V L R
Registers a sound.
ArgumentDescriptionValues
Nsound namepath below packages/audio/, without file extension
Vvolume (optional)0..255
Lloop (optional)0 (off), 1 (on)
Raudible radius (optional)
This command returns the sound number, which is assigned from 0 onwards, and which can be used with "sound" command. If the sound was already registered, its existing index is returned. "registersound" does not actually load the sound, this is done on first play.

Example: registersound "player/jump" 80It registers packages/audio/player/jump.ogg sound with volume 80

See also: sound
Plays the specified sound.
ArgumentDescriptionValues
Nnumber of the sound to playinteger
See source/src/server.h file or use "enumsounds" command for default sounds, and use "registersound" to register your own. For example, 'sound 0' and 'sound (registersound "player/jump")' both play the standard jump sound.
Sets the desired amount of allocated sound channels.
Token Description ValuesRangeDefault
number of channels4..1024128
AC will try to allocate that number of channels but it is not guaranteed to succeed.
Returns 1 if sound N is muted, else 0.
ArgumentDescriptionValues
Nsound IDsee 'enumsounds' for valid sound ID

Example: mutesound 5; if (soundmuted 5) [echo Sound 5 is muted!] [echo Sound 5 is not muted!]Output: Sound 5 is muted!

Token Description ValuesRangeDefault
V0..10005
Token Description ValuesRangeDefault
V0..1000100
Token Description ValuesRangeDefault
V0..1000100
Token Description ValuesRangeDefault
V0..1002
Plays all hardcoded sounds in order.
Sets the sound volume for all sounds.
Token Description ValuesRangeDefault
Nthe volume0..255128
Unmutes all previously muted sounds.
See also: mutesound

Serverbrowser

This section describes all identifiers related to the serverbrowser.

Adds a new category in the serverbrowser favourites.
ArgumentDescriptionValues
Areference designator (keep short and unique)
Add new categories to your autoexec.cfg, check favourites.cfg for examples.
Adds a server to the list of server to query in the server list menu.
ArgumentDescriptionValues
Sthe address of the server (hostname or IP)
Pthe port
Clears the server list.
Hides favourites icons in serverbrowser.
Token Description ValuesRangeDefault
N0: show, 1: hide0..10
Lists all registered serverbrowser favourites categories.
Sets the method which client will use to contact the masterserver.
Token Description ValuesRangeDefault
V0: direct TCP connection, 1: HTTP connection (via proxy)0..11
See also: updatefrommaster
Token Description ValuesRangeDefault
V1..24*60*6060*60
See also: updatefrommaster
Sets the number of servers to be pinged at once.
Token Description ValuesRangeDefault
V0..100010
Token Description ValuesRangeDefault
V0..21
Search a nickname (or -part) on all servers.
ArgumentDescriptionValues
Nnickname to search
Hides favourites tag column in serverbrowser.
Token Description ValuesRangeDefault
N-0..21
Hides server IP and port in serverbrowser.
Token Description ValuesRangeDefault
N-0..22
Token Description ValuesRangeDefault
V0..NUMSERVSORT-10
Selects ascending of descending sort order in serverbrowser.
Sort official maps over custom maps in serverbrowser.
Token Description ValuesRangeDefault
N-0..11
Token Description ValuesRangeDefault
V1000..600005000
Shows on serverbrowser number of all players on the all servers.
Token Description ValuesRangeDefault
N0..10
Whether servers that have not yet responded to a ping should be shown in the server list.
Token Description ValuesRangeDefault
V0..11
Show 'minutes remaining' in serverbrowser.
Token Description ValuesRangeDefault
N0..11
Show player names in serverbrowser.
Token Description ValuesRangeDefault
N-0..10
Show only servers of one favourites category in serverbrowser.
Token Description ValuesRangeDefault
Ncategory index0..1000
Show only servers with the correct protocol in serverbrowser.
Token Description ValuesRangeDefault
N-0..10
Show 'weights' in serverbrowser.
Token Description ValuesRangeDefault
N0..11
'weights' are the sort criteria with the highest priority. Favourites categories can change the weights. Use 'showweights' to debug problems with serverbrowser sorting.
Contacts the masterserver and adds any new servers to the server list.
ArgumentDescriptionValues
Bforce update0 (delayed), 1 (immediate)
The servers are written to the config/servers.cfg file. This menu can be reached through the Multiplayer menu.

Server commands

This section lists commands used by the client that communicate to the server. Most are used for server administration. Also see the "mode" section and the "map" command which also communicate to the server.

Sets automated team assignment.
ArgumentDescriptionValues
BEnables or disables auto team1 (On), 0 (Off)
See also: setadmin
ban C R
Temporary ban of the specified player from the server.
ArgumentDescriptionValues
CThe player to banclient number
RThe reasonat least 4 characters
Temporary ban duration is fixed at 20 minutes.
See also: removebans, setadmin
callvote T A B
Calls a vote on the server.
ArgumentDescriptionValues
TVote typevalue
AFirst argument
BSecond argument
This command is wrapped by aliases for better usability and is used to action votes such as ban, kick, etc. See config/admin.cfg for actual uses.
Clears specific demo currently in memory on the server.
ArgumentDescriptionValues
Xnumber in list0 (all), 1..
See also: listdemos, cleardemos
Clears all demos currently in memory on the server.
See also: cleardemo
Deletes a map from the current server.
ArgumentDescriptionValues
Amap name
Calls a vote to forceteam yourself to the specified team.
ArgumentDescriptionValues
Tthe team to force yourself to (optional)0-4
By default, if you are on team CLA or RVSF, this command will force you to the enemy team, no arguments necessary.
See also: forceteam
Calls a vote to force the specified player to switch to the specified team.
ArgumentDescriptionValues
Cclient number of playerinteger
Tthe team to force to0-4
See also: forceme, setadmin
Get vita for a client.
ArgumentDescriptionValues
Cclient number
TODO: elaborate
Gives admin state to the specified player.
ArgumentDescriptionValues
CThe player to become adminclient number
Requires admin state. The admin will lose his admin state after successfully issuing this command.
See also: setadmin
kick C R
Kicks the specified player from the server.
ArgumentDescriptionValues
CThe player to kickclient number
RThe reasonat least 4 characters
See also: setadmin
Sets the mastermode for the server.
ArgumentDescriptionValues
NThe master mode0 (Open), 1 (Private), 2 (Match)
If the mastermode is set to 'private', no more clients can join the server. Default is 'open' which allows anyone to join the server.
See also: setadmin
Removes all temporary bans from the server.
Temporary bans are normally automatically removed after 20 minutes.
See also: ban, setadmin
Sends a map to the server.
ArgumentDescriptionValues
Mmap to send (optional)
During coop edit, the current map gets saved to file and sent to the server. Other players can use 'getmap' to download it.
When not in edit mode, the map will not be saved. The new map will be used, when the next game on that map starts on the server.
See also: getmap, dlmap
Whether or not to output debugging information.
Token Description ValuesRangeDefault
Bboolean1:debug output0..10
Only applies if you're running a client, the standalone server has DEBUGCOND(true) already set.
Sets user-define server description.
ArgumentDescriptionValues
Ddescription
If the server was run with -n1 and -n2 arguments (prefix and suffix of descriptive title) a serveradmin can set a user-defined server description with this command, if it wasn't this command results in "invalid vote". This title will only stay until the next map is loaded.
If, for example, the server was run with -n"Fred's Server" -n1"Fred's " -n2" Server", then you could call "/serverdesc [pWn4g3 TOSOK]" and it would show up as "Fred's pWn4g3 TOSOK Server" in the serverbrowser.
Sends the extension name and argument string to the server, which can use it for custom action.
ArgumentDescriptionValues
Eextension name
Aargument
See source/src/server.cpp ["case SV_EXTENSION:"].
setadmin B PASS
Claims or drops admin status.
ArgumentDescriptionValues
BStatus1 (Claim), 0 (Drop)
PASSPasswordcase sensitive
Failed logins result in an auto kick. The admin is granted the right to kick, ban, remove bans, set autoteam, set shuffleteam, change server description (if enabled), change map, change mastermode, force team, change mode, record demos, stop demos and clear demo(s) - All without needing votes from other users. If the admin votes on any (other players) call, his vote is final. In the scoreboard, the admin will be shown as a red colour.
Shuffles the teams.
The server will attempt to restore balance, but the result may be less that optimal, and there are certainly better ways to keep teams balanced.
See also: forceteam, forceme

Authentication

This section describes identifiers related to player authentication.

Manages a list of keys other than the game key (which is managed by authsetup).
ArgumentDescriptionValues
Pparameterclear, list, delete keyname, new keyname, add keyname privkey, selfcert keyname [comment]
For example, this can be server owner keys or clan boss keys. Options:
"authkey clear" - empties the list and comments out all lines in config/authkeys.cfg.
"authkey list" - lists all authkeys that are currently in memory.
"authkey delete keyname" - deletes the key "keyname" from memory.
"authkey new keyname" - generates a new key with the name "keyname". If a key of that name already exists, it is deleted. The key is added to the list in memory and also written to the file config/authkeys.cfg.
"authkey add keyname privkey" - adds a key with the name "keyname" to the list in memory. The privkey is a 32-byte hexadecimal string, preferrably generated by authkey new. The matching public key is generated automatically from the private key.
"authkey selfcert keyname [comment]" - generates a self-signed certificate for the key "keyname". Being able to create such a cert is proof, that you own the private key of a certain public key.
See also: authsetup
Sets an amount of time (in ms), new password hashes are created with this fixed amount of time.
Token Description ValuesRangeDefault
Namount of time [ms]1<<9..1<<161<<12
Sets a number of megabytes of RAM that are used for the password hash calculation (when new passwords are created).
Token Description ValuesRangeDefault
Nnumber of RAM [MB]2..(1<<10)-124
Sets a number of rounds, if greater than 0, then new password hashes are created with this fixed number of rounds.
Token Description ValuesRangeDefault
Nnumber of rounds0..2^31-10
Manages player authentication.
ArgumentDescriptionValues
Pparameter[empty], pre preprivhex [psalthex pwdcfg], priv privhex [salthex pwdcfg], pub pubhex, ppass preprivpass, pass privpass, passd privpass [commandwhendone], needpass, genpre [prelen], genpriv, genpub, newppass preprivpass [preprivfilename], newpass privpass [privatefilename], unarmed
"authsetup" contains all the funtionality needed to generate, load and save private and public keys, and to lock and unlock the private key with a password.
Private and public keys are used to authenticate the player to servers, and are loaded from private/authprivate.cfg. Private keys can be stored in an "encrypted with password" version - in which case the player has to enter the password after game start. To prevent brute-force cracking of the password, the key-derivation function uses a constant time to encode (usually several seconds). Because of that, the decoding at game start can be done in the background.
The private key is actually itself a public key generated from the prepriv key. The prepriv key should be kept away from the computer, either as hardcopy or on a thumbdrive. The prepriv key is not required to play the game. It can be used to prove ownership of the private key, in case the private key gets stolen. It can also be used to regenerate private and public keys, in case they are lost. The prepriv key can also be encrypted by its own password.
----------
Options:
"authsetup" - checks private and public key and returns "1", if they match.
"authsetup pre preprivhex [psalthex pwdcfg]" - loads prepriv key into memory. Optionally supports encrypted keys.
"authsetup priv privhex [salthex pwdcfg]" - loads private key into memory. Optionally supports encrypted keys.
"authsetup pub pubhex" - loads public key into memory.
"authsetup ppass preprivpass" - decrypts prepriv key with password.
"authsetup pass privpass" - decrypts private key with password.
"authsetup passd privpass [commandwhendone]" - decrypts private key with password in background. Optionally executes cubescript command when done.
"authsetup needpass" - returns "1", if the private key needs decryption.
"authsetup genpre [prelen]" - generates new prepriv key.
"authsetup genpriv" - generates private key from prepriv key.
"authsetup genpub" - generates public key from private key.
"authsetup savepre [preprivfilename]" - saves the prepriv key. The default filename is private/authpreprivate.cfg
"authsetup savepre [privatefilename]" - saves the private key. The default filename is private/authprivate.cfg
"authsetup newppass preprivpass [preprivfilename]" - encrypts prepriv key with new password and saves the result to file. The default filename is private/authpreprivate.cfg and an existing file gets overwritten - but the former file content is kept and also written, each line commented out.
"authsetup newpass privpass [privatefilename]" - encrypts private key with new password and saves the encrypted private key and the public key to file. The default filename is private/authprivate.cfg and an existing file gets overwritten - but the former file content is kept and also written, each line commented out.
"authsetup unarmed" - sets private and public keys to a fixed value. For testing only. Can be used to "log out". Only available in development versions of the game
----------
"authmemusage", "authrounds", "authmaxtime" are only used, when new passwords are created (authsetup new[p]pass). "authmemusage" is the number of megabytes of RAM that are used for the password hash calculation. If "authrounds" is zero (as is default), then the hash algorithm calculates as many rounds as possible in the number of milliseconds specified in "authmaxtime". If "authrounds" is a positive number, then that is the number of rounds to be done, regardless the required time. Note that, since the password hash algorithm is not endianness-aware, it is not possible to move an encrypted password to a machine with different endianness. Moving between 32- and 64-bit machines should be no problem.
Enables some debug messages in crypto.cpp file.
Token Description ValuesRangeDefault
Nenable debugging0..11
See also: authsetup
List all certificates.
TODO: elaborate
Returns a public key of game account.
It returns empty string, if no account exists or it is unusable (due to missing password, for example).
See also: authsetup
newcert X A B C
Create and sign certificates from Cubescript.
ArgumentDescriptionValues
Xcommandclear, start, line, sign
Alinename or pubkeyX:line => pubkey or name; X:sign => actual privkey
Bvalue or commentX:line => actual pubkey, actual privkey or actual name, X:sign => a descriptive comment
Ccommentnewcert line name KEY => a descriptive comment
TODO: elaborate

Editing

Whether or not texture paths are scrutinized.
Token Description ValuesRangeDefault
Bboolean1:yes=>ignore0..10
If during mapload textureslots can't be filled and this is not set to 1 a "missing media" error is raised.
It is used in the optional cubescript config/opt/convmap.cfg
See also: loadnotexture
Set to 1 just before calling a newent command where all attributes are meant to be kept.
Token Description ValuesRangeDefault
Bboolean1:yes=>keep attribute values0..10
It is used in the pasteent scripting.
When creating a new entity of type mapmodel, playerstart or CTF flag the orientation is taken from your current viewing angle. To disable this behaviour for one call only you set the value to of this to 1 and then issue your newentity call with all attributes given.
See also: loadnotexture
Adds an entity of the specified type at the current camera position.
ArgumentDescriptionValues
Ethe entity type or numberlight (1), playerstart (2), pistol (3), ammobox (4), grenades (5), health (6), helmet (7), armour (8), akimbo (9), mapmodel (10), ladder (12), ctf-flag (13), sound (14), clip (15), plclip (16)
It also returns the index number of the new entity, so that the other attributes can be set by editentity.
addselection X Y XS XY
Selects the given area, as if dragged with the mouse holding editmeta.
ArgumentDescriptionValues
Xthe X coordinate
Ythe Y coordinate
XSthe length along the X axis
XYthe length along the Y axis
This command is useful for making complex geometry-generating scripts. It adds a selection to the current list of selections. The dimensions of the current selections can be accessed by the commands selx, sely, selxs and selys. These commands return the list of coordinates corresponding to each selection.
Coordinates are as follows: after a "newmap 6" the top-left corner (the one where the red dot points) are (8,8), the opposite corner is (56,56) (or (120,120) on a "newmap 7" etc.).
Adds the entity #index to the TODO list.
ArgumentDescriptionValues
Iindex
Ccomment (optional)
Entity errors during map load are automatically added to the list. The list is saved and restored with xmaps.
Selects the increment of the map revision number for the next 'savemap'.
Token Description ValuesRangeDefault
Nincrement1..1001
Controls the ambient lighting of the map, i.e. how bright areas not affected by any light entities will appear.
Token Description ValuesRangeDefault
Nthe ambient color0x000000..0xFFFFFF0
During map editing, drop all mapsounds so they can be re-added.
arch S
Makes an arch out of the current selection.
ArgumentDescriptionValues
Sside delta (optional)
The selection must be a heightfield before this command can be used. Will make the arch in the long direction, i.e when you have 6x2 cubes selected, the arch will span 7 vertices. Optionally, sidedelta specifies the delta to add to the outer rows of vertices in the other direction, i.e. give the impression of an arch that bends 2 ways (try "arch 2" on an selection of at least 2 thick to see the effect). Not all arch sizes are necessarily available, see config/prefabs.cfg.
archvertex S V D
Defines a vertex delta for a specific arch span prefab, used by the 'arch' command.
ArgumentDescriptionValues
Sspan valueinteger
Vvertex valueinteger
Ddelta valueinteger
It returns the old value of the vertex, and if the vertex argument is omitted, doesn't change it.
See config/prefabs.cfg for an example on usage.
Enables the "automatic embedded map config data" feature.
With the next map save the map config file will get renamed and the map config data stored inside the map file.
Counts all the mips in the current map and prints their numbers as 1x1/2x2/4x4/8x8/16x16/32x32/64x64.
See also: showmip
Turns on/off clean edit mode.
ArgumentDescriptionValues
Vsets cleanedit on/off0 (off), 1 (on)
While editing in clean edit mode, objects/guides not normally visible remain invisible.
i.e. The grid guidelines, selection borders, entity sparkles, clips, playerstart arrows are hidden
See also: togglecleanedit
Deletes all entities of said type.
ArgumentDescriptionValues
Tthe entity type, see command 'newent'string
See also: delent, deleteentity
Clears list of TODO entities.
ArgumentDescriptionValues
Iindex (optional)
The list is also deleted, when a new map is loaded.
If an entity number is given as an argument, only entries for this entity are cleared.
Clears a set parameters of vantage point.
Restricts 'closest entity' display to one entity type.
ArgumentDescriptionValues
Athe entity type or numberlight (1), playerstart (2), pistol (3), ammobox (4), grenades (5), health (6), helmet (7), armour (8), akimbo (9), mapmodel (10), ladder (12), ctf-flag (13), sound (14), clip (15), plclip (16)
It returns the current value and not change the value if the argument is "-".
Converts the nearest entity (if its a clip or plclip) to its opposite type.

Example: convertclipsAssuming the nearest entity is a clip, it will be converted to a plclip.

Example: convertclipsAssuming the nearest entity is a plclip, it will be converted to a clip.

Copies the current selection into a buffer.


default key: C
See also: paste, copyent
Copies the current closest entity into a buffer.
It also works with the menu list of copied entities. It works only while in edit mode.


default key: - (minus)
See also: pasteent, copy
Makes the current selection into a "corner".
Currently there is only one type of corner (a 45 degree one), only works on a single unit (cube) at a time. It can be positioned either next to 2 solid walls or in the middle of 2 higher floorlevels and 2 lower ones forming a diagonal (and similar with ceiling).
In both cases, the corner will orient itself automatically depending on its neighbours, behaviour with other configurations than the 2 above is unspecified. Since the latter configuration generates possibly 2 floor and 2 ceiling levels, up to 4 textures are used: for example for the 2 floors the higher one will of the cube itself, and the lower one of a neighbouring low cube. You can make bigger corners at once by issuing "corner" on grid aligned 2x2/4x4/8x8 selections, with equal size solid blocks next to them.


default key: K
Returns the number of solid walls contained into the current selection.
ArgumentDescriptionValues
Tthe integer of type of the walls you want to count 0 (solid), 1 (corner), 2 (floor heightfield), 3 (ceil heightfield), 4 (empty cube), 5 (semi solid)

Example: echo (concat "The selection contains " (countwalls 0) "solid wall(s)")Output: The selection contains 3 solid wall(s)

Deletes the entity closest to the player.


default key: BACKSPACE
Deletes a map entity.
ArgumentDescriptionValues
Nentity index/number
Note: deleting an entity only marks it as unused. It will be completely removed after saving and loading the map.
Deletes an unused mapmodel slot.
ArgumentDescriptionValues
Nmapmodel slot number
Ppurge
If "purge" is specified as second argument, it also deletes an used slot (including all map entities which use that mapmodel).
Also it enables automapconfig.
Deletes an unused map sound slot.
ArgumentDescriptionValues
Nmap sound slot number
Ppurge
If "purge" is specified as second argument, it also deletes an used slot (including all map entities which use that sound).
Also it enables automapconfig.
Deletes an unused texture slot.
ArgumentDescriptionValues
Ntexture slot number0..255
Pdelete used slot?purge
Rreplacement slot0..255
If "purge" word is put as second argument, it also deletes an used slot. All mapmodels that use that texture as skin are changed to default skin. All world geometry, which uses the texture, is instead set to use slot #255 or a specified replacement slot. Slots below #5 always require "purge", no matter if they are in use (default slots).
Also enables automapconfig.
Returns a value for the main axis of player orientation.
Description ValuesRangeDefault
main axis of player orientation11 (X), 12 (Y), 13 (Z), 111 (-X), 112 (-Y), 113 (-Z)0..1130
"100" is added if the player is looking in the negative direction of the axis.
Edits a map entity.
ArgumentDescriptionValues
Nentity index/number
Alist of attributes (optional)
It edits only parameters given a non-empty value. Returns the type and the values of all attributes (x, y, z, attr1 - attr7). It uses float values for some attributes, return values also may be float.

Example: echo (editentity 33)Prints all attributes of map entity number 33, for example "light 174 172 12 20 255 200 200 0 0 0"

Example: editentity 33 "" 173Changes the y-position of entity 33 to 173

Changes the height of the current selection.
ArgumentDescriptionValues
Tan integer denoting the type0 (floor), 2 (ceiling)
Dthe delta value to move it in1 (forwards), -1 (backwards)


default keys:

[ - moves downwards the selection in the floor

] - moves upwards the selection in the floor

O - moves downwards the selection in the ceiling

P - moves upwards the selection in the ceiling

Integer variable containing a bitmask of hidden entity types.
Update the edit info panel every N milliseconds.
Token Description ValuesRangeDefault
Nmillisecondsinteger5..200080
A variable indicating if the game is in editmode.
Description ValuesRangeDefault
editmode in singleplayer1 (true), 0 (false)0..10
See also: editing_sp
A variable indicating if the game is in singleplayer editmode.
Description ValuesRangeDefault
editmode1 (true), 0 (false)0..10
See also: editing
How long the temporary bits of showeditingsettings are displayed.
Token Description ValuesRangeDefault
Ttimetime in milliseconds750..750007500
Slide in/out the boxes and/or text of the showeditingsettings display.
editmapmodelslot N R H Z 0 P
Edits the parameters of a mapmodel slot.
ArgumentDescriptionValues
Nmapmodel slot numberinteger
Rradiusinteger
Hheightinteger
Zz-offsetinteger
0redundant, leave it at zero so you don't break the command0
Pmapmodel pathstring
Edits the parameters of a mapmodel slot. Only non-empty parameters actually change something.
The command returns the resulting data of the mapmodel slot. If only the mapmodel slot number is specified, no changes are made, but the current data is returned (also in non-edit mode). Therefore the command can be used to get and set parameters.
If anything is changed, automapconfig is enabled.

Example: editmapmodelslot 33 "" "" -5sets the z-offset of slot #33 to -5 without affecting other parameters

Example: echo (editmapmodelslot 33)prints the current parameters of mapmodel slot #33 , for example: 0 0 0 0 "makke/lightbulb"

Allows to edit the map message.
See also: mapmsg
Edits path/name and maxuses parameters of a mapsound slot.
ArgumentDescriptionValues
Nmap sound slot number
Pmap sound path
Mmaxuses
Only non-empty parameters actually change something. The command returns the resulting data of the map sound slot. If only the map sound slot number is specified, no changes are made, but the current data is returned (also in non-edit mode). Therefore the command can be used to get and set parameters.
If anything is changed, automapconfig is enabled.
First modifier key for editing mode.
Go to references mentioned below to see the use.


default key: left Ctrl
Second modifier key for editing mode.
Go to references mentioned below to see the use.


default key: left Shift
Indicates if second editmeta key is pressed.
Description ValuesRangeDefault
state of the second editmeta key0: unpressed, 1: pressed0..10
See also: editmeta2
Indicates if editmeta key is pressed.
Description ValuesRangeDefault
state of the first editmeta key0: unpressed, 1: pressed0..10
See also: editmeta
ArgumentDescriptionValues
Ttaginteger value
Sets tag clip type of all selected cubes.
ArgumentDescriptionValues
Ttype0 (none), 64 (clip), 128 (plclip)
Type can be numeric or a keyword.


default keys:

1 on the keypad - sets a tag clip: none

2 on the keypad - sets a tag clip: clip

3 on the keypad - sets a tag clip: plclip

edittex T D
Changes the texture on current selection by browsing through a list of textures directly shown on the cubes.
ArgumentDescriptionValues
Tan integer denoting the type0 (floor), 1 (lower or wall), 2 (ceiling), 3 (upper wall)
Dthe direction you want to cycle the textures in1 (forwards), -1 (backwards)
Default keys are the six keys above the cursor keys, which each 2 of them cycle one type (and numpad 7/4 for upper-wall).
The way this works is slightly strange at first, but allows for very fast texture assignment. All textures are in 3 individual lists for each type (both wall kinds treated the same), and each time a texture is used, it is moved to the top of the list. So after a bit of editing, all your most frequently used textures will come first when pressing these keys, and the most recently used texture is set immediately when you press the forward key for the type. These lists are saved with the map. Make a selection (including wall bits) and press these keys to get a feel for what they do.


default keys:

Insert - browses forward through floor textures

Delete - browses backward through floor textures

Home - browses forward through wall textures

End - browses backward through wall textures

Page Up - browses forward through ceiling textures

Page Down - browses backward through ceiling textures

7 on the keypad - browses forward through upper-wall textures

4 on the keypad - browses backward through upper-wall textures

X + mouse scroll - scrolls wall and upper-wall textures

Z + mouse scroll - scrolls floor or ceiling textures

See also: hudtexttl
Edits the parameters of a texture slot.
ArgumentDescriptionValues
Ntexture slot number0..255
Sscale
Ppath
Only non-empty parameters actually change something. The command returns the resulting data of the texture slot. If only the texture slot number is specified, no changes are made, but the current data is returned (also in non-edit mode). Therefore the command can be used to get and set parameters.
If anything is changed, automapconfig is enabled.

Example: edittextureslot 33 "" "arcitool/rohbaubims.jpg"Sets texture name of slot #33

Example: echo (edittextureslot 33)Prints the current parameters of texture slot #33, for example: 0 "zastrow/3wood_crate_10.jpg"

Puts a texture slot in a "last used" list up front.
ArgumentDescriptionValues
Ssurfacefloor, wall or ceiling
Ntexture slot number0..255
The first parameter picks the list, the second parameter is the texture slot number to be used for the next edit.
Switches between map edit mode and normal.
In map edit mode you can select bits of the map by clicking or dragging your crosshair on the floor or ceiling (using the "attack" identifier, normally MOUSE1), then use the identifiers below to modify the selection. While in edit mode, normal physics and collision don't apply (clips), and key repeat is ON. Note that if you fly outside the map, cube still renders the world as if you were standing on the floor directly below the camera.


default key: E
See also: select, Coopedit
Loads the map config file, includes it in the map header and renames the original config file.
Embedded config files take precedence over regular config files.
Automatically enlarge selections after placing arches or slopes.
Token Description ValuesRangeDefault
N0: don't enlarge selection, 1: enlarge selection0..10
If the variable is set to 1, after placing an arch or a slope, the selection is enlarged, so that the arch or slope can be changed by vdelta increments (for example, to raise an arch in 1/4 cube increments).
If the variable is set to 0 (which is default), the selection remains unchanged. This way, for example, the arch can be raised or lowered by regular cube increments.
See also: arch, slope
Enlarges all selections by one cube in x- and y- direction, to change a selection from the "cube area" to the "vdelta area".
ArgumentDescriptionValues
Iincremente (optional)
If an argument is given, it is used as increment value, so, for example "enlargevdeltaselections -1" undoes a previous enlargement.
See also: select, addselection
Changes property (attributes) of the closest entity.
ArgumentDescriptionValues
Aattribute index0..6 (atrr1 - attr7), 11..13 (x, y, z)
Iattribute increment
Uunscaled flag (optional)0 or 1
For example 'entproperty 0 2' when executed near a lightsource would increase its radius by 2.
Keys 1..7, in combination with the scrollwheel, can be used to alter the new entity attributes (attr1 - attr7). Key "M", in combination with the scrollwheel, can be used to move the entity. Pressing editmeta speeds up the scrolling. Pressing editmeta2 enables unscaled editing of entity attributes.
Increment is a float for some attributes. If "unscaled" flag is "1", increment is applied as unscaled integer, which means, it will change float attributes at their highest resolution.
If 100 is added to the attribute index parameter, the sign of the increment value is changed.
entset E attr1 attr2 attr3 attr4 attr5 attr6 attr7
Edits the closest entity.
ArgumentDescriptionValues
Ethe entity type or numberlight (1), playerstart (2), pistol (3), ammobox (4), grenades (5), health (6), helmet (7), armour (8), akimbo (9), mapmodel (10), ladder (12), ctf-flag (13), sound (14), clip (15), plclip (16)
attr1see newent 'type'
attr2see newent 'type'
attr3see newent 'type'
attr4see newent 'type'
attr5see newent 'type'
attr6see newent 'type'
attr7see newent 'type'
Overwrites the closest entity with the specified attributes. Some attributes may be specified as floats.
See also: editentity
Prints some map entity statistics to the console.
Returns a list of the numbers of all entities of that type.
ArgumentDescriptionValues
typethe entity typelight, sound, clip, plclip, playerstart, pistol, ammobox, grenades, health, armour, akimbo, mapmodel, ladder, ctf-flag, helmet
If no such entities exist or the entity type could not be recognised, the list is empty.
Returns a list of TODO entities.
Returns entity index number and comment for every entry.
Levels the floor/ceiling of the selection.
ArgumentDescriptionValues
Tan integer denoting the type0 (floor), 2 (ceiling)


default keys:

, - equalizes the selection on the floor

. - equalizes the selection on the ceiling

Increases the size of the current selection by N cubes on all sides.
ArgumentDescriptionValues
Nnumber of cubesinteger
Instead of manually executing this command, you can bind "domodifier 11" to a key. While holding this key you can expand/shrink the current selection with the mouse wheel.
It works also with multiple selections.
Writes an embedded config file to a separate file and removes it from the map header.
A variable indicating if the player looks at the floor or at the ceiling.
Description ValuesRangeDefault
flrceil0 (floor), 2 (ceiling)0..20
Sets all light values to fullbright.
Token Description ValuesRangeDefault
Bsets fullbright on or off0 (off), 1 (on)..
Will be reset when you issue a 'recalc'. Only works in edit mode.


default key: F7 - toggles fullbright
Sets the level of brightness to use when using the command "/fullbright 1".
Token Description ValuesRangeDefault
VLight intensity level0..255176
Returns "1" if automapconfig is already enabled, "0" otherwise.
See also: automapconfig
Returns the entity index number of the closest entity (or of the pinned entity, if one exists).
Returns -1, if no entities are on the map.
Returns always exactly the entity, that edit commands like delent will use next.
Returns a list of deleted entities.
Each line contains the entity type, the position and all seven attributes.
Returns the value of the selected attribute of the nearest entity.
ArgumentDescriptionValues
Aattribute index0..6
Uunscaled flag (optional)0 or 1
It returns float values for some attributes. If "unscaled" flag is "1", raw integer values (representing the highest resolution) are returned.
Returns the entity type of the nearest entity.
Returns values for all attributes to a specific mapmodel.
ArgumentDescriptionValues
Pmodel path
Nattribute name (optional)keywords, desc, defaults, usage, author, license, distribution, version
If modelpath is a number, it is interpreted as index for the list of models in the current map config. If no attribute name is specified, all attributes are printed to the console instead.
Returns a list of all *.wav and *.ogg files below packages/audio/ambience.
Returns the location where the map sound file actually can be found.
ArgumentDescriptionValues
Nfilename or partial path with filename
The possibilities are:
"official": mapsound file was found in the working directory, which indicates an official mapsound.
"custom": mapsound file was found in the profile directory, which means, the mapsound is either manually installed or downloaded.
"package dir #x": mapsound file was found in a mod directory.
"<file not found>"
Returns the "last written" timestamp of the current map in the requested format.
ArgumentDescriptionValues
fmtformatstrftime format
If "fmt" starts with "U", the time is given as UTC, otherwise as local time. If "fmt" is empty, or not given or just the "U", the format defaults to "YYYYMMDD_hh.mm.ss". Use "%c" to get something nicer.
The same format options as in strftime().
gettexturelist includes excludes extensions
Returns a table of all texture files fitting a certain description.
ArgumentDescriptionValues
includesOptional list of path prefixes to include in the table.
excludesOptional list of path prefixes to exclude from the table.
extensionsOptional list of filename extensions to include in the table.
All files found under packages/textures are examined.
By default, the command returns a list with two columns: path and filename. If "excludes" is exactly one path prefix to exclude, the table gets a third column with path names without that prefix. If "extensions" is exactly one extension which does not start with the character '.', the table gets an additional (third or fourth) column containing file names without that extension.

Example: echo (gettexturelist)Outputs two columns like "noctua/wall" "wall02.jpg"

Example: echo (gettexturelist "" "map_editor skymaps")Outputs two columns like "noctua/wall" "wall02.jpg", but omits skymaps and special textures for the editor

Example: echo (gettexturelist makke)Outputs only textures by makke and adds a third column like "makke/rattrap" "rb_box_03.jpg" "/rattrap"

Example: echo (gettexturelist "skymaps/" "" "_ft.jpg") Outputs four columns like "skymaps/egypt" "egypt_ft.jpg" "egypt" "egypt", "skymaps/humus" "meadow_ft.jpg" "humus" "meadow"

Returns the location where the texture file actually can be found.
ArgumentDescriptionValues
Nfilename or partial path with filename
The possibilities are:
"official": texture file was found in the working directory, which indicates an official texture.
"custom": texture file was found in the profile directory, which means, the texture is either manually installed or downloaded.
"package dir #x": texture file was found in a mod directory.
"<file not found>"
Returns string with coordinates of vantage point or empty string, if none is set.
Returns a string with the four components of the water colour: red, green, blue and alpha.

Example: echo (getwatercolor)Output: 20 25 20 178

Returns a list of all regular xmaps in memory, or, if 'what' is "bak", the details of a stored backup xmap.
ArgumentDescriptionValues
wwhat (optional)bak
Each xmap is listed with nickname and description.
See also: xmap_list
Visit next or previous player spawn entity.
ArgumentDescriptionValues
Ndirectionnone or 1: next, -1: previous
See also: nextplayerstart
Jump to the location of a map entity.
ArgumentDescriptionValues
Nthe entity number
You can get the entity number with use "enumentities" command.
See also: enumentities
gotoposition x y z yaw pitch
Only in edit mode: gets and sets camera position.
ArgumentDescriptionValues
xX coordinatefloat
yY coordinatefloat
zZ coordinatefloat
yawyawinteger
pitchpitchinteger
Returns x, y, z, yaw and pitch. Sets x, y, z, yaw and pitch, if the parameter is not an empty string.

Example: echo (gotoposition)Output: 67.7 78.6 5.5 8 0

Example: gotoposition "" "" "" 180 0Change yaw and pitch to look straight in +y direction.

Sets camera position in vantage point.
It returns 1, if the map actually has a vantage point set.
Enables or disables a special set of default textures while editing.
The textures in "packages/textures/map_editor" are used.
Marks the current selection as a heightfield.
ArgumentDescriptionValues
Tan integer denoting the type0 (floor), 2 (ceiling)
It marks the current selection as a heightfield, with T being floor or ceiling, as above. A surface marked as heightfield will use the vdelta values (see below) of its 4 corners to create a sloped surface. To mark a heightfield as normal again (ignoring vdelta values, set or not) use "solid 0".
Heightfields should be made the exact size that is needed, not more not less. The most important reason for this is that cube automatically generates "caps" (side-faces for heightfields) only on the borders of the heightfield. This also means if you have 2 independent heightfields accidentally touch each other, you will not get correct caps. Also, a heightfield is slightly slower to render than a non-heightfield floor or ceiling. Last but not least, a heightfield should have all the same baseheight (i.e. the height determined by a normal editheight operation) to get correct results.


default keys:

H - makes the selection on the floor a heightfield

I - makes the selection on the ceiling a heightfield

See also: vdelta
Hide the edit info panel.
Token Description ValuesRangeDefault
N0: show, 1: hide0..10
Hide the closest entity filename info.
Token Description ValuesRangeDefault
N0: show info always, 1: only show "unassigned slot" if necessary, 2: never show info0..20
Show preview of textures during editing.
Token Description ValuesRangeDefault
Ttime to show texture preview [ms]0..100002500
When textures of the map geometry are changed, five textures around the current pick from the "last used" stack are shown.
The texture assigned to the "sky" slot is not shown. Instead, a plain blue rectangle is used.
See also: edittex
Returns a table of all known mapmodels.
ArgumentDescriptionValues
Nlist of attribute namesexplodekeywords, sortby: keywords, desc, defaults, usage, author, license, distribution, version
Each model is listed with the modelpath and the values for the requested attributes. To be used instead of a fixed table in menu_edit.cfg.
In addition to attribute names, the function also allows the keywords "explodekeywords" and "sortby:" as arguments. If "explodekeywords" is given, all mapmodels with more than one keyword are listed multiple times, once for each keyword. If an attribute name is preceeded by "sortby:" the list will be sorted by this table column. If "sortby:" is used several times, this first sort will have highest priority. The list is always sorted by path by default.

Example: listallmapmodelattributes sortby: author sortby: desc explodekeywords

Returns a list with additional data ("header extras") from current map header.
The header extras can be permanent, like the embedded config file, or can be used only once after map load, like the undo/redo data. Additional extra data can be easily added and will not break backward compatibility.
Tries to load mapmodels from all paths below packages/models/mapmodels.
It will throw a lot of error messages, because not all directories contain models to load. This command can be used to build or rebuild the complete list of all available mapmodels. It is only necessary, if models are added manually to the directories, since every mapmodel gets added to the list when it is loaded - which takes care of all automatically downloaded models.
Calculates some key values to determine map geometry viability.
ArgumentDescriptionValues
Wwhatvdelta, steepest, total, pprest, pp (default)
It returns different sets of statistics, depending on the keyword "what":
"vdelta" - returns table of numbers of cubes within a certain range of vdelta differences (steepness). First entry is "0..2 cubes steep", next is "2..4" and so on.
"steepest" - returns the coordinates of the steepest heightfield cube.
"total" - returns the number of non-solid cubes on the map.
"pprest" - returns the number of cubes _not_ visible from one of the probe positions.
"pp" (default) - returns a table of all (currently 64) probe points of the map. Each probe point is listed with: x-coordinate, y-coordinate, floor height, area visible, volume of visible area, average height in visible area.
Adds artist info to a map.
ArgumentDescriptionValues
NPrints the map artist player IDprint
Sets the map artist player ID to the player currently logged inset
Returns the current map artist player IDget
Erases an existing map artist record in the current mapclear
See also: modeinfo
Determines if map backups (.bak) should be created when a map is saved.
Token Description ValuesRangeDefault
N0 off, 1 on0..11
Enlarges the current map.
This command will make the current map 1 power of two bigger. So a size 6 map (64x64 units) will become a size 7 map (128x128), with the old map in the middle (from 32-96) and the new areas solid.
See also: newmap, mapsize, mapshrink
Sets the map comment string.
ArgumentDescriptionValues
Ccommentstring
The variable is stored withing the header of a map file. The comment string is ignored, as long as no map license string is set.
You can get the comment string with the $mapinfo_comment variable.
See also: mapinfo_license
Sets the map license.
ArgumentDescriptionValues
Ltype of licensestring
The name of license is stored withing the header of a map file. The license string is meant to hold an abbreviated name of the license, picked from a list of known map licenses.
You can get the type of map license with the $mapinfo_license variable.
See also: mapinfo_comment
Set to "1" with every command that changes mapmodel slots.
Token Description ValuesRangeDefault
N0: not changed, 1: changed0..10
Should be used to trigger a rebuild of mapmodel menus.
Adds values for all attributes to a specific mapmodel.
ArgumentDescriptionValues
Pmodel path
Vlist of all attribute values
This is used to restore the cached values from config/mapmodelattributes.cfg during game start. It does not actually verify of load the model.
Returns the slot number registered in the map config file of the model with the given name.
ArgumentDescriptionValues
Mmapmodel name (with path)

Example: echo (mapmodelslotbyname "mapmodels/makke/platform_bridge")Output: 5

Returns the map model name (and path) of the mapmodel registered in the given slot number in the map config file.
ArgumentDescriptionValues
Nmapmodel slot number
Returns a list of map entity indices which use a certain mapmodel slot.
ArgumentDescriptionValues
Nmapmodel slot number
If the mapmodel is unused, it returns an empty string.
It returns a single space, if the model slot is not used by any map entity, but is required by another model (with entities).
Allows negative z-offsets for mapmodels.
ArgumentDescriptionValues
Nmapmodel slot number
A mapmodel entity is placed at a z-coordinate that is based on the floor height of map geometry and a z-offset. The z-offset is a sum of the entity attribute 3 and the third mapmodel slot parameter. The entity z-offset can range from 0 to 255 while the mapmodel slot parameter can be any integer including negative numbers. So, to place a mapmodel below floor height, the mapmodel slot parameter has to be negative.
"mapmodelzoff" script decreases the mapmodel slot parameter by one and increases the z-offset of every mapmodel which uses that slot also by one. This means, that all mapmodel are exact in the same place afterwards - but the entity z-offset now has room to lower the mapmodel by one more cube.
If you need more z-offset available, run the script several times.
Cleanups hidden map attributes.
"mapmrproper" tries to optimize hidden attributes of maps in a way, that the map can be handled in bigger chunks by the renderer.
The mipmapping routine does not take into account, if certain textures of a cube are visible at all, when it collects otherwise identical cubes to be handled en-bloc. "mapmrproper" changes invisible textures in a way, that the cubes are in fact identical - so, that the mipmapper is satisfied. The optimizer does not change any map properties that are visible in any way.
Before any changes are made, mapmrproper creates a backup, which can be restored by "undo" command. Enable mipstats ("showmip" command), to see, what has been done.
See also: showmip
Sets the map message, which will be displayed when the map loads.
ArgumentDescriptionValues
MThe map messagestring
You will need to use quote marks around the message, otherwise it save the message correctly.
For example: /mapmsg "Map By Author"
You can get the current map message with the $mapmsg variable.
See also: editmapmsg
Reduces the world size by 1.
This command will make the current map 1 power of two smaller. So a size 7 map (128x128) will become a 6 size map (64x64 units), by removing 32 cubes from each side. The area to be removed needs to be empty (= all solid).
Outputs the mapsize.
Set to "1" with every command that changes mapsound slots.
Token Description ValuesRangeDefault
N0: not changed, 1: changed0..10
Should be used to trigger a rebuild of mapsound menus.
Returns the list of numbers of all mapsound slots which use that sound file.
ArgumentDescriptionValues
Nmap sound filename
Returns a list of map entity indices which use a certain map sound slot.
ArgumentDescriptionValues
Nmap sound slot number
If the sound is unused, it returns an empty string.
Adds modeinfo info to a map.
ArgumentDescriptionValues
NLists current modeinfo entrieslist
Returns list of current modeinfo entriesget
Erases current list of modeinfo entriesclear
Specifies flags for a list of modes<modelist> <modeflags>
See possibilities of mode list and flags (keywords) in config/maprot.cfg file. To use flags for all modes you can use "all" value instead of mode list.
See also: mapartist
movemap dX dY dZ
Moves the whole map (including all entities) in the specified direction.
ArgumentDescriptionValues
dXx-offset
dYy-offset
dZz-offset
newent E attr1 attr2 attr3 attr4 attr5 attr6 attr7
Adds a new entity.
ArgumentDescriptionValues
Ethe entity type or numberlight (1), playerstart (2), pistol (3), ammobox (4), grenades (5), health (6), helmet (7), armour (8), akimbo (9), mapmodel (10), ladder (12), ctf-flag (13), sound (14), clip (15), plclip (16)
attr1see newent 'type'
attr2see newent 'type'
attr3see newent 'type'
attr4see newent 'type'
attr5see newent 'type'
attr6see newent 'type'
attr7see newent 'type'
(x,y) is determined by the current selection (the red dot corner) and z by the camera height, of said type. The type of entity may optionally take attributes (depending on the entity).
Adds a new akimbo item.
Adds a new ammo box item.
Adds a new armour item.
newent clip Z X Y H
Adds a clip entity.
ArgumentDescriptionValues
Zelevation above the groundinteger
XX radius around the box centerinteger
YY radius around the box centerinteger
Hheight of the boxinteger
Defines a clipping box against which the player will collide.
Use this clip type to clip visible obstacles like fences or the gas tank. If you only want to prevent a player from entering an area, use plclip instead.
Adds a CTF flag entity.
ArgumentDescriptionValues
Tdenotes the flag's team0 (CLA), 1 (RVSF)
Note that outside of edit mode, this entity is only rendered as flag if the current game mode is CTF.
Adds a new grenades item.
Adds a new health item.
Adds a new helmet item.
Adds a ladder entity.
ArgumentDescriptionValues
Hthe height of the ladderinteger
Note that this entity is used for physics only, to create a visual ladder you will need to add a mapmodel entity too.
See also: newent mapmodel
newent light radius R G B
Adds a new light entity.
ArgumentDescriptionValues
radiusthe light radius1..32
Rred colour component, see remarks below1..255
Ggreen colour component1..255
Bblue colour component1..255
if only argument R is specified, it is interpreted as brightness for white light.
Adds a map model to the map (i.e. a rendered md2/md3 model which you collide against but has no behaviour or movement).
ArgumentDescriptionValues
NThe mapmodel identifierinteger
ZExtra elevation above ground (optional)integer
TThe map texture to use (optional)integer
The mapmodel identifier is the desired map model which is defined by the 'mapmodel' command. The order in which the mapmodel is placed in the map config file defines the mapmodel identifier. The map texture refers to a texture which is defined by the 'texture' command, if omitted the models default skin will be used. The 'mapmodel' and 'texture' commands are placed in the map config normally. Mapmodels are more expensive than normal map geometry, so do not use insane amounts of them to replace normal geometry.
Adds a pistol magazine item.
Adds a new spawn spot.
The yaw is taken from the current camera yaw.
newent plclip Z X Y H
Adds a player clip entity.
ArgumentDescriptionValues
Zelevation above the groundinteger
XX radius around the box centerinteger
YY radius around the box centerinteger
Hheight of the boxinteger
Defines a clipping box against which (only) the player will collide.
Use this clip type to define no-go areas for players without visible obstacles, for example to prevent players from walking on a wall.
Nades will not be affected by this clip type.
newent sound N R S V
Adds a sound entity.
ArgumentDescriptionValues
Nthe sound to playinteger
Rthe radius
Sthe size (optional)default 0
Vthe volume (optional)default 255
Will play map-specific sound so long as the player is within the radius. However, only up to the maxuses allowed for N (specified in the mapsound command) will play, even if the player is within the radius of more N sounds than the max. By default (size 0), the sound is a point source. Its volume is maximal at the entity's location, and tapers off to 0 at the radius. If size is specified, the volume is maximal within the specified size, and only starts tapering once outside this distance. Radius is always defined as distance from the entity's location, so a size greater than or equal to the radius will just make a sound that is always max volume within the radius, and off outside.
A sound entity can be either ambient or non-ambient. Ambient sounds have no specific direction, they are 'just there'. Non-ambient sounds however appear to come from a specific direction (stereo panning). If S is set to 0, the sound is a single point and will therefore be non-ambient. However if S is greater than 0, the sound will be ambient as it covers a specified area instead of being a single point.
See also: mapsound
Creates a new map.
ArgumentDescriptionValues
Sthe size of the new map6..9
The new map has 2^S cubes. For S, 6 is small, 7 medium, 8 large.
Chooses another 'closest ent'.
Use this, when two entities are placed in exactly the same location.
Visit next player spawn entity.
ArgumentDescriptionValues
Nteam number0: CLA, 1: RVSF, 100: FFA
Enables or disables using squares to render the editing grid/current selection instead of triangles.
Token Description ValuesRangeDefault
N0 off, 1 on0..11
This alias will automatically be executed when a new map is created via the "newmap" command.
Does not affect the loading of an existing map.
Pastes a previously copied selection.
To paste a selection back requires a same size selection at the destination location. If it is not the same size the selection will be resized automatically prior to the paste operation (with the red dot as anchor), which is easier for large selections.


default key: V
See also: copy
Pastes a previously copied entity.
It also works with the menu list of copied entities. It works only while in edit mode.
Pressing "editmeta" while using "pasteent" opens the menu with a list of copied entities.
See also: copyent, editmeta
perlin S E C
Generates a perlin noise landscape in the current selection.
ArgumentDescriptionValues
Sthe scale, frequency of the featuresdefault is 10
Ethe random seedinteger
Ccube size, how many cubes to generate a surface for at once (unused)
Keep the seed the same to create multiple perlin areas which fit with each other, or use different numbers if to create alternative random generations.
Enables or disables pointing at entity sparklies.
Token Description ValuesRangeDefault
Bboolean0: nearest, 1: pointed at0..10
If an entity is pointed at during disabling, it is pinned.
Specifies the required precision for pointing at entities sparklies.
Token Description ValuesRangeDefault
N0: not changed, 1: changedfloat0.01..180.02.0
See also: pointatent
Determines if undo data should be preserved on using "savemap" command.
Token Description ValuesRangeDefault
N0: don't preserve undos, 1: preserve undos0..10
Undo data can be saved only in edit mode.
See also: savemap
Stores the positions of all current selections.
Can be used repeatedly. To restore the selections, type "popselections".
See also: select, addselection
Recomputes all there is to recompute about a map, currently only lighting.
Redoes editing operations undone by 'undo'.
With editmeta pressed it also restores player position and selects the affected area.


default key: R
See also: undo, editmeta
Repeats the last texture edit throughout the map.
The way it works is intuitive: simply edit any texture anywhere, then using "replace" will replace all textures throughout the map in the same way (taking into account whether it was a floor/wall/ceil/upper too). If the there was more than one "old" texture in your selection, the one nearest to the red dot is used. This operation can't be undone.
Variable, which is set to "1" when a sound is downloaded.
Token Description ValuesRangeDefault
Nis sound downloaded?0: no, 1: yes0..11
Used to trigger menu rebuilds.
Variable, which is set to "1" when a texture is downloaded.
Token Description ValuesRangeDefault
Nis texture downloaded?0: no, 1: yes0..11
Used to trigger menu rebuilds.
See also: rereadsoundlists
Resets all current selections.
Saves the current map.
ArgumentDescriptionValues
Mfile name of the map, see command 'map' for the naming schemestring
It makes a versioned backup (mapname_N.BAK) if a map by that name already exists. If the name argument is omitted, it is saved under the current map name.
Where you store a map depends on the complexity of what you are creating: if its a single map (maybe with its own .cfg) then the "base" package is the best place. If its multiple maps or a map with new media (textures etc.) its better to store it in its own package (a directory under "packages"), which makes distributing it less messy.
For "savemap" to save different maps during editing with undo data, the variable "preserveundosonsave" has to be "1". It is "0" by default. "savemap" when not editing saves optimised map, with no undo data.
Saves a map in old map format 9 (may lose some map details that are not possible with format 9).
Saves optimised the current map, with no undo data.
ArgumentDescriptionValues
Mfile name of the map, see command 'map' for the naming schemestring
It makes a versioned backup (mapname_N.BAK) if a map by that name already exists. If the name argument is omitted, it is saved under the current map name.
See also: map, savemap
Scales all lights in the map.
ArgumentDescriptionValues
Ssize change (percentage)
Iintensity change (percentage)
This command is useful if a map is too dark or bright but you want to keep the light entities where they are.
select X Y XS XY
Resets all current selections and selects the given area, as if dragged with the mouse.
ArgumentDescriptionValues
Xthe X coordinate
Ythe Y coordinate
XSthe length along the X axis
XYthe length along the Y axis
This command is similar to addselection although "select" resets all selections.
Selects the whole map (minus the two cubes wide border).
Flips the selected part of the map at an axis.
ArgumentDescriptionValues
AXISX or Y
Rotates the selected part of the map in 90 degree steps.
ArgumentDescriptionValues
Dsteps
To rotate clockwise, use a positive number of steps. Note, that only quadratic selections can be rotated by 90 degrees.
selectionwalk action beginsel endsel
Iterates over all cubes in all selections and executes "action" for each cube.
ArgumentDescriptionValues
actionaction
beginselbegin action before cubes action of each selection (optional)
endselend action before cubes action of each selection (optional)
The cubes of every selection are framed by executions of "beginsel" and "endsel", i.e. for each new selection, before executing "action" for the cubes of that selection, "beginsel" is executed, and then, after actions for all cubes of that selection, "endsel" is executed. The action script is allowed to make changes to cube attributes, and if it does, an undo point is automatically added. "beginsel" and "endsel" are optional.
While the scripts are executed, several aliases provide further info:
"sw_cursel" - position and size of the current selection. Valid in all three scripts. Holds four integer values for x, y, xs, ys. See "select" command for details.
(all following aliases are only valid during the execution of the action script and provide the attributes of one cube of the map)
"sw_abs_x", "sw_abs_y", "sw_rel_x", "sw_rel_y" - absolute and relative (within the current selection) coordinates of the current cube. Read-only values.
"sw_type" - type of the current cube. Can be 0..4 for SOLID, CORNER, FHF, CHF and SPACE. May be changed to other numerical value or keyword.
"sw_floor", "sw_ceil" - floor and ceiling heights of the current cube. Range -128..127.
"sw_wtex", "sw_ftex", "sw_ctex", "sw_utex" - texture slot indices for wall, floor, ceiling and upper wall of the current cube.
"sw_vdelta", "sw_tag" - vdelta and tag values of current cube.
"sw_r", "sw_g", "sw_b" - current light values of current cube. Can be edited, but only with temporary effect. Will be reset with the next light recalc.
The command is mostly useful for statistics scripts (like counting cubes with certain attributes), but is can also be used for scripted editing, as the following (useless) example shows: selectionwalk [ += sw_floor (rnd 2) ]
See also: select, addselection
Returns the x-coordinate of the westernmost (towards negative x) cube(s) in the current selection.
See also: select, sely, selxs, selys
Returns the x-span (size on the x-axis) of the current selection.
See also: select, selx, sely, selys
Returns the y-coordinate of the northernmost (towards negative y) cube(s) in the current selection.
See also: select, selx, selxs, selys
Returns the y-span (size on the y-axis) of the current selection.
See also: select, selx, sely, selxs
settex T t
Sets a texture for the current selection.
ArgumentDescriptionValues
Tposition of the texture to set in map cfginteger
tthe type of the texture0 (floor), 1 (wall), 2 (ceil), 3 (upper wall)
Sets vantage point in current camera position.
The vantage point is supposed to be a distinctive view on a map - like the angle from which the preview picture was taken. It is allowed to use when editing offline or spectating offline.
A map can only have one vantage point.
Allows setting the components of the water colour independently.
ArgumentDescriptionValues
Wwhatred (0), green (1), blue (2), alpha (3)
Vvalue(0)1..255
"what" is either a keyword "red|green|blue|alpha" or the index number 0..3 and determines, which component is set to value.

Example: setwatercolour red 200- sets the red component to 200

Shadow yaw specifies the angle at which shadow stencils are drawn on a map.
Token Description ValuesRangeDefault
DdegreesThe angle in degrees to rotate the stencil shadows0..36045
When specifying shadowyaw, remember that the default angle is 45 degrees. The example below would make the shadows appear at 90 degrees (45 degrees more to the left).

Example: shadowyaw 90

Show clips/plclips/mapmodel clips in edit mode.
Token Description ValuesRangeDefault
N-0..11
A visual representation of hidden/shown entities. (may be used for more editing ephemerals later)
Token Description ValuesRangeDefault
Ppersistence0:off(*),1:short,2:text-short,3:permanent0..30
If the value of edithideentmask is not 0 (meaning all entities shown) then even if showeditingsettings is 0 the display will show up on the first toggle into editmode.
The values 1, 2 and 3 will make the display show up for every time you start editing. With 3 it will stay for ever.
For 2 the text will disappear after a time but the boxes will stay for ever. For 1 everything is hidden after the duration of editingsettingsvisibletime.
Shows detailed geometry data of the cube inside editing focus.
It shows on the HUD cube type, floor and ceiling heights, vdelta and all textures.


default key: F8
See also: showmip
Show editing cursor grid.
Token Description ValuesRangeDefault
N-0..11
Show ladder entities (as blue wireframes) in edit mode.
Token Description ValuesRangeDefault
N-0..10
Prints map dimensions.
Prints some map statistics.
Toggles between showing what parts of the scenery are rendered.
Shows what parts of the scenery are rendered using what size cubes and outputs some statistics about it. This can give map editors hints as to what architecture to align, textures to change, etc.
If "showfocuscubedetails" is enabled, "showmip" stats on the HUD are hidden.


default key: F6
Show mapmodel clipping during edit mode.
Token Description ValuesRangeDefault
N-0..10
Show all playerstarts in edit mode.
Token Description ValuesRangeDefault
N0: hide, 1: show0..10
Set showplayerstarts to "1" to see a playermodel rendered at all playerstart entities.
Show the volume of a focused clip entity as a cloud of sparklies.
ArgumentDescriptionValues
Bon/off0:off,1:on
To see the volume rather than the boundaries of a clip entity you can hold the B key in editing mode while pointing at it.


default key: B - while pressed clips are clouds of sparklies
Show tagclips/tagplclips in edit mode.
Token Description ValuesRangeDefault
N-0..11
Decreases the size of the current selection by N cubes on all sides.
ArgumentDescriptionValues
Nnumber of cubesinteger
Instead of manually executing this command, you can bind "domodifier 11" to a key. While holding this key you can expand/shrink the current selection with the mouse wheel.
It works also with multiple selections.
slope X Y
Makes a slope out of the current selection.
ArgumentDescriptionValues
Xx delta stepinteger
Yy delta stepinteger
The selection must be a heightfield before this command can be used. The steps specify the slope with the red vertex as left-top, i.e. "slope 1 2" will make a slope that increases just 1 step from left to right, and is slightly steeper from top to bottom. "slope -6 0" decreases steeply from left to right, and does not slope at all from top to bottom. Note that like the vdelta command, an increasing vdelta goes further away from the player, regardless of floor or ceiling.
Makes the current selection all solid (i.e. wall) or all non-solid.
ArgumentDescriptionValues
Ban integer denoting the solid-ness0 (non-solid), 1..* (solid)
This operation retains floor/ceiling heights/textures while swapping between the two.


default keys:

F - makes the selection a solid

G - makes the selection a space/non-heightfield

sortmapmodelslots nosort nomerge mergeused
Sorts all mapmoodel slots alphabetically and merges identical slots.
ArgumentDescriptionValues
nosortdo not sort the list alphabetically (optional)
nomergedo not merge any slots (optional)
mergeusedmerge used and unused (identical) slots freely (optional)
By default, the list is sorted and only unused identical (with the same model and parameters) slots are merged. The keywords can be combined in any order. "nomerge" takes priority over "mergeused".

Example: sortmapmodelslots - sorts the mapmodel slot list alphabetically and merge unused identical slots. Merging an unused slot is pretty much the same as deleting it, so this command sorts the list and removes unneeded double entries

Example: sortmapmodelslots nosort- merges (deletes) unused double entries in the mapmodel slot list

Example: sortmapmodelslots nosort mergeused - merges double entries in the mapmodel slot list. If two identical entries are used in the map, all uses are mapped to the new combined slot. This leaves no visual changes on the map. Should be avoided, if mapmodel slots have been renamed manually - and the renaming isn't finished yet

Example: sortmapmodelslots mergeused- sorts the mapmodel slot list and merges all double entries

sortmapsoundslots nosort nomerge mergeused
Sorts all mapsound slots alphabetically and merges identical slots.
ArgumentDescriptionValues
nosortdo not sort the list alphabetically (optional)
nomergedo not merge any slots (optional)
mergeusedmerge used and unused (identical) slots freely (optional)
By default, the list is sorted and only unused identical slots are merged. The keywords can be combined in any order. "nomerge" takes priority over "mergeused".
See examples in the "sortmapmodelslots" reference.
sorttextureslots nosort nomerge mergeused
Sorts all texture slots alphabetically and merges identical slots.
ArgumentDescriptionValues
nosortdo not sort the list alphabetically (optional)
nomergedo not merge any slots (optional)
mergeusedmerge used and unused (identical) slots freely (optional)
By default, the list is sorted (except the first five) and only unused identical (with the same texture and scale factor) slots are merged. The keywords can be combined in any order. "nomerge" takes priority over "mergeused".
It allows to manually sort also the first few slots by adding the slot number to move to the slots #1, #2, #3, #4 (for example "sorttextureslots 11 12 13 14" will move slot #11 to slot #1, #12 to #2, #13 to #3 and #14 to #4, and sort the rest texture slots).
See examples in the "sortmapmodelslots" reference.
stairs xs ys
Places stairs in all selections.
ArgumentDescriptionValues
xsstep width in x-direction
ysstep width in y-direction
"xs" and "ys" determine the step width in x- and y-direction.
The width of the tagclip lines.
Token Description ValuesRangeDefault
Wwidth0.2..31
Fading time of sparklies in focused on tagclip volume
Token Description ValuesRangeDefault
Ttimemilliseconds1..100030
source comments suggest this may become hardwired in the future
Number of particles in the focused on tagclip volume.
Token Description ValuesRangeDefault
Ccountparticle count1..10014
source comments suggest this may become hardwired in the future
Number of particles in any tagclip volume - if showtagclipfocus is not 1.
Token Description ValuesRangeDefault
Ccountparticle count1..1000
source comments suggest this may become hardwired in the future
Returns the list of numbers of all texture slots which use that texture file.
ArgumentDescriptionValues
Ntexture filename
Returns a list of mapmodels who use that texture as skin.
ArgumentDescriptionValues
Ntexture slot number0..255
If no mapmodel uses the texture, but world geometry does, a string of whitespace is returned. If the mapmodel is unused, an empty string is returned.
Returns a list of 256 numbers representing the number of uses for every texture slot.
ArgumentDescriptionValues
Wwhatonlygeometry, onlymodels, onlymostvisible
If "what" is "onlygeometry", the uses as map model skin do not count.
If "what" is "onlymodels", the uses in map geometry do not count.
It returns two values per slot: usage and visibility.
If "what" is "onlymostvisible", instead of the regular list, a list of only the most used wall, floor, ceiling and upper wall textures (alternating with the keywords) is returned.

Example: echo (textureslotusagelist onlymostvisible)Output: wall 211 floor 45 ceiling 0 "upper wall" 79

Inverses the on/off state of cleanedit
See also: cleanedit
Toggles the pin on the "closest entity" selector.
The HUD will indicate the lock by showing "pinned" instead of "closest" entity. All actions, that would otherwise affect the closest entity, will affect the pinned entity instead. Deleting the locked entity will unlock it.


default key: middle mouse button
See also: getclosestent
Turns occlusion culling on and off.
The reason one may want to turn it off is to get an overview of the map from above, without having all occluded bits stripped out.


default key: F5
Transforms all full height clip entities to tag clips.
See also: edittagclip
Restores deleted entity.
ArgumentDescriptionValues
Iindex
If no index is specified, the last deleted entity is restored. If an index is given, the specified entity from the list of deleted entities is restored.
BACKSPACE in combination with editmeta undeletes the last deleted entity.
BACKSPACE in combination with editmeta2 brings up the menu "deleted entities".
Multi-level undo of any of the changes caused by editing operations.
With editmeta pressed it also restores player position and selects the affected area.


default key: U
Returns the number of undo steps that can be undone.
ArgumentDescriptionValues
Llevelinteger
If argument "level" is given, as many steps are undone, until "level" steps remain.
Unless memory limits delete states, undolevel commands can be undone with "redo".

Example: echo (undolevel) - prints number of previous editing steps, for example "55". Do some editing and:

Example: undolevel 55 - undoes all changes to restore the previous state (if that state is still in memory)

See also: undo, redo, undomegs
Sets the number of megabytes used for the undo buffer.
Token Description ValuesRangeDefault
Nnumber of megabytesinteger0..505
Undo's work for any size areas, so the amount of undo steps per megabyte is more for small areas than for big ones (a megabyte fits 280 undo steps on a 16x16 area, but only 4 steps on a 128x128 area).
See also: undo, undolevel
Removes entities from the list of deleted entities.
ArgumentDescriptionValues
Wwhich[a number], all or last
If <which> is a number, the specified entry from the list of deleted entities gets removed.
If <which> is "all", the whole list of deleted entities gets deleted.
If <which> is "last" the last deleted entity is removed from the list of deleted entities.
Returns the number of entities on the list of deleted entities (even if the parameter <which> was unknown or not specified).
Holds the number of unsaved edits.
A cubescript hook to provide additional information about the current edit situation.
For example it provides additional information about the closest entity.
The returned text is rendered on the right side of the screen.
Default for "updateeditinfopanel" is "explainclosestentity" script which provides detailed info about the closest entity.
Update map config with any mapmodels required by those in use.
Changes the vdelta value of the current selection.
ArgumentDescriptionValues
Nvdelta value
Note that unlike all other editing functions, this function doesn't affect a cube, but its top-left vertex (market by the dot in the editing cursor). So to edit a N * M heightfield, you will likely have to edit the vdelta of (N+1) * (M+1) cubes, i.e. you have to select 1 row and 1 column more in the opposite direction of the red dot to affect all the vertices of a heightfield of a given size (try it, it makes sense :).
A floor delta offsets vertices to beneath the level set by editheight (and a ceil delta to above). Delta offsets have a precision of a quarter of a unit, however you should use non-unitsize vertices only to touch other such vertices.
This only works if the cube is a heightfield.


default keys:

8 - manipulates downwards the corner of the current selection

9 - manipulates upwards the corner of the current selection

See also: heightfield
Sets the global water level for the map.
Token Description ValuesRangeDefault
Hthe water levelfloat, -10000="no water"-128..127-10000
Every cube that has a lower floor than the water level will be rendered with a nice wavy water alpha texture. Water physics will be applied to any entity located below it.
Performance notes: water is rendered for a whole square encapsulating all visible water areas in the map (try flying above the map in edit mode to see how). So the most efficient water is a single body of water, or multiple water areas that are mostly not visible from each other. Players can influence how accurate the water is rendered using the "watersubdiv" command (map config).
See also: watersubdiv
Whether or not to output debugging information while loading/saving maps.
Token Description ValuesRangeDefault
Bboolean1:debug output0..10
Deletes the named snapshot.
ArgumentDescriptionValues
Nnickname
See also: xmap_list
Deletes the backup xmap.
See also: xmap_list
Moves the backup xmap to a regular named spot.
ArgumentDescriptionValues
Nnickname
See also: xmap_list
Changes the nickname of the xmap.
ArgumentDescriptionValues
Oold nickname
Nnew nickname
See also: xmap_list
Restores the xmap snapshot.
ArgumentDescriptionValues
Nnickname
1. If nickname is not given, it restores the last automatic backup snapshot. Automatic snapshots are taken:
a) before a snapshot is restored,
b) before a new map is loaded (if there were unsaved edits on the map) and
c) when the game ends (if there were unsaved edits).
2. If nickname is given, the command restores the named snapshot, it also creates a backup snapshot of the current editing data.
See also: xmap_list, xmap_store
Creates a snapshot and stores it under the given nickname.
ArgumentDescriptionValues
Nnickname
Nicknames have to qualify as valid filenames.

Editing configs

All the below commands are used specifically in map configuration files. Some of these commands can also be used without the need of a map configuration file.

fog N
Sets the fog distance.
Token Description ValuesRangeDefault
NThe fog distancedistance in cubes64..1024180
You can do this for tweaking the visual effect of the fog, or if you are on a slow machine, setting the fog to a low value can also be a very effective way to increase fps (if you are geometry limited). Try out different values on big maps / maps which give you low fps. It is also good for aesthetic features of maps especially when combined with "fogcolour".
See also: fogcolour
Sets the fog and clearing colour.
Token Description ValuesRangeDefault
CThe colourHexadecimal colour0..167772150x8099B3
See also: fog
Returns the current "notexture" path (set by loadnotexture).

Example: echo (getnotexture)

See also: loadnotexture
Part of a map file
ArgumentDescriptionValues
Cchunk of mapdataup to 24 bytes in hex
Internal – for XMAP – not intended for manual use
See also: restorexmap
Binds a texture to be used if a slot couldn't be loaded with a given textures path.
ArgumentDescriptionValues
Ffile name of the texture to bindstring
Binds the texture indicated in the filename to the texture slot of any textures that aren't found. The path is given exactly as with the texture-command, if it is omitted (or can't be loaded) the default is used. The default is located in packages/misc/notexture.jpg (not in packages/textures - where custom ones must reside!)

Example: loadnotexture // Reset to default

Example: loadnotexture "makke/black.jpg" // Any missing texture will show up black

Loads a skymap for a map.
ArgumentDescriptionValues
Ppath to skymap texturesstring
The available skymaps reside in packages/textures/skymaps/..
The skymap name in the argument is required to start with "textures/skymaps/", but that part of the path can be omitted, and it should be used only up to the underscore "_" in the filename.
You can get the current skymap name with the $loadsky variable.

Example: loadsky makke/mountain

Example: loadsky textures/skymaps/makke/mountain

mapmodel R H Z 0 N F
Registers a mapmodel that can be placed in maps.
ArgumentDescriptionValues
RThe square radius of the bounding box.integer
HThe height of the bounding box.integer
ZThe initial height offset from the ground.integer
0This integer is redundant. Leave it at zero so you don't break the command.0
NThe name of the map modelstring
FIf '1', the model is preloaded, even if no entities use it (optional)1
A mapmodel registered with this command can be placed in a map using the 'newent mapmodel' command. The bounding box is an invisible force surrounding the model, allowing players to collide against it, instead of walking through the mapmodel. For more information about this command, read mapediting5.xml.
Example: mapmodel 4 2 4 0 "modelname"
This mapmodel has a bounding box of 8x8x2 in size (X/Y/Z) and by default hovers 4 units above ground.
It also returns the number of the created slot, example: echo (mapmodel ...)
Resets the mapmodel slots/indices to 0 for the subsequent "mapmodel" commands.
Each subsequent mapmodel command increases it again. See config/default_map_settings.cfg for an example.
Defines a mapsound.
ArgumentDescriptionValues
PPath to the sound file
MMaximum simultaneous sounds/maxuses (optional)default -1 (unlimited)
Registers the sound as a map-specific sound. These map-specific sounds may currently only be used with "sound" entities within a map. The first map sound registered in a map has slot/index number 0 and increases afterwards.
It also returns the number of the created slot, example: echo (mapsound ...)
Resets the mapsound slots/indices to 0 for the subsequent "mapsound" commands.
Each subsequent mapsound command increases it again. See config/default_map_settings.cfg for an example.
md2anim A F R S
ArgumentDescriptionValues
Aanim
Fframe
Rrange
Sspeed
md2emit T Y A B
ArgumentDescriptionValues
Ttag name
Yparticle type (integer or name)SPARK (0), SMOKE (1), ECLOSEST (2), BLOOD (3), DEMOTRACK (4), FIREBALL (5), SHOTLINE (6), BULLETHOLE (7), BLOODSTAIN (8), SCORCH (9), HUDMUZZLEFLASH (10), MUZZLEFLASH (11), ELIGHT (12), ESPAWN (13), EAMMO (14), EPICKUP (15), EMODEL (16), ECARROT (17), ELADDER (18), EFLAG (19)
Aattribute 1
Battribute 2
md2tag N A B C D
ArgumentDescriptionValues
Nname
Avert1
Bvert2
Cvert3
Dvert4
md3anim A S R V
ArgumentDescriptionValues
Aanim
Sstartframe
Rrange
Vspeed
md3emit T Y A B
ArgumentDescriptionValues
Ttag name
Yparticle type (integer or name)SPARK (0), SMOKE (1), ECLOSEST (2), BLOOD (3), DEMOTRACK (4), FIREBALL (5), SHOTLINE (6), BULLETHOLE (7), BLOODSTAIN (8), SCORCH (9), HUDMUZZLEFLASH (10), MUZZLEFLASH (11), ELIGHT (12), ESPAWN (13), EAMMO (14), EPICKUP (15), EMODEL (16), ECARROT (17), ELADDER (18), EFLAG (19)
Aattribute 1
Battribute 2
ArgumentDescriptionValues
Mmodel
md3skin N S
ArgumentDescriptionValues
Nobject name
Sskin texture
ArgumentDescriptionValues
Aalphablend
ArgumentDescriptionValues
Aalphatest
Adds a value for a specified attribute to the model.
ArgumentDescriptionValues
Aattributekeywords, desc, defaults, usage, author, license, distribution, version, requires
Vvalue
If used, specifies that the current model depends on parts of another custom model (which therefore also has to be downloaded) can only be used once per model config.
Example: 'mdlattribute' requires 'makke/signs/exit' could be used in 'signs/loading-dock/md2.cfg' to reuse 'makke/signs/exit/tris.md2' .
ArgumentDescriptionValues
Lcachelimit
ArgumentDescriptionValues
Ccullface0 or 1
ArgumentDescriptionValues
Ppercent0..100..N*100
ArgumentDescriptionValues
Dshadow distance
mdltrans X Y Z
Translates (= moves) the model.
ArgumentDescriptionValues
X
Y
Z
ArgumentDescriptionValues
Ttranslucency0..100..N*100
ArgumentDescriptionValues
Vvertexligh0 or 1
Whether or not to save all xmaps on exist and restore them at game start.
Token Description ValuesRangeDefault
Bboolean1:persistent0..11
XMAP allows for visual comparison between maps.
TODO: elaborate
See also: xmap_list
Declaration of map parts.
ArgumentDescriptionValues
*many combinationsread the source
Internal – for XMAP – not intended for manual use
See also: hexbinchunk
texture S F
Binds a texture to the current texture slot.
ArgumentDescriptionValues
SScale of the texture to load (should be a power of two).Float
FFile name of the texture to bindstring
Binds the texture indicated in the filename to the current texture slot and increments the slot number.
The texture is rendered at the given scale. At scale 1.0 (or if scale is 0), 32x32 texels cover one cube. At scale 2.0, which is the current maximum, it's 64x64.
It also returns the number of the created slot, example: echo (texture ...)
Sets the texture slots/indicies to 0 for the subsequent "texture" commands.
Each subsequent texture command increases it again. See config/default_map_settings.cfg for an example.
See also: texture
watercolour R G B A
Determines the water colour in a map.
ArgumentDescriptionValues
Rred colour intensity1..255
Ggreen colour intensity1..255
Bblue colour intensity1..255
Aalpha value (transparency)0..255 (default 178)
You must define at least 3 first values, otherwise this command may not work correctly (use "1" as a placeholder if needed).

Menus

This section describes identifiers related to the menu gui.

Toggles getting descriptive text from CGZ or DMO files in menudirlist.
Token Description ValuesRangeDefault
B0..11
See also: menudirlist
Displays a texture on the right side of a menu.
ArgumentDescriptionValues
Nthe name of the menu
Pthe path to the texture
Tthe title of the picture
By specifying a title string in the third argument to chmenutexture, a picture is rendered instead of a texture. The title string is displayed instead of the texture resolution. The variable "menupicturesize" holds a size modifier for pictures, similar to "menutexturesize".
Closes the currently open menu.
If more than one menu is open, only closes the topmost menu on the stack.
Closes the specified menu if it is open.
ArgumentDescriptionValues
Nthe name of a previously defined menu
If it is open multiple times in the stack only the topmost instance will be closed!
Returns the name of the currently open menu.
If more than one menu is open, only the name of the topmost menu on the stack is returned.
Deletes the entire contents (all menu items) of the given menu.
ArgumentDescriptionValues
Nthe name of a previously defined menu
Hide big images in menus.
Token Description ValuesRangeDefault
N0: show, 1: hide0..10
menudirlist P E A I S
Creates a menu listing of files from a path and perform an action on them when clicked.
ArgumentDescriptionValues
Pthe directory path from the assaultcube root
Efile extension
Aaction
Ishow image from a file0 or 1
Sstring - search it in map/demo filenames and descriptions and show only matched files (case insensitive)
Use this inside menu definitions, almost always as the only command of that menu.
Compare the usage inside config/menus.cfg

Example: menudirlist "packages/maps" "cgz" "map $arg1"will create a list of maps and load them when clicked

Adds subdirectory entries to a menu with a files list.
ArgumentDescriptionValues
Aaction, executed, when the menu entry is chosen
Dif it is 1, an entry '..' is added (parent directory) (optional)
It has to come after the menudirlist command.
See also: menudirlist
Sets the font for a specific menu.
ArgumentDescriptionValues
Nmenu name
Ffontdefault, mono, serif
If menu is "", the currently initialised menu is used.

Example: menufont score monosets the font on the scoreboard

See also: font
Adds header and/or footer to the menu.
ArgumentDescriptionValues
Hheader
Ffooter
Specifies commands to be executed when a menu opens.
ArgumentDescriptionValues
Cthe code to execute on init
This command should be placed after newmenu.
See also: newmenu
Defines the initial selection for a menu.
ArgumentDescriptionValues
Aline number
menuitem T A H D
Creates a new menuitem.
ArgumentDescriptionValues
Tthe text content in menu line
Athe command to execute on selection of the menuitem (optional)
Hthe command to execute upon rolling over the menuitem (optional)
Dthe description of menu item, which is displayed on the menu footer (optional)
Upon activating the menuitem, the associated command will be executed (See config/menus.cfg for examples). If the command argument is omitted, then it will be set to the same value as the description. If -1 is specified instead of the command to execute, then no command is executed when activating the item. If the rollover option is used, the menuitem will execute that command when selecting (but not activating) the menuitem.
'\n' in menuitem synchronizes further text with slider width (tab-like function).
(Note: to activate the menu item, select it, and either: Click, press SPACE or press ENTER/Return).
See also: newmenu, getigraph
menuitemaltfont N T A H D
Displays a menu line with a text which may contain chars from an alternate font.
ArgumentDescriptionValues
Nthe name of the alternate fontdefault, mono, serif, huddigits, serverquality, bargraphs, radaricons
Ttext content in menu line
Aaction (optional)
Hhoveraction (optional)
Ddescription displayed on menu footer (optional)
Chars from the alternate font have to be marked with "\a". Alternate font chars have no width and are just rendered above the following text. Use spaces to counter that.
See also: font
Creates a checkbox menu item.
ArgumentDescriptionValues
Ttext
Vvalue
Aaction
Pposition (optional)0..100
Optional fourth parameter "position" in the range from 0 o 100, default 0, which moves the position of the checkbox over the width of a text input or slider, with 100 being left and 0 being right.
Menuitem which displays "text" and all keys, that bind "bindcmd" - in edit mode.
ArgumentDescriptionValues
Ttext
Bbind command
Menu items added after this command are greyed out (1) or not (0).
ArgumentDescriptionValues
Vvalue0: off 1: on
Greyed out menu items are grey and can't be operated.
menuitemimage N T A H
ArgumentDescriptionValues
Nimage filename
Ttext
Aaction
Hhoveraction
Menuitem which displays "text" and all keys, that bind "bindcmd" - in game mode.
ArgumentDescriptionValues
Ttext
Bbind command
Menuitem that loads a map, displays the title and the preview or a default image.
ArgumentDescriptionValues
Mmap
Aaction (optional)
Hhoveraction (optional)
Ddescription displayed on menu footer (optional)
menuitemradio T L U V D A
ArgumentDescriptionValues
Ttextmenu item text
Lminmin value
Umaxmax value (or optionally -1 and set by display string length)
Vvalueinitial value
Ddisplaylist of value descriptions or value step size
Aactionexecuted on value changes (new value in arg1)
menuitemslider T L U V D A W
ArgumentDescriptionValues
Ttextmenu item text
Lminmin value
Umaxmax value (or optionally -1 and set by display string length)
Vvalueinitial value
Ddisplaylist of value descriptions or value step size
Aactionexecuted on value changes (new value in arg1)
Wwrapif 1, wrap slider around
Menuitem which displays "text" and all keys, that bind "bindcmd" - in spectate mode.
ArgumentDescriptionValues
Ttext
Bbind command
Creates a new menuitem with text input field.
ArgumentDescriptionValues
Ttext
Vvalue
Aaction
Hhoveraction
Mmaxchars
If the last line of a menu is a text input item, pressing enter in that line will not only execute the assigned command, but also close the menu.
menumdl N M A R S
Specifies a model to render while displaying the specified menu.
ArgumentDescriptionValues
Nthe name of the menu
Mthe model
Athe animation to play
Rthe rotation speed
Sthe scale
If menu is "", the currently initialised menu is used.
It specifies, which model to render and how. If only menu is specified, no model is rendered.
Changes the size of pictures displayed in menus.
Token Description ValuesRangeDefault
Nsize factor0.1f..5.0f1.6f
Moves a menu away from the middle of the screen.
ArgumentDescriptionValues
Xx-offset
Yy-offset
Values of "0" represent half the screen width and height.
Selects a line in a menu.
ArgumentDescriptionValues
Amenu name
Bline number
Defines the background color for the menu selection bar.
ArgumentDescriptionValues
Rred0..100
Ggreen0..100
Bblue0..100
Aalpha0..100
Defines the background color for the description of selected active menu items (checkbox, slider, text input).
ArgumentDescriptionValues
Rred0..100
Ggreen0..100
Bblue0..100
Aalpha0..100
Enables persistent selections for the currently displayed menu.
When enabled, it restores a previously saved selection.
Probably most efficient inside "menuinit". The position is restored during execution of this command, so the menu entry has to already exist and the alias with the last position has to be read from saved.cfg. In automatically created menus it may be necessary to execute the command with a short delay.
Synchronizes tabs in menus.
ArgumentDescriptionValues
Vvalue0: off (default), 1: on
If enabled (1), tab positions in a menu are synchronised. It affects menu title, header and items, but not footer or descriptions.
Changes the size of textures displayed in menus (mostly for testing purposes).
Token Description ValuesRangeDefault
Nsize factor0.1f..5.0f1.0f
Make a different title show up than the menu's internal name.
ArgumentDescriptionValues
Nnamehuman friendly title
Intended to pretty up the menus with more readable titles than the sometimes short but technical values that make the scripting easier!
See also: newmenu, curmenu
Creates a new menu.
ArgumentDescriptionValues
Nthe name of the menu
All menu commands placed after newmenu (i.e. menuitem, menuitemcheckbox, etc.) are added into the menu until another "newmenu" command is specified.
See also: menuitem
Refreshes (closes and opens again) the current menu.
Refreshes (closes and opens again, after very short delay) the current menu.
Creates a screenshot cropped to 4:3 with a given number of lines and jpeg quality 80.
ArgumentDescriptionValues
Nnumber of lines144..480, default 240 or last given value
Pressing CTRL+F12 during spectating creates a clean screenshot and saves it as map preview picture.


default key: Ctrl+F12 - creates map preview pictures during spectating
See also: menuitemmapload
Displays the specified menu.
ArgumentDescriptionValues
Nthe name of a previously defined menu
The menu allows the user to pick an item with the cursor keys. Upon pressing return, the associated action will be executed. Pressing ESC will cancel the menu.
If wrapslider is set the menuitemslider will toggle to the min/max value if at end of the range.
Token Description ValuesRangeDefault
N0 off, 1 on0..10

Ingame reference

This section describes all identifiers related to the ingame documentation reference.

docargument T D V I
Adds a new argument documentation to the last added identifier.
ArgumentDescriptionValues
Tthe token
Dthe description
Vthe value notes
Iflags this argument as variable-length (optional)1 (true), 0 (false)
An argument represents either a command argument or a variable value.
The last argument of an identifier can be flagged as variable-length to indicate that it represents an unknown number of arguments.
See also: docident
Adds an example to the last added identifier.
ArgumentDescriptionValues
Cthe example code
Ethe explanation (optional)
docfind P S
Searches for pattern in all ingame identifier documentations (reference) entries.
ArgumentDescriptionValues
Pthe pattern
Ssilent?
If "silent" is zero or omitted, all found references are listed.
A table of all found entries is returned as result. For each entry, the index of the doc entry string that contains the pattern is listed.
Adds a new identifier documentation to the last added section.
ArgumentDescriptionValues
Nname of the identifier
Dthe description
An identifier represents a command or variable.
The name may contain spaces to create a "multipart" identifier documentation that can be used to describe a complex argument as a single pseudo identifier, look at the examples.

Example: docident fov "Sets the field of view."

Example: docident "newent light" "Adds a new light entity."

Enables identifier details or statement analyser.
Token Description ValuesRangeDefault
Vlevel of displaying the additional informations0..31
Outputs a list of identifier documentations that do not match any existing identifier.
Multipart identifiers are not included in this list, see 'docident'.
Adds a new default key to an identifier.
ArgumentDescriptionValues
Avalue
docref N I U
Adds a new documentation reference to an identifier.
ArgumentDescriptionValues
Nthe display name
Ithe identifier to refer to (optional)
Uthe URL to refer to (optional)
The new reference is added to the last added identifier documentation.
See also: docident
Render documentation references (docrefs) of the identifiers.
Token Description ValuesRangeDefault
V0: hide, 1: render0..11
Adds a new documentation remark to the last added identifier.
ArgumentDescriptionValues
Sthe remark
See also: docident
Adds a new section to the ingame documentation.
ArgumentDescriptionValues
Sthe section name
See also: docident
Allows to scroll through the rendered identifier documentation.
Token Description ValuesRangeDefault
Voffset (number of lines)0..10000
Outputs a list of yet undocumented identifiers (commands, variables, etc.).
ArgumentDescriptionValues
Aoutput all identifiers (optional)1 (true), 0 (false)
If the one argument is omitted, only the builtin identifiers will be listed. Therefore specify the argument other identifiers like aliases should be included too.
Note that the list also includes identifiers that contain the substrings "TODO" or "UNDONE" in their documentation.
Render identifier documentation for the typed command in the console.
Token Description ValuesRangeDefault
V0: hide, 1: render0..11
Writes out a base XML documentation reference containing templates for the builtin identifiers.
ArgumentDescriptionValues
Rthe reference name (optional)
Sthe XML schema location string (optional)
TXML stylesheet to use (optional)
The generated reference is written to "docs/autogenerated_base_reference.xml" by default. The three arguments can be changed later on in the generated XML document.
Writes out an XML documentation reference file containing undocumented identifiers or identifiers marked with "TODO".
ArgumentDescriptionValues
IAlso include aliases? (optional)0: don't include aliases (default), 1: include aliases
getdoc N I
Returns a string of the specified identifier documentation (reference) entry.
ArgumentDescriptionValues
Nname of the identifier
Ithe string index number of entry0: name, 1: description, 2: remarks
String index numbers match with the result of "docfind".
See also: docident, docfind

Bot mode

This section describes bot mode related identifiers. See also "docs/cube_bot-readme.txt".

addbot T S N
Adds a bot for a given team with a given skill calling him a given name.
ArgumentDescriptionValues
TteamRVSF or CLA
Sskillbest, good, medium, worse, bad
Nnamename for the bot
This command only works for single player modes.

Example: addbot RVSF medium RobbieWill add a bot named Robbie with a medium skill level to the RVSF team.

addnbot C T S
Adds a given count of bots for the given team with the given skill and select random names for them.
ArgumentDescriptionValues
Ccounthow many bots to add
TteamRVSF or CLA
Sskillbest, good, medium, worse, bad
This command only works for single player modes.
The name of the bots will be selected randomly.

Example: addnbot 2 CLA badWill add 2 bots with a bad skill level to the CLA team.

Adds a bot waypoint at the current position.
ArgumentDescriptionValues
Aconnect automatically0 or 1
Automatically places waypoints.
Changes the skill level for the given bot.
ArgumentDescriptionValues
Nbotnamethe name of the bot
Sbotskillbest, good, medium, worse, bad

Example: botskill Robbie bestChanges the previous bot skill level of the bot named Robbie to a 'best' skill level.

Changes the skill level for all bots.
ArgumentDescriptionValues
Sbotskillbest, good, medium, worse, bad

Example: botskillall worseChanges the previous bot skill level for all bots to a 'worse' skill level.

Enables or disables the ability of the bots to fire their weapons.
ArgumentDescriptionValues
Tshooting bots?0 or 1

Example: botsshoot 0Bots won't shoot.

Deletes the selected waypoint.
Enables or disables the processing of the bots artificial intelligence.
ArgumentDescriptionValues
Toff OR on0 or 1

Example: idlebots 1Will make the bots stand still.

Example: idlebots 0Will enable the bots to move and shoot.

Kicks all bots out of the current game.
Kicks the bot with the given name out of the current game.
ArgumentDescriptionValues
Nbotnamename of the bot to kick.

Example: kickbot RobbieWill make the bot named "Robbie" dissapear from the current game.

Assigns a number to the nearest waypoint.
ArgumentDescriptionValues
Nnumber
This is only used for trigger waypoints, so that the bots go to triggers in the right order. If you don't do this bots will search for every trigger, even when they are not reachable yet.
Takes the current player yaw for the current waypoint.
When used you will see what the bot sees.
ArgumentDescriptionValues
Nbotnamethe name of the bot
Type it again (with or without name) to return to the game (you will respawn).
Makes waypoints visible and either turns on or off the waypoint information display.
ArgumentDescriptionValues
Yshow info?0 or 1
ArgumentDescriptionValues
Vvisible0 or 1
Determines if bot waypoints should be selected/placed using the crosshair or by the nearest location to your player.
Token Description ValuesRangeDefault
VNote: This is turned on by default.0..11

Optional

This section describes optional identifiers from the files in config/opt/ folder and commands, which enable them.

-- A
Decrements an alias by 1.
ArgumentDescriptionValues
Athe alias name

Example: i = 0; -- i; echo $iOutput: -1

See also: ++, --f, ++f
--f A
Decrements an alias by floating-point 1.
ArgumentDescriptionValues
Athe alias name

Example: i = 4.14; --f i; echo $iOutput: 3.14

See also: ++f, --, ++
++ A
Increments an alias by 1.
ArgumentDescriptionValues
Athe alias name

Example: i = 0; ++ i; echo $iOutput: 1

See also: --, ++f, --f
++f A
Increments an alias by floating-point 1.
ArgumentDescriptionValues
Athe alias name

Example: i = 2.14; ++f i; echo $iOutput: 3.14

See also: --f, ++, --
Returns 1 if the local player is alive.

Example: echo (alive)Output: 1

Breaks out of a parsestring loop.
Important: this command should only be used within the 3rd argument (the cubescript to execute) of parsestring.
Smoothly changes your gamma to the specified value.
ArgumentDescriptionValues
Gthe gamma to change to
Mmilliseconds between gamma changes
Remark: that's optional command, disabled by default, to enable it execute "run opt/survival" or start bot surival mode from menu.

Example: changegamma 300 30Every 30 milliseconds your gamma is changed by 1 until it reaches its goal of gamma 300.

Smoothly changes your gamespeed to the specified value.
ArgumentDescriptionValues
Sthe gamespeed to change to
Mmilliseconds between gamespeed changes
Remark: that's optional command, disabled by default, to enable it execute "run opt/survival" or start bot surival mode from menu.

Example: changespeed 1000 30Every 30 milliseconds your gamespeed is changed by 1 until it reaches its goal of gamespeed 1000.

Returns the mode number for the current game.
Returns 1 if the local player has admin privileges, 0 otherwise.
Returns an integer indicating what team a client is currently on.
ArgumentDescriptionValues
Cclient number (optional)returns the specified client's team instead
Returns 0 for CLA, 1 for RVSF.
Returns 2 for CLA-spectator, 3 for RVSF-spectator.
Returns 4 for spectator.
By default this command returns what team *you* (player1) are currently on.
findpn CN
Finds player name with this client number.
ArgumentDescriptionValues
CNclient number
Returns the current game mode number.
Loads optional obsolete autosave settings.
To see the obsolete autosave settings, look at config/opt/autosave.cfg file.
Loads optional compatibility settings for old scripts.
To see the compatibility settings, look at config/opt/compatibility.cfg file.
Loads batch map conversion tools.
To see the map conversion tools, look at config/opt/convmap.cfg file.
Loads optional FAQ settings.
To see the FAQ settings, look at config/opt/faq.cfg file.
The settings are loaded, when FAQ is open in menu.
Loads extra map editing scripts.
To see the map editing scripts, look at config/opt/mapeditscripts.cfg file.
Loads optional settings for string parsing.
To see the string parsing settings, look at config/opt/parsestring.cfg file.
Loads optional settings for bot survival mode.
To see the settings for survival, look at config/opt/survival.cfg file.
The settings are loaded, when bot survival mode is started via menu.
Show the client number column on the scoreboard first?
Token Description ValuesRangeDefault
NCN column order0 (false), 1 (true)0..10
parsestring S A C B
Loops through every character in the given string and executes the given block of cubescript on each iteration.
ArgumentDescriptionValues
Sstringstring to parse
Astringname of alias to use as iterator
Cstringcubescript to execute on each iteration
Binteger (optional)non-zero to force backwards parse
Important: A secondary iterator alias (prefixed with a double underscore "__") is automatically created before each iteration that contains the character position data.

Example: parsestring "Hello world" iter [echo $iter]Uses echo on every character in the string: "Hello world"

Example: parsestring "Hello world" iter [echo (concatword "Char #" $__iter ": " $iter)]Uses echo on every character in the string: "Hello world" --- Also outputs the position of each character in the string.

Example: backwardsstring = []; parsestring "This will look interesting backwards." iter [backwardsstring = (concatword $backwardsstring $iter); if (= $__iter 0) [echo $backwardsstring]] 1Outputs: ".sdrawkcab gnitseretni kool lliw sihT"

Example: parsestring "abcdefghijklmnopqrstuvwxyz" iter [if (> $__iter 4) breakparse [echo $iter]]Example usage of the breakparse command. Uses echo on characters a through e, then breaks out of the parse.

Returns the score statistics for the player with the given client number.
ArgumentDescriptionValues
CNclient number0..N

Example: echo (pstat_score 0) Output: 0 5 3 43 1 1 unarmedThe output is a list of FLAGS, FRAGS, DEATHS, POINTS, TEAM, TEAMKILLS, and NAME.

Hides the list of entity types you set.
ArgumentDescriptionValues
Llist of entity types to hidelight, playerstart, pistol, ammobox, grenades, health, helmet, armour, akimbo, mapmodel, ladder, ctf-flag, sound, clip, plclip
Call "setedithide [lights mapmodels]" to just hide all lights and mapmodels.
Only shown entity types are potential 'closest entity'.
"setedithide" without any arguments restores visibility of all entities.
Hides all but the single entity type you give.
ArgumentDescriptionValues
Tthe entity type to show exclusivelylight, playerstart, pistol, ammobox, grenades, health, helmet, armour, akimbo, mapmodel, ladder, ctf-flag, sound, clip, plclip
Just run "seteditshow mapmodel" and see just the mapmodel entities.
The other entity types are ignored as closestentity too.
"seteditshow" without any argument hides all entities.
Shows the settings for hidden entities (sparklies).
Prepares a round of bot survival mode on the specified map.
ArgumentDescriptionValues
Mthe map to use
Dthe difficulty (optional)0 = easy, 1 = intermediate, 2 = hard, 3 = impossible
All official maps are compatible with survival, if you want to play survival on a custom map, prior edits/additions to the script are necessary, such as adding a zone for that specific map.
See also: load_survival
Removes all unnecessary leading and trailing whitespace characters from the given string.
ArgumentDescriptionValues
Sstringstring to modify

Example: echo (trimAllUnnecessaryWhitespace " H e ll o w o r l d ")Outputs: "H e ll o w o r l d"

Removes all whitespace characters from the given string.
ArgumentDescriptionValues
Sstringstring to modify

Example: echo (trimAllWhitespace " H e ll o w o r l d ")Outputs: Helloworld

TODO

This section describes identifiers that are not documented yet, but you may try to help us there.

CubeScript command & variable list