This reference describes the commands and variables available in AssaultCube.

# CubeScript

This section describes identifiers that are closely related to the CubeScript language.
Determines if a floating-point value is smaller than a second floating-point value.

(true)1||0(false)

the first value

the second value

Determines if a floating-point value is less than or equal to a second floating-point value.

(true)1||0(false)

the first value

the second value

Determines if a floating-point value is equal to a second floating-point value.

(true)1||0(false)

the first value

the second value

Determines if a floating-point value is greater than a second floating-point value.

(true)1||0(false)

the first value

the second value

Determines if a floating-point value is greater than or equal to a second floating-point value.

(true)1||0(false)

the first value

the second value

Determines if a floating-point value is not equal to a second floating-point value.

(true)1||0(false)

the first value

the second value

sets the result value of a CubeScript block

the result

alias name

action

Performs a floating-point modulo operation.

the dividend

the divisor

the modulo value

echo (modf 7.5 12.5)
Output: 7.5
echo (modf 17.5 12.5)
Output: 5.0

alias

Performs an addition.

the first summand

the second summand

the sum

Performs a subtraction.

the minuend

the subtrahend

the difference

Subtracts two floating-point numbers.

the minuend

the subtrahend

the difference

Adds up two floating-point numbers.

the first summand

the second summand

the sum

Performs a multiplication.

the multiplicand

the multiplier

the product

Performs an integer division.

the dividend

the divisor

the quotient (integer)

Performs a division with floating-point precision.

the quotient (floating-point)

Performs a modulo operation.

the dividend

the divisor

the modulo value

Determines if two values are equal.

first value

second value

the equality

echo there are only (concatword (= 1 1) (= 1 0)) types of people in the world
Output: there are only 10 types of people in the world
Determines if two values are not equal.

first value

second value

the inequality

Determines if a value is smaller than a second value.

the first value

the second value

the comparison

Determines if a value is bigger than a second value.

the first value

the second value

the comparison

Determines if a values is less than or equal than a second value.

the first value

the second value

Determines if a values is greater than or equal than a second value.

the first value

the second value

logical AND.
echo (&& 1 1)
Output: 1
echo (&& 1 0)
Output: 0

first value

second value

A AND B

logical OR.
echo (|| 1 0)
output: 1
echo (|| 0 0)
output: 0

first value

second value

A OR B

Random value

The upper limit of the random value

The random value

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 ] [ echo x too small ]

the condition

the body to execute if the condition is true

the body to execute if the condition is false

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

the alias used as counter

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"; echo (concat $a "world")
output: hello world

the first string

collection of strings to concatenate

The newly created string

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

the first string

collection of strings to concatenate

The newly created string

Grabs a word out of a string.
echo (at "zero one two three" 2)
output: two

the string

the index of the word

the word from the specified idex

returns the element count of the given list.

the list

Searches a list for a specified value.

the list

the item to find

the index of the item in the list

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

The number of arguments passed to the current alias

numargs

format

value(s)

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!

# General

This section describes general identifiers.
Plays all hardcoded sounds in order.
writes current configuration to config/saved.cfg - automatic on quit
registers a track as music - the first three tracks have special meaning. Track #1 is for "flag grab" the second and third are used as "last minute" tracks.

music file

List of strings

Toggles getting descriptive text from CGZ or DMO files in menudirlist.
Toggles physics interpolation.
create a menu listing of files from a path and perform an action on them when clicked.
menudirlist "packages/maps" "cgz" "map $arg1"
will create a list of maps and load them when clicked
Toggles the console.
Triggers a jump.
Contacts the masterserver and adds any new servers to the server list.

force update

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

the milliseconds

seconds since the epoch (00:00:00 UTC on January 1, 1970)
echo (systime)
a list of values for current time
echo (timestamp) "2008 08 08 08 08 08"
echo (timestamp) "2063 04 05 12 00 00"
echo (at (timestamp) 0) (at (timestamp) 2) (at (timestamp) 1) "2063 05 04"
representation of date
echo (datestring) "Sat Jun 7 17:08:35 2008"
the current time in (H)H:MM:SS format
echo (timestring) "12:34:56"
echo (timestring) "1:02:03"
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

alias myalias [ echo "hello world"; alias myalias [ echo "I already said hello" ] ]
It is possible to re-bind an alias, even during its evaluation.
test = [ echo "successful" ]
There is also the shorthand version of defining an alias via the "="-sign.
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

Takes a screenshot.
Executes all commands in a specified config file.

the config file

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 address of the server (hostname or IP)

the port

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

the name of the map

Enables output of processed network packets.

enable network debugging

