Rabid Viper Productions

## Map Editing Reference

edittoggle
switches 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 floor or ceiling (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. 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.
edittex T D
Changes the texture on current selection by browsing through a list of textures directly shown on the cubes. T is an integer denoting the type (floor = 0, lower or wall = 1, ceiling = 2, upper wall = 3), D is the direction you want to cycle the textures in (1 = 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). 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.
editheight T D
T is the type as above (floors & ceilings only), and D is the delta value to move it in. Default keys are [ and ] for floor level, and o/p for ceiling.
solid B
makes the current selection all solid (i.e. wall) if B is true (non-zero), or all non-solid if it is false (0). This operation retains floor/ceiling heights/textures while swapping between the two. Default keys f and g respectively.
equalize T
levels the floor/ceiling of the selection (T as above). default keys , and .
heightfield T
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". Default keys are h (floor) and i (ceiling). 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 heighfield. This also means if you have 2 independant heightfields accidentally touch eachother, you will not get correct caps. Also, a heighfield is slightly slower to render than a non-heighfield 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.
vdelta N
changes the vdelta value of the current selection by N. 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. Default keys are 8 and 9 to decrease/increase the vdelta.
corner
# 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: next to 2 solid walls # 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. Default key = k you can make bigger corners at once by pressing "corner" on grid aligned 2x2/4x4/8x8 selections, with equal size solid blocks next to them.
undo
multi-level undo of any of the changes caused by the above operations (default key = u).
undomegs N
sets the number of megabytes used for the undo buffer (default 1). 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).
copy paste
copy copies the current selection into a buffer. to paste it 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 keys are c and v respectively).
replace
repeats your last texture edit thruout the map. The way it works is intuitive: simply edit any texture anywhere, then using "replace" will replace all textures thruout the map in the same way (taking into account wether 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.
newent type value1 value2 value3 value4

adds 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):

- "light" radius brightness
  "light" radius r g b
  radius in units (1..32), optionally brightness (1..255) for a white light, or coloured light (each component 1..255). Default key l creates a new light (cylindrical) of radius 16, brightness 255 (white).
- "playerstart" N
  Spawn spot, yaw is taken from the current camera yaw. N can be 0, 1 or 100 for a CLA, RVSF or FFA spawn.
- "shells", "bullets", "rockets", "riflerounds", "health",
  "healthboost", "greenarmour", "yellowarmour", "quaddamage"
  A variety of pickup-able items, see here.
- "teleport" N
  "teledest" N
  creates 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 Z T
  A map model, i.e. an object rendered as md2 which you collide against but has no behaviour/movement. N determines which mapmodel you want, which is defined by the "mapmodel" command, see below. yaw of the model is taken from the current camera yaw (snapped to 15 degree increments). Z determines extra elevation above the default (usually the ground). T is the map texture to use (see data/default_map_settings.cfg for the number), if left as 0 then the skin.jpg in the model directory is used (if present). Mapmodels are more expensive than normal map geometry, do not use insane amounts of them to replace normal geometry.
- "monster" N
  A 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.
- "trigger" N T O

  A trigger of type T affecting all cubes with tag N when triggered in game (see "edittag" on how to set tags on cubes). Triggers are rendered as a carrot which, when "eaten", trigger an event (only once). The following trigger types are available:

  - 0: On being triggered, sets all target cubes to SPACE. This has the effect of instantly opening doors or other geometry. You edit these "doors" as SPACE, i.e. you determine what the "door" looks like when opened, they are then set to SOLID automatically when playing (map start / edit toggle). Current "doors" open instantly. "rumble" sound alerts the player something has opened.
  - 1: invisible: same as 0 but without the carrot. since the trigger radius is fairly small, be sure to place them in tiny hallways and other areas you are sure the player will pass through.
  - 2: end of map marker. ends the map and triggers the intermission. carrot spins wildly.
  - 3: same as 1, but makes no rumble sound.
  - 4: same as 0, but with switch model instead of carrot (O is orientation, 0..3)
  - 5: same as 0, but with lever model instead of carrot (O is orientation, 0..3)
- "ctf-flag" N
  Adds a CTF flag. N can be 0 or 1 for a CLA resp. RVSF flag.
- ladder

  Adds a ladder entity.

- Scripting: each trigger automatically executes the alias "level_trigger_N" where N is the trigger number. This means you can add any scripting you can do through the available commands, by simply putting aliases of this kind in the level .cfg file. For example, to print a message when the user hits trigger 1:

