This reference describes the commands and variables available in AssaultCube.

# CubeScript

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

the first summand

the second summand

the sum

Performs a subtraction.

the minuend

the subtrahend

the difference

Performs a multiplication.

the multiplicand

the multiplier

the product

Performs a division.

the dividend

the divisor

the quotient

Performs a modulo operation.

the dividend

the divisor

the modulo value

Determines if two values are equal.

first value

second value

the equality

Determines if a value is smaller than a second value.

the first value

the second value

the re

Determines if a value is bigger than a second value.

the first value

the second value

the equality

Determines if two strings are equal.

the first string

the second string

the equality

Controls the script flow based on a boolean expression.
if (> $x 10) [ echo x is bigger than 10 ] [ else x too small ]

the condition

the body to execute if the condition is true

the body to execute if the condition is true

Loops the specified body.
loop 10 [ echo $i ]

the amount of loops

the body to execute on each iteration

Loops the specified body while the condition evaluates to true.
alias i 0; while [ (< $i 10) ] [ echo $i; alias i (+ $i 1) ]

the condition

the body to execute on each iteration

Concatenates multiple strings with spaces inbetween.
alias a "hello"; concat $a "world"; echo $s
output: hello world

the first string

collection of strings to concatenate

Concatenates multiple strings.
alias a "Cube"; concatword $a "Script"; echo $s
output: CubeScript

the first string

collection of strings to concatenate

Grabs a word out of a string.
at "zero one two three" 2; echo $s
output: two

the string

the index of the word

Executes a command after specified time period.
sleep 1000 [ echo foo ]
Prints 'foo' to the screen after 1 second.

the amount of milliseconds

the command to execute

# Gameplay

This section describes gameplay related identifiers.
Sets the nick name for the local player.

the name

Outputs text to other players.

the text

Puts a prompt on screen.

opens empty prompt

opens a command prompt /

autocompletes commands/variables/aliases

browse command history forwards

browse command history backwards

the text to display in the prompt

Connects to a server.
connect 127.0.0.1 myServerPassword

the (dns) name or ip of the server

the server password

Connects to a server and tries to claim admin state.
connect 127.0.0.1 myAdminPassword

the (dns) name or ip of the server

the admin password

Leaves a server.
Sets the team for the local player.
team CLA

the team name

Shows or hides the scores.
Changes the weapon.

the weapon number

Set gameplay mode to N for the next game played (next map load).

the mode number

Sends the current map to the server and sends other players a message about it.

map to save and reload locally

Retrieves the last map that was sent to the server using 'sendmap'.
Starts recording of a demo.

the demo name

Stops any demo recording or playback.
Plays a recorded demo.

the demo name

Shifts the camera to an other demo player

the shift direction

Turns on/off display of fps/rendering stats on the HUD.

Turns the stats off (1) or on (0)

Sets the playback speed for a demo.

the playback speed

Changes the demo playback delay.

delay in milliseconds

Specifies if particles should be emitted on demo players position.

sets the demo tracking state

Sets the gamespeed in percent.

the game speed

# General

This section describes general identifiers.
Claims or drops master status.

status

Claims or drops admin status.

status

password

Kicks a specified player from the server.

the player to kick

Bans a specified player from the server.

the player to ban

Removes all bans on the server.
Sets the automated team assignement.

enables or disables auto team

Sets the mastermode for the server.

the master mode

Forces a specified player to join the enemy team.

the player to assign to a team

Gives the master state to specified player.

the player to become master

Adds a new section to the ingame documentation.

the section name

Adds a new identifier documentation to the last added section.
docident fov "Sets the field of view."
docident "newent light" "Adds a new light entitiy."

name of the identifier

the description

Adds a new argument documentation to the last added identifier.

the token

the description

the value notes

flags this argument as variable-length

Adds a new documentation remark to the last added identifier.

the remark

Adds an example to the last added identifier.

the example code

the explanation

Adds a new documentation reference to an identifier.

the display name

the identifier to refer to

the URL to refer to

Outputs a list of yet undocumented identifiers (commands,variables, etc)

output all identifiers

Outputs a list of identifer documentations that do not match any existing identifer.
Searches the ingame docs for identifier documentations matching the specified search string.

the search string

Writes out a base XML documentation reference containing templates for the builtin identifiers.

the reference name

the XML schema location string

XML stylesheet to use

Loads up a map in the gamemode set previously by the 'mode' command.

name of the map to load

Triggers a jump.
Contacts the masterserver and adds any new servers to the server list.
Allows to browse through the console history by offsetting the console output.

scrolls into the history (conskip 1)

resets the history (conskip -1000)

the offset

Returns the number of milliseconds since engine start.
echo (millis)

the milliseconds

Binds a key to a command.

the key to bind

the command

Executes a command on the release of a key/button.
bind CTRL [ echo "key pressed"; onrelease [ echo "key released" ] ]

the command

Binds a name to commands.

the name of the alias

the commands

Quits the game without asking.
Moves the player forward.
Moves the player backward.
Moves the player left.
Moves the player right.
Fires the current weapon.
Sets mouse to "flight sim" mode.

sets invmouse

Sets the field of view (fov).

the fov value

Sets the minimum number of milliseconds a frame should take.

the number of milliseconds

Sets the fog distance.

