- #identifier_ AssaultCube Documentation :: CubeScript
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:

  • Use "" to quote strings that have whitespace within them.
    • Input example: alias grass "is greener"
  • Use $ to capture the value of a variable/alias/bracketed-string as an argument for a command.
    • Input example: echo "The grass" $grass
    • Output: The grass is greener
    • Input example: echo "Your FOV is" $fov
    • Output: Your FOV is 90.0
  • Use ; to sequence multiple commands into one.
    • Input example: alias grass "is yellow"; echo "The grass" $grass
    • Output: The grass is yellow
  • You can also use () or [] to quote strings (i.e. instead of ""). These can be nested infinitely and may contain linefeeds. The normal brackets () are special, as they evaluate commands contained within them, before evaluating the surrounding command.
    • Input example: alias 4x2 (* 2 (+ 1 3))
    • Input command: echo $4x2
    • Output: 8
    • Input example: alias grass [ is greener ]
  • Lastly, you can use the automatically-set aliases of $arg1 (.. and $arg2, $arg3, etc) in your scripts.
    • Input example: alias grass [ if (= $arg1 1) [ echo "The grass is green" ] [ if (= $arg1 2) [ echo "The grass is yellow" ] ] ]
    • Input command: grass 1
    • Output: The grass is green
    • Input command: grass 2
    • Output: The grass is brown

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!

CATEGORIES:

section_

identifier_
Argument Description Values
(optional)
Token Description Values Range Default
..

Example:

Return value: ,


default key: default keys:

CubeScript command & variable list