MODSon[line.com] Wiki - Beta 1.0
Call of Duty 2: Map File Format
From MODSonline Wiki
Example of a simple brush in CoD2
iwmap 4
// entity 0
{
"classname" "worldspawn"
// brush 0
{
( 0 128 0 ) ( -64 128 0 ) ( -64 64 0 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -80 64 64 ) ( -80 128 64 ) ( -16 128 64 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -64 64 8 ) ( 0 64 8 ) ( 0 64 0 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( 0 64 8 ) ( 0 128 8 ) ( 0 128 0 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( 0 128 8 ) ( -64 128 8 ) ( -64 128 0 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -64 128 8 ) ( -64 64 8 ) ( -64 64 0 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
}
}
iwmap 4
| map file version |
// entity 0
| entity 0, must be the worldspawn entity. Closing bracket is above entity 1 block, but other data blocks (brushes and patches) in between are really common. |
"suncolor" "1.00 0.88 0.85"
| some possible key/value pairs for worldspawn entity |
// brush N
| a data block, in this case of a brush. lines starting with a // (double slash) are used like comments. n is a number, first block = 0, second = 1 etc. |
Contents |
[edit] Brushes
[edit] Brush data block
contains a minimum of 4 (ramps = 5, cubes = 6, complex convex brushes > 6) lines with the following structure:
attributes ( x1 y1 z1 ) ( x2 y2 z2 ) ( x3 y3 z3 ) texture tex_x tex_y shift_x shift_y rotation ? lightmap lmap_x lmap_y ? ? ? ?
[edit] Example
contents detail;
( 128 64 0 ) ( 64 64 0 ) ( 64 0 0 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( ... etc.
[edit] Explanation
| attributes | optional brush properties ( below opening data block bracket ) |
| ( xn yn zn ) | coord of x, y and z value ( 1 unit = 1 inch ) |
| texture | name of texture |
| tex_x | texture repetition x |
| tex_y | texture repetition y |
| shift_x | texture offset x |
| shift_y | texture offset y |
| rotation | rotation angle of the texture |
| ? | unknown ( default = 0 ) |
| lightmap | light map texture ( default = lightmap_gray ) |
| lmap_x | light map size x |
| lmap_y | light map size y |
| ? | unknown ( default = 0 ) |
| ? | unknown ( default = 0 ) |
| ? | unknown ( default = 0 ) |
| ? | unknown ( default = 0 ) |
[edit] Patches
[edit] Terrain patches (Meshes)
example density: 2 x 2
// brush 0
{
mesh
{
contents nonColliding;
caulk
lightmap_gray
2 2 16 8
(
v 0 0 128 t 0 -0 0 0
v 0 128 128 t 0 -2048 0 -8
)
(
v 128 0 128 t 2048 -0 8 0
v 128 128 128 t 2048 -2048 8 -8
)
}
}
contents nonColliding;
| mesh attribute ( optional ) |
caulk
| texture |
lightmap_gray
| light map texture |
2 2 16 8
| unknown ( possibly dimension, position or other property ) |
v 0 0 128 t 0 -0 0 0
| some kind of coords |
[edit] Curve patches (Curves)
example density: 3 x 3
// brush 0
{
curve
{
caulk
lightmap_gray
3 3 16 8
(
v 0 0 128 t 0 -0 0 0
v 0 64 128 t 0 -1024 0 -4
v 0 128 128 t 0 -2048 0 -8
)
(
v 64 0 128 t 1024 -0 4 0
v 64 64 128 t 1024 -1024 4 -4
v 64 128 128 t 1024 -2048 4 -8
)
(
v 128 0 128 t 2048 -0 8 0
v 128 64 128 t 2048 -1024 8 -4
v 128 128 128 t 2048 -2048 8 -8
)
}
}
(see above)
[edit] Entities
[edit] Models
// entity 1
{
"origin" "0.0 64.0 0.0"
"model" "xmodel/prop_barrel_silver"
"classname" "misc_model"
}
origin
| position / coord of the model |
model
| xmodel file path and name |
classname
| entity type for xmodels |
[edit] Spawns
// entity 2
{
"origin" "16.0 16.0 0.0"
"classname" "mp_dm_spawn"
}
[edit] Script Brushmodel
brush data blocks (brushes, patches, etc.) enclosed by an entity block, which has a classname of script_brushmodel
the enumeration of the brush data blocks start at 0 in each script_brushmodel block
// entity 3
{
"classname" "script_brushmodel"
// brush 0
{
// ...
}
// brush 1
{
// ...
}
}