the fog distance

Sets fog and clearing colour.

the colour

Takes a screenshot.
Sets the music volume.

the volume

Executes all commands in a specified config file.

the config file

Creates a new menu.

the name of the menu

Creates a new menuitem.

the name of the menuitem

the action on selection

Displays the specified menu.

the name of a previously defined menu

Executes the specified command in the command line history.

the N'th command from the history

Sets up the keymap for the specified key.

the key to map

the name for the key

the default action

Sets the mouse sensitivity.

the sensitivity

Adds a server to the list of server to query in the server list menu.

the name of the server (cn/ip)

Specifies a model to render while displaying the last added menu.

the model

the animation to play

the rotation speed

the scale

Changes the menu model of a specified menu.

the name of the menu

the (new) model

the animation to play

the rotation speed

the scale

Clears the list of secured maps.
Adds a map to the list of secured maps.

the name of the map

Recreates the minimap for the current map.
Sets the resolution for the minimap.

the resoution

Indicates if a connection to a server exists.

the connection state

Sets the size of your crosshair.

the crosshair size

Turns on or off crosshair effects.

Turns the effects on (1) or off (0)

Sets the maximum value the display will roll on strafing.

the roll value

Allows to finetune the amount of "error" the mipmapper/stripifier allow themselves for changing lightlevels.

the error value, 1 being the best quality

Indicates if the weapons should be reloaded automatically.

the autoreload state

Determines wether dynamic shadows and lights are rendered, providedjust incase they slow your fps down too much.

the radius of a dynamic light

Determines the subdivision of the water surface in maps.

the subdivisioin value

Sets the sound volume.

the volume

Sets the clients maximum downstream bandwidth.

the bytes per second

Sets the sound buffer length.

the buffer length

Sets the hardware gamma value.

the gamma value

Used to finetune the "overbright lighting" rendering feature when enabled.

the brightness of the scene

Scales all particles.

the scale percentage

Sets the time available for interpolation between model animations.

the amount of milliseconds for the interpolation

# Editing

switches between map edit mode and normal.
Changes the texture on current selection by browsing through a list of textures directly shown on the cubes.

an integer denoting the type

the direction you want to cycle the textures in

Changes the height of the current selection.

an integer denoting the type

the delta value to move it in

makes the current selection all solid (i.e. wall) or all non-solid.

an integer denoting the solid-ness

Levels the floor/ceiling of the selection.

an integer denoting the type

Marks the current selection as a heightfield.

an integer denoting the type

changes the vdelta value of the current selection

vdelta value

Makes the current selection into a "corner".
Multi-level undo of any of the changes caused by editing operations
Sets the number of megabytes used for the undo buffer.

number of megabytes, default is 1

Copies the current selection into a buffer.
Pastes a previously copied selection.
Repeats the last texture edit thruout the map.
Adds a new entity

the entity type

see newent 'type'

see newent 'type'

see newent 'type'

see newent 'type'

Adds a new light entity

the light radius

red colour component. see remarks below.

green colour component

blue colour component

Adds a new spawn spot.
Adds a new ammo box item.
Adds a new clip item.
Adds a new grenades item.
Adds a new health item.
Adds a new armour item.
Adds a new akimbo item.
Creates a teleport connection.

the teleport identifier

Creates a teleport destination.

the teleport identifier

Adds a map model, i.e. an object rendered as md2/md3 which you collide against but has no behaviour or movement

the mapmodel identifier

extra elevation above ground

the map texture to use (optional)

Adds a CTF flag entity.

denotes the flag's team

Adds a ladder entity.

the height of the ladder

Deletes the entity closest to the player
Changes property of the closest entity.

the property to change

amount by wich the property is increased

Deletes all entities of said type.

the entity type, see command 'newent'

Recomputes all there is to recompute about a map, currently only lighting.
Saves the current map.

file name of the map, see command 'map' for the naming scheme

Creates a new map.

the size of the new map

Enlarges the current map.
Sets the map message, which will be displayed when the map loads.

the map message

Sets the global water level for the map.

the water level

Sets all light values to fullbright.

sets fullbright on or off

Toggles between showing what parts of the scenery are rendered.
Turns occlusion culling on and off.
Sets the texture slot to 0 for the subsequent "texture" commands.
Binds a texture to the current texture slot.

number of a secondary texture (unused)

file name of the texture to bind

Makes a slope out of the current selection.

x delta step

y delta step

Makes an arch out of the current selection.

side delta (optional)

Defines a vertex delta for a specific arch span prefab, used by the 'arch' command.

span value

vertex value

delta value

Generates a perlin noise landscape in the current selection.

the scale, frequency of the features

the random seed

cube size, how many cubes to generate a surface for at once (unused)

Selects the given area, as if dragged with the mouse.

the X coordinate

the Y coordinate

the length along the X axis

the length along the Y axis

Registers a sound.

sound name

Plays the specified sound.

the sound to play

Resets the mapmodel slots/indices to 0.
Registers a mapmodel that can be placed in maps.

the square radius

the height

the initial Z-offset above ground

the snap value in 16ths of a cube unit

the name of the map model

Scales all lights in the map.

percentage

intensity

A variable indicating if the game is in editmode.

editmode

A variable indicating if the player looks at the floor or at the ceiling.

flrceil