sendmapSaves the current map (without lightmaps) and sends it to the server so other clients may download it. Only works in coopedit game mode.
getmapGets a map from the server if one is available. Automatically loads the map when done. Only works in coopedit game mode.
edittoggleSwitches between map edit mode and normal (default key = e). In map edit mode you can select bits of the map by clicking or dragging your crosshair on the cubes (using the "attack" command, normally MOUSE1), then use the commands below to modify the selection. While in edit mode, physics & collision don't apply (noclip), and key repeat is ON.
editface D NThis is the main editing command. D is the direction of the action, -1 for towards you, 1 for away from you. N=0 to push all corners in the white box. N=1 create or destroy cubes. N=2 push or pull a corner you are pointing at.
getheightmapThis command will turn any selection into a heightmap mode selection [default H]. When this happens the selection will turn green with the orientation and gridsize denoted by four corner squares on one side of the selection. When the selection enters heightmap mode, the cubes within the selection will mimic a heightmap and so the geometry within the selection will be changed if it is not already of heightmap style.
clearbrushThis resets the current brush that is used during heightmap mode editing.
brushvert x y depthA brush is a 2D map that describes the depth that the editface commands should push into the cubes at various points. The first two parameters of brushvert are the X and Y coordinates, respectively, of a vert on this 2D map. The last parameter is used to set the depth.
brushxAlong with the 2D map, all brushes also have a handle. This handle is a reference point on the 2D map which defines where the brush is relative to the editing cursor. These two variables define the brush handle's coordinates.
brushy
copybrushThis command [default K] copies the current heightmap mode selection and saves it as a new brush. The current location of the cursor will turn into the new handle of the brush.
savebrush nameThis will save the current brush in script format. This script will be saved in a file called mybrushes.cfg file for example. This is usually used after copybrush. The brush can also be named for easy reference later.
selectbrush DThis is not an actual engine command, but rather an alias which is defined in data/brush.cfg. It is to be used as a modifier [default J], and switches between the various brushes that have been saved within that config file.
edittex DChanges the texture on current selection by browsing through a list of textures directly shown on the cubes. D is the direction you want to cycle the textures in (1 = forwards, -1 = backwards). By default bound to holding F and using the mouse wheel.
gridpower NChanges the size of the grid.
reorientChange the side the white box is on to be the same as where you are currently pointing.
flipFlip (mirror) the selected cubes front to back relative to the side of the white box.
rotate DRotates the selection 90 degrees around the side of the white box. Automatically squares the selection if it isn't already.
undoMulti-level undo of any of the changes caused by the above operations (default key = z [also u]).
redoMulti-level redo of any of the changes caused by the above undo (default key = i).
undomegs NSets the number of megabytes used for the undo buffer (default 1, max 10). Undo's work for any size areas, so the amount of undo steps per megabyte is more for small areas than for big ones.
copy pasteCopy copies the current selection into a buffer. For pasting, if the current selection is not the same size as the copy, the corner of the red reference box will be used as the origin. If the current gridsize is changed from the copy, the pasted copy will be stretched by the same factor.
replaceRepeats the last texture edit across a selection. Only those faces with textures and orientations matching the one that was last edited will be replaced.
newent type value1 value2 value3 value4Adds a new entity where (x,y) is determined by the current selection (the red dot corner) and z by the camera height, of said type. Type is a string giving the type of entity, such as "light", and may optionally take values (depending on the entity). The types are defines below in the Entity Types section.
delentdeletes the entity closest to the player
dropentPositions the closest entity according to the entdrop variable.
entdrop Nvariable controlling where entities created with "newent" will be placed.
entproperty P AChanges property P (0..3) of the closest entity by amount A. For example "entproperty 0 2" when executed near a lightsource would increase its radius by 2.
clearents typeDeletes all entities of said type.
showsky BThis variable controls whether explicit sky polygons are outlined (in purple) in edit mode. Default = 1.
editmatChanges the type of material left behind when a cube is deleted. Currently the following types of materials are supported:
showmat BThis variables whether volumes are shown for invisible material surfaces in edit mode. Material volumes may also be selected while this is enabled. Default = 1.
optmats BThis variables controls whether material rendering should be optimized by grouping materials into the largest possible surfaces. This will always make rendering faster, so the only reason to disable it is for testing. Default = 1.
watercolour R G BChanges the blended color of all water to RGB. This may be used to simulate various lighting conditions for water.
selextendExtend current selection to include the cursor.
map nameLoads up map "name" in the gamemode set previously by "mode". A map given as "blah" refers to "packages/base/blah.cgz", "mypackage/blah" refers to "packages/mypackage/blah.cgz". The menu has a set of maps that can be loaded. See also map in the gameplay docs.
alias nextmap_blah1 blah2
(loads "blah2" after "blah1").
savemap nameSaves the current map, using the same naming scheme as "map". makes a versioned backup (mapname_N.BAK) if a map by that name already exists, so you can never lose a map. If you leave out the "name" argument, it is saved under the current map name.
newmap sizeCreates a new map of size^2 cubes (on the smallest grid size). 10 is a small map, 13 is a large map but it goes up to 16. Use newmap -1 to double the dimensions of the current map.
mapmsg "Title by Author"sets the map msg, which will be displayed when the map loads. Either use the above format, or simply "by Author" if the map has no particular title (always displayed after the map load msg).
recalcRecalculates scene geometry. Shouldn't be needed under normal curcumstances.
textureresetSets the texture slot to 0 for the subsequent "texture" commands.
texture subnum filename flagsBinds the texture indicated in filename to the current texture slot, then increments the slot number. This is for use in texture.cfg files only. subnum allows secondary textures to be specified for a single texture slot, for use in shaders and other features (0 is primary diffuse texture, 1..N are available in the shader bound to texture units 2..N+1, unit 1 = the lightmap). Flags allow you to specify preprocessing on the image, currently only rotation (0 = none, 1 = 90 CW, 2 = 180, 3 = 270 CW).
shader NAME VS PSdefines a shader NAME with vertex shader VS and pixel shader PS (both in ARB OpenGL 1.5 assembly format). See data/stdshader.cfg for examples. These definitions can be put in map cfg files or anywhere else, and will only be compiled once. Requires DX9 / shader 2 class hardware (radeon 9500 or better, geforce 5200 or better) to run (older hardware will default to basic rendering).
setshader NAMESets a previously defined shader as the current shader. Any following texture slots (see "texture" command) will have this shader attached to it.
music name music name ondonePlays song "name" (with "packages" as base dir). This command is best used from map cfg files or triggers. Evaluates ondone when the song is finished, or just keeps looping the song if ondone is missing. Example:
music "songs/music.ogg" [ echo "Song dong playing!" ]
N = registersound name VRegisters sound "name" with cube (see for example data/sounds.cfg). This command returns the sound number N, which is assigned from 0 onwards, and which can be used with "sound" command below. if the sound was already registered, its existing index is returned. registersound does not actually load the sound, this is done on first play. V is volume adjustment, if not specified (0), it is the default 100, valid range is 1-255.
sound NPlays sound N, see data/sounds.cfg for default sounds, and use registersound to register your own. for example,
sound 0
and sound (registersound
"aard/jump")
both play the standard jump sound.
mapmodel R H T N SH
registers a mapmodel that can be placed in maps using newent
mapmodel
(see newent). N is the name, R is the square
radius, H the height, T the texture slot to skin the model with (0 for default skin), and SH toggles whether the it
will cast shadows (not given or 1 casts shadows, 0 has no shadows). The radius R and height
H define the collision bounding box of the model (if either is 0, players won't collide
with the mapmodel). Name N is the name of a folder inside packages/models folder, e.g.
"hudguns/rifle". Loaded from that folder are: tris.md2 and skin.jpg (and if not available,
skin.png, or the same from the parent folder to allow skin sharing).
Example: mapmodel 4 32 0 "tree1"
This map model is loaded from packages/models/tree1/. It has a collision box 8x8x32 in size (x=2*R, y=2*R, z=H). It uses the model's default skin (texture slot=0).
It casts shadows (default).
importcube N
imports a cube map (.cgz) and converts it to sauerbraten's map format. N is the name of the map, without the .cgz. The map file must reside in packages/cube, which is because that folder has a package.cfg that sets the default cube textures. If the cube map in question has a custom texture list, it will have to be adapted manually. Currently converts everything relatively faithfully, except heighfields which are converted as best as possible but not always accurately. Slopes tend to work faultlessly, landscape style stuff is usuable, but curves/arches are problematic, and may have to be redone. All entities are converted though mapmodels may not be present, and light entities are useless because of their 2d nature, so probably the first thing to do after converting a map is /clearents light, and place some new lights. Pickups and other items may spawn inside the walls because they have no proper Z value, you may have to correct these manually. The importcube command does not automatically save the map, you still have to do a /savecurrentmap which will create packages/cube/N.ogz. Reload the map to be able to pick up stuff. Waterlevel is also not supported, you will have to add water using the new material system.
wireframe 0/1
Turns on wireframe drawing of the map.
gettex
moves the texture on the current selection to the top of the texture list. Useful for quickly texturing things using already textured geometry
allfaces 0/1
when on, causes the texturing commands to apply the new texture to all sides of the selected cubes rather than just the selected face.
passthrough
normally cubes of equal size to the grid are given priority when selecting. passthrough removes this priority while held down so that the cube the cursor is directly on is selected.
calclight QThis calculates all lightmaps. Usually takes only a few seconds, depending on map size and settings. If you "savemap", the lightmap will be stored along with it. Q is these predefined quality settinsg:
patchlightThis will calculate lightmaps for any newly created cubes. This will generally be much quicker than doing a "calclight", and so is very useful when editing. However, it will make very inefficient use of lightmap textures, and any new cubes will not properly cast shadows on surfaces that are already lit. It is recommended you do a "calclight" on your map before you publish it with "savemap".
fullbright BThis variable controls whether the map will be shown with lighting disabled. Fullbright 1 will disable lighting, whereas 0 will enable lighting. (Default = 0)
lerpangle ADefault = 44. This variable controls whether surface normals are interpolated for lighting. Normals are sampled at each vertex of the surface. If the angle between two surfaces' normals (which meet at a vertex) is less than A, then the resulting normal will be the average of the two. Normals are then later interpolated between the normals at the vertexes of a surface.
lerpsubdiv NDefault = 2. This allows more normals to be sampled at points along an edge between two vertexes of a surface. 2^N-1 extra normals will be sampled along the edge, i.e. the edge is split in half for every increment of N.
lerpsubdivsize NDefault = 4. This sets the minimum size to which an edge may be subdivided. Edges smaller than N or edge sections smaller than N will not be sampled.
lightprecision PDefault = 32. This is the most important variable for tweaking the lighting, it determines what the resolution of the lightmap is. As such has a BIG effect on calculation time, video memory usage, and map file size. The default is good for most maps, you may go as low as 16 if you are lighting a really small map and love hard shadows, and for bigger maps you may need to set it to 64 or so to get reasonable memory usage.
lighterror EThere should be little reason to tweak this. If in your map you can see visible polygon boundaries caused by lighting, you can try stepping this down to 6 or 4 to improve quality at the expense of lightmap space. If you have an insanely large map and looking for ways to reduce file size, increasing error up to 16 may help. (Default = 8)
lightlod DDefault = 0. This will double the resolution of lightmaps (cut the lightprecision in half) if size of the surface being lit is smaller than 2^D units. This allows large maps to have pockets of detailed lighting without using a high resolution over everything.
dumplmsDumps all lightmaps to a set of .bmps. Mostly interesting for developers, but mappers may find it interesting too.
lodsize NTurn on world LOD (level of detail) for this map if N=32 (default is N=0, off). The state of this command is saved with the map. N is the size of the blocks that will be used for LOD, in theory you can use 16 or 64 as well, but this usually just either just hurts performance, memory usage or visual quality. Use 32 unless you know exactly what you are doing. After setting this var, LOD will only become apparent after a "recalc" (and "calclight") command. Turning LOD on for a map is only useful on really large maps with lots of detail where you can see for half a mile, on smaller maps it will have no effect and only wastes memory / lightmap space. LOD works on entire vertex array blocks at a time, and is dependent on the "loddistance" variable which the player can set to trade off speed vs visual quality.
writeobj NWrites out the current map as N.obj, so you could use sauerbraten as a generic modeller with any program/engine that uses meshes. The meshes aren't very optimal and don't have texture/lighting information.
"light" radius brightness "light" radius r g bIf G and B are 0 the R value will be taken as brightness for a white light. A good radius for a small wall light is 64, for a middle sized room 128... for a sun probably more like 1000. Lights with a radius of 0 do not attenuate and may be more appropriate for simulating sunlight or ambient light; however, this comes at the cost of slightly greater map file sizes. See the lighting commands for an indepth list of all lighting related commands.
"playerstart"Spawn spot, yaw is taken from the current camera yaw.
"shells" "bullets" "rockets" "riflerounds" "grenades" "cartridges" "health" "healthboost" "greenarmour" "yellowarmour" "quaddamage"A variety of pickup-able items, see here.
"teleport" N "teledest" Ncreates a teleport connection, teleports are linked to a teledest with the same N (of which there should be exactly one). N can be 0..255. The teledest uses the current camera yaw.
"mapmodel" N Type TriggerA map model, i.e. an object rendered as md2/md3 which you collide against, cast shadows etc. N determines which mapmodel you want, this depends on "mapmodel" declarations in the maps cfg file. Yaw of the model is taken from the current camera yaw. Type specifies mapmodel behaviour such as triggers, see table below. Trigger is the trigger number, 0 means no trigger. This number specifies what trigger to activate, and in addition, the alias "level_trigger_Trigger" will be executed, where Trigger is substituted accordingly (this allows you to script additional actions upon a trigger, i.e. put this into your map cfg file to print a message: alias level_trigger_1 "echo A door opened nearby"). The alias "triggerstate" will hold a value of -1, 0, or 1 indicating how the trigger was activated.
Type | Trigger states | Trigger how often | Sound | |
0 | 0 | loops mapmodel animation | ||
1 | 1 | do trigger animation when touched for the first time only and return to starting position (best for switches, use switch/lever models) | ||
2 | 1 | rumble | same as above but with sound | |
3 | toggle (0/1) | 1 | do trigger animation when touched for the first time only and stay in toggled position (best for switches, use switch/lever models) | |
4 | toggle (0/1) | 1 | rumble | same as above but with sound |
5 | N | do trigger animation when touched every time and return to starting position (best for switches, use switch/lever models) | ||
6 | N | rumble | same as above but with sound | |
7 | toggle (0/1) | N | do trigger animation when touched every time and toggle positions (best for reversible switches, use switch/lever models) | |
8 | toggle (0/1) | N | rumble | same as above but with sound |
9 | closed/open (0/1) | 1 | door? | opened by approach first time only, stays open afterwards. Collides while closed. (use door specific models) |
10 | closed/open (0/1) | N | door? | opened by approach every time, closes after 5 seconds. Collides while closed. (use door specific models) |
11 | locked (-1) | 0/N | door? | opened/closed only by associated trigger. When approached while closed, collides and invokes level trigger with triggerstate -1. (use door specific models) |
12 | disappear (0) | 1 | do trigger animation once when touched, disappear after (good for triggers that look more like pickups, such as the carrot) | |
13 | disappear (0) | 1 | rumble | same as above but with sound |
29 | disappear (0) | 1 | end? | FPS specific. END LEVEL |
"monster" NA monster, currently N = 0..4 (see gameplay docs). Monster entities will be spawned when in classic single player mode, and will attack you when you come into view. yaw is taken from the current camera yaw.
"respawnpoint"A respawnpoint for classic SP mode (see "SP Respawning"). Place these spaced evenly in quieter areas between fights. Will actually work in any game mode, just probably isn't helpful in DM.