- alias level_trigger_1 "echo A door opened nearby"

Entities are shown in editmode by blue sparklies, and the closest one is indicated on the HUD.
delent
deletes the entity closest to the player (default key x)
entproperty P A
changes 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 type
deletes all entities of said type.
recalc
recomputes all there is to recompute about a map, currently only lighting. Default key = r
map name
loads 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. At every map load, "data/default_map_settings.cfg" is loaded which sets up all texture definitions etc. Everything defined in there can be overridden per package or per map by creating a "package.cfg" or "mapname.cfg" which contains whatever you want to do differently from the default. It can also set up triggers scripts per map etc. When the map finishes it will load the next map when one is defined, otherwise 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").
savemap name
saves 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. 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.
newmap size
creates a new map of 2^size cubes. 6 is small, 7 medium, 8 large. You can go up to 12 but theres not a lot of point in that :)
mapenlarge
if you accidentally made your map too small, this command will make it 1 power of two bigger. So if you created a 6 size map (64x64 units) it will become a 7 map (128x128), with your old map in the middle (from 32-96) and the new areas solid.
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).
waterlevel H
sets the global water level in your map to H (an empty map has levels 0-16), which will render every cube that has a lower floor than H with a nice wavy water alpha texture, and applies water physics 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 eachother. Players can influence how accurate the water is rendered using the "watersubdiv" command (config).
fullbright B
sets all light values to fullbright (1 = on, 0 = off), so you don't need to edit the map in the dark. Will be reset when you issue a recalc. Only works in edit mode.
showmip
Toggles between showing what parts of the scenery are rendered using what size cubes, and outputs some stats too. This can give mappers hints as to what architecture to align / textures to change etc.
toggleocull
turns occlusion culling on & off. the reason you may want to turn it off is to get an overview of your map from above, without having all occluded bits stripped out.
texturereset
sets the texture slot to 0 for the subsequent "texture" commands
texture subnum filename
binds 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 (unused for now, should be set to 0 to indicate primary texture).
slope xdelta ydelta
makes a slope out of the current selection (make it a heighfield first). xdelta and ydelta are the steps that 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.
arch sidedelta
makes an arch out of the current selection (first make it a heightfield of some sort). 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 atleast 2 thick to see the effect). Not all arch sizes are necessarily available, see data/prefabs.cfg.
archvertex span vertex delta
defines a vertex delta for a specific arch span prefab, used by the "arch" command. See data/prefabs.cfg for an example on usage.
perlin scale seed cubesize
generates a perlin noise landscape in the current selection. scale determines the frequency of the features, default = 10. seed sets the random seed, keep this the same if you want to create multiple perlin areas which fit with eachother, or use different numbers if you want alternative random generations. cubesize says how many cubes to generate a surface for at once, not used for now.
select x y xs ys
selects the given area, as if dragged with the mouse. Useful for making complex geometry-generating scripts. The current dimensions of the selection (either created by the user or this command) are in the variables selx, sely, selxs and selys and can also be read/modified. 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.).
edittag N
sets the tag value (1..255) for the current selection (0 means no tag). Tags are used to determine what cubes to modify when a certain tag is triggered (see "newent trigger"). If a cube has a tag associated with it, gridlines show up in red.
trigger N T
triggers trigger N of type T, as if the player had picked up the equivalent "trigger" entity (see above).
music name
plays song "name" (with "packages" as base dir). This command is best used from map cfg files or triggers.
N = registersound name
registers 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.
sound N
plays 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.
mapmodelreset
resets the mapmodel slots/indices to 0. Each subsequent mapmodel command increases it again. see default_map_settings.cfg for an example
mapmodel R H Z S N
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, Z the initial Z-offset above ground, and S the snap value in 16ths of a cube unit (0 meaning no snap). All of these values are used for collision as well as rendering. Specifying a snap can be useful for architectural mapmodels, as the md2 format doesn't provide exact vertex coordinates. Example: mapmodel 4 2 4 2 this map model is 8x8x2 in size (x,y,z), by default hovers 4 units above ground, and has all coordinates snapped to the nearest even number. See data/models.cfg.
scalelights RP IP
Scales all lights in the map. Radius is scaled by perceptage RP and intensity by IP. Useful if you have a map which is too dark or bright but you want to keep the light entities where they are.