Determines if the current played map should be automatically downloaded if it is not available locally.

enable auto map download

Sets the correction value for clockfix.

correction value

Enables correction of the system clock.

enable correction

Enable triangle debug.

triangle debug

Limits the FPS (frames per second) of the game.

maximum FPS

Gets the maximum number of supported textures when performing multitexturing.

max. number of textures

Minimal level of detail.
Toggles use of acronyms instead of full modenames in the serverbrowser.
Resets all binds back to their default values.
Swaps your player to the enemy team.
Determines if all settings should be reset when the game quits.

enable reset

Determines the valid distance when extrapolating a players position.

distance

Determines the speed when extrapolating a players position.

movement speed

Determines how fast network throttling accelerates.

acceleration

Determines how fast network throttling decelerates.

deceleration

Determines the interval of re-evaluating network throttling.

interval

Swaps vertices of model triangles.
Gets an integer representing the game version. READ ONLY
Holds the current game mode. READ ONLY
echo $gamemode
Output: 5
Indicates if a connection to a server exists.

the connection state

Sets the maximum value the display will roll on strafing.

the roll value

# Gameplay

This section describes gameplay related identifiers.
shifts your selected weapon by a given delta. By default the mouse-wheel shifts one up or down according to your scroll direction.

cycle one up

cycle one down

delta

will display a scope for the sniper-rifle. used in the zoom-script (config/scripts.cfg [l. 92ff "alias zoom"]

scope on?

cycles through all available spectator modes. Follow-1stPerson, Follow-3rdPerson, Follow-3rdPerson-transparent and Fly.

cycle spectator modes

get the IP address of a given clientnumber - only admins get shown the last octet

clientnum

agree or disagree to the currently running vote

vote value

votes YES

votes NO

sound

text

opens the voicecom menu, use number keys for your choice

returns the mapname
outputs the mapsize.
Loads a crosshair for a specific weapon of - if the weapon argument is omitted or <0 - for all weapons.

image

weapon

off OR on

botname

number in list

add a bot for a given team with a given skill calling him a given name.

team

skill

name

will add a given count of bots for the given team with the given skill and select random names for them.

count

team

skill

botskill

botname

botskill

shooting bots?

delta

Returns 1 if the local player is alive.
echo (alive)
Output: 1
Returns the current map being played.
echo playing: (curmap) vote for: (curmap 1)
output: playing maps/ac_complex vote for: ac_complex

clean

Returns the mode number for the current game.
Returns the weapon-index the local player currently has selected as primary.
Returns 1 if the local player has admin privileges, 0 otherwise.
Returns information on the current server - if you're connected to one.

info

echo [I am (curserver 4) to (curserver 2)]
Output: I am connected to ctf-only.assault-servers.net
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 1 if the local player is on the RVSF team, 0 if on CLA.
Returns the weapon-index the local player is currently holding.
Returns the weapon-index the local player was previously holding.
Loads up a map in the gamemode set previously by the 'mode' command.

Name of the map to load

Returns the primary weapon on next respawn.

weapon id

Reloads the weapon.
Determines the skin of the current player.

skin id

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

Makes an input perform a certain command.

input

command

prompt

command

path

extension

complete demo "demos" dmo
If you enter "/demo " and press TAB you will cycle through all available demos.
alias mapcomplete [complete $arg1 "packages/maps" cgz]
helper alias for quickly adding complete-definitions for all gamemodes - see config/script.cfg (below "Auto-Completions")

command

adds a command to complete nicknames on
nickgreet = [ say (concat "Hello," (concatword $arg1 "!")) ]; nickcomplete nickgreet
with this you can enter "/nickgreet " and cycle via TAB to the nickname you want to greet.
Connects to a server.
connect 127.0.0.1 555 myServerPassword

the address of the server (hostname or IP)

the port

the server password

Connects to a server and tries to claim admin state.
connectadmin 127.0.0.1 777 myAdminPassword
connect as admin on port 777 of localhost
connectadmin "" 0 myAdminPassword
will try to connect to a LAN server on the default port as admin with the given password of "myAdminPassword".

the address of the server (hostname or IP)

the port

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

Returns contents of current magazine.
wnames = "Knife Pistol Shotgun Sub Sniper Assault Grenades" numtwo = [ if (< $arg1 10) [ result (concatword 0 $arg1) ] [ result $arg1 ] ] ammoinfo = [ loop w (listlen $wnames) [ mc = (magcontent $w) mr = (magreserve $w) mt = (+ $mr $mc) if (> $mt 0) [ echo (numtwo $mc) "/" (numtwo $mr) ":" (at $wnames $w) ] ] ]

Output: 01 / 01 : Knife 08 / 64 : Pistol 30 / 60 : Sub

the weapon number

Returns contents of magazine reserve.

the weapon number

Retrieves the last map that was sent to the server using 'sendmap'.
Toggle into spectator mode - only possible when you're dead!

switch spectator mode

next player

previous player

Stops any demo recording or playback.
Returns 1 when the current game is being played from a demo, else 0.
echo I am (at [not now] (watchingdemo)) watching a demo. "so, are you?"

truth value

Kills your player. You will lose 1 frag point and gain 1 death point when using this command.
Plays a recorded demo.

the demo name

Determines if bot waypoints should be selected/placed using the crosshair or by the nearest location to your player.

Note: This is turned on by default.

Returns the remaining minutes of the currently played game. READ ONLY
Determines if the game should be paused.

pause game

Indicates if the weapons should be reloaded automatically.

the autoreload state

Determines the FOV when scoping.
Determines if the mini-map should be shown on screen.

show mini-map

Determines if scores should be shown on death.
Indicates if the footsteps sound should be played

enable footsteps

Indicates if the footsteps sound for the local player should be played

enable footsteps

Maximum time span between player animation and the playback of the footstep sound

time span

Sets the gamespeed in percent.

the game speed

# Editing

Will toggle the focus of the mouse in game. Normally you can use your mouse to look around, when you type this command your mouse cursor is visible and can be used as normally. This is only useful when you run cube windowed, of course.

attribute

tag

makes waypoints visible and either turns on or off the waypoint information display.

show info?

visible

takes the current player yaw for the current waypoint
When used you will see what the bot sees. Type it again (with or without name) to return to the game(you will respawn).

botname

direction

autoconnect

on

during map editing, drop all mapsounds so they can be re-added
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 throughout 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 pistol magazine item.
Adds a new grenades item.
Adds a new health item.
Adds a new armour item.
Adds a new akimbo item.
Adds a map model to the map (i.e. a rendered md2/md3 model 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

Adds a sound entity.

the sound to play

the radius

the size

the volume

Adds a clip entity.

elevation above the ground

X radius around the box center

Y radius around the box center

height of the box

Deletes the entity closest to the player
Edits the closest entity.

the entity type

see newent 'type'

see newent 'type'

see newent 'type'

see newent 'type'

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.
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

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

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

the brightness of the scene

# Menus

This section describes identifiers related to the menu gui.
Specifies commands to be executed when a menu opens.

The code to execute on init

Creates a new menu.

The name of the menu

Creates a new menuitem.

The menuitem description.

The command to execute on selection of the menuitem.

The command to execute upon rolling over the menuitem.

text

value

action

name

text

action

hoveraction

text

bind command

text

min

max

value

step

display

action

text

value

action

hoveraction

maxchars

Displays the specified menu.

the name of a previously defined menu

Closes the specified menu if it is open.

the name of a previously defined menu

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

# Head-Up Display

This section describes the identifiers to configure the head-up display (HUD).
Recreates the minimap for the current map.
Executes the specified command in the command line history.

the N'th command from the history

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

Sets the resolution for the minimap.

the resolution

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

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

Sets the size of your crosshair.

the crosshair size

Turns on or off crosshair effects.

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

# Visuals

This section describes identifiers to configure the visuals.

width

height

checks for the searchstring in all loaded extensions

extension

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

min

max

Sets the field of view (fov).

the FOV value

Sets the number of gibs to display when performing a "messy" kill (grenade, knife, sniper headshot).

number of gibs

Sets the time for gibs to live (in milliseconds), after which they will disappear.

time to live

Sets the velocity at which gibs will fly from a victim.

velocity

Sets the team display mode.

the team display mode

Sets the size/resolution of the dynamic shadow data.

the size

Sets the display size of the dynamic shadows.

the size

Sets if dynamic shadows should be saved to disk.

auto save

Sets the alpha value (transparency) for dynamic shadows.

the alpha value

Determines whether dynamic shadows and lights are rendered, provided just 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

Enables or disables fullscreen.

fullscreen

Sets the level of fullscreen antialiasing (FSAA).

fsaa

Sets the screen width.

the screen width

Sets the screen height.

the screen height

Sets the bits per pixel value.

bits per pixel

Sets the bits for the depth buffer.

depth pixels

Enables or disables vsync.

vsync

Sets the hardware gamma value.

the gamma value

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

the error value, 1 being the best quality

Scales all particles.

the scale percentage

Sets the time available for interpolation between model animations.

the amount of milliseconds for the interpolation

# Sound

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

the sound to play

Mute a specific game sound.

ID of the sound to mute

audible?

Unmutes all previously muted sounds.
Specifies the interval for checking mapsounds.

interval in milliseconds

Enables verbose output for debugging purposes.

enable audio debug

Each subsequent played sound's gain-value is scaled by this percentage.

percentage

Sets the music volume.

the volume

Enables or disables the audio subsystem in AC.

enable

Sets the desired amount of allocated sound channels.

number of channels

Sets the sound volume for all sounds.

the volume

# Ingame Reference

This section describes all identifiers related to the ingame documentation reference.
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 entity."

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 identifier documentations that do not match any existing identifier.
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

# 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.
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.

description

Modded servers announcement of features. See source/src/server.cpp [Line 2926ff. "case SV_EXTENSION:"]

extension

description

Sets automated team assignment.

Enables or disables auto team.

Temporary ban of the specified player from the server.

The player to ban

Calls a vote on the server.

Vote type

First argument

Second argument

Forces the specified player to join the enemy team.

The player to assign to a team

Gives admin state to the specified player.

The player to become admin

Kicks the specified player from the server.

The player to kick

Sets the mastermode for the server.

The master mode

Removes all temporary bans from the server. Temporary bans are normally automatically removed after 20 minutes.
Sends the current map to the server and sends other players a message about it.

Map to save and reload locally

Claims or drops admin status.

Status

Password

# Game modes

mode

description

Starts a map with the mode "Co-op edit"
coop ac_newmap

The name of the map you wish to edit

Starts a map with the mode "Capture the Flag"
ctf ac_mines

The name of the map you wish to play

Starts a map with the mode "Deathmatch"
dm ac_complex

The name of the map you wish to play

Starts a map with the mode "Hunt the Flag"
htf ac_mines

The name of the map you wish to play

Starts a map with the mode "Keep the Flag"
ktf ac_mines

The name of the map you wish to play

Starts a map with the mode "Last Man Standing"
lms ac_complex

The name of the map you wish to play

Starts a map with the mode "Last Swiss Standing"
lss ac_complex

The name of the map you wish to play

Sets the gameplay mode to N for the next map loaded.

The mode number

Starts a map with the mode "One shot, One kill"
osok ac_complex

The name of the map you wish to play

Starts a map with the mode "Pistol Frenzy"
pf ac_complex

The name of the map you wish to play

Starts a map with the mode "Team Deathmatch"
tdm ac_complex

The name of the map you wish to play

Starts a map with the mode "Team Keep the Flag"
tktf ac_mines

The name of the map you wish to play

Starts a map with the mode "Team One Shot, One Kill"
tosok ac_complex

The name of the map you wish to play

Starts a map with the mode "Team Survivor"
ts ac_complex

The name of the map you wish to play

Starts a map with the mode "Hunt the Flag". Some players prefer the name "VIP" for this mode.
vip ac_mines

The name of the map you wish to play

# 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.

anim

frame

range

speed

tag

type

arg1

arg2

name

vert1

vert2

vert3

vert4

anim

startframe

range

speed

tag

type

arg1

arg2

parentno

childno

tagname

model

object name

skin texture

alphatest

cachelimit

cullface

percent

shadow distance

translates (= moves) the model

translucency

vertexligh

Isolates the given context. 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

the context

secure this configuration for the rest of the game

context

idname

Sets the fog distance.

The fog distance

Sets the fog and clearing colour.

The colour

Binds a texture to be used if a slot couldn't be loaded with a given textures path.
loadnotexture // Reset to default
loadnotexture "makke/black.jpg" // Any missing texture will show up black

file name of the texture to bind

Loads a skymap for a map.
loadsky "textures/skymaps/makke/mountain"

path to the six skybox textures

Registers a mapmodel that can be placed in maps.

The square radius of the bounding box.

The height of the bounding box.

The initial height offset from the ground.

This integer is redundant. Leave it at zero so you don't break the command.

The name of the map model

Resets the mapmodel slots/indices to 0 for the subsequent "mapmodel" commands.
Defines a mapsound.

Path to the sound file

Maximum simultaneous sounds

Resets the mapsound slots/indices to 0 for the subsequent "mapsound" commands.
Shadow yaw specifies the angle at which shadow stencils are drawn on a map.
shadowyaw 90

The angle in degrees to rotate the stencil shadows

Binds a texture to the current texture slot.

This is a redundant value. Always leave this value as 0 here so it doesn't break your configurations.

File name of the texture to bind

Sets the texture slots/indicies to 0 for the subsequent "texture" commands.
Determines the water colour in a map.

Red colour intensity

Green colour intensity

Blue colour intensity