The tool we use in QuArK for compiling maps to create .DIF structures or interiors is, as we have already seen, map2dif.exe. This program is part of the Torque SDK package. The version of map2dif that I have included for use with QuArK is map2dif_DEBUG, which provides extra diagnostic information that can help solve map error problems.
The tool can be used outside of QuArK by invoking it from the command shell. The syntax for using map2dif is as follows:
map2dif [-v][-p][-s][-l][-h][-g][-e][-n][-o outputDirectory][-t textureDirectory] file.map
Switches:
-v | Print program version information |
-p | Include a preview bitmap in the interior file |
-d | Process only the detail specified on the command line |
-l | Process as a low detail shape (implies -d) |
-h | Process for final build (exhaustive BSP search) |
-g | Generate navigation graph info |
-e | Do extrusion test |
-n | Noisy error/statistic reporting |
-s | Don't search for textures in parent directory |
-q <1,2> | Parse Quake map file, version 1 or 2 |
-odir | Directory in which to place the .dif file |
-t dir | Location of textures |
file.map | Name of file to be processed |
The program takes a map file, processes it according to the supplied switches, and produces as output a Torque .DIF file. The .DIF file is deposited in the same directory as the .MAP file unless the -o switch is employed to specify the output directory.
The textures used in the map have to be loaded in order to process the map. The map2dif tool needs to load the textures so that it can determine the width and height of each texture. It uses this information to calculate polygon texture mapping information that will be included in the .DIF file. If you change the size of a texture, you may need to re-process any map files that use that texture.
When it runs, map2dif looks in the default directory of the .MAP input file; it then recursively looks in its parent directory and on upwards until it reaches the root directory, or finds the texture in question. If the -t dir switch is used in the command line, the program starts searching for the textures in the directory specified by dir. The program will load either .JPG, or .PNG forms of the textures specified in the map.
When it runs, the Torque engine expects textures to be in the same directory as the map files that it uses, or in a parent directory. Parent directories are searched all the way to the root main directory (where the torque engine executable resides). The root directory itself is never searched.
The map2dif tool uses certain texture names to help identify special brushes. These textures are never loaded but they need to be in the base texture directory of QuArK to allow processing of your maps.
null.png
origin.png
trigger.png
forcefield.png
Table 17.11 contains a list of the entities supported by map2dif and the various entity attribute options.
Category | Entity | Attribute | Data Type |
---|---|---|---|
Core Entities | |||
worldspawn | |||
detail_number | int (default is 0) | ||
min_pixels | int (default is 250) | ||
geometry_scale | int Must be a power of 2 (default is 32) | ||
light_geometry_scale | int Must be a power of 2 (default is 32) | ||
ambient_color | color (default is 0,0,0) | ||
emergency_ambient_color | color (default is 0,0,0) | ||
detail | |||
collision | |||
vehicle_collision | |||
portal | |||
ambient_light | bool: Pass ambient light (default is 0) | ||
target | |||
name | string (default " ") | ||
origin | pos (default 0,0,0) | ||
Light Emitters | |||
light_emitter_point | |||
origin | pos (default 0,0,0) | ||
target | |||
state_index | |||
falloff_type | bool: 0 = distance, 1 = linear (default false) | ||
falloff1 | float (default is 10) | ||
falloff2 | float (default is 100) | ||
falloff3 | float (default is 0) | ||
light_emitter_spot | |||
origin | pos (default is 0,0,0) | ||
target | |||
state_index | |||
falloff_type | bool: 0=distance, 1=linear (default false) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
falloff3 | int (default is 0) | ||
direction | vector (default is 0,0,-1) | ||
theta | radian: inner angle (default is 0.2) | ||
phi | radian: outer angle (default is 0.4) | ||
Lights | |||
light | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
spawnflags | int: animation flags… | ||
alarm_type | bool (default is 0) | ||
state | int: State number | ||
duration | float: State duration | ||
color | color:State color | ||
Scripted Lights | |||
light_omni | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
color | color (default is 1,1,1) | ||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
light_spot | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
target | |||
color | color (default is 1,1,1) | ||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
distance1 | int: Inner distance (default is 10) | ||
distance2 | int: Outer distance (default is 100) | ||
Animated Lights | |||
light_strobe | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
target | |||
spawnflags | int: animation flags… | ||
color1 | color (default is 0,0,0) | ||
color2 | color (default is 1,1,1) | ||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
speed | int (default is ?) | ||
light_pulse | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
spawnflags | int: animation flags… | ||
color1 | color (default is 0,0,0) | ||
color2 | color (default is 1,1,1) | ||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
speed | int (default is ?) | ||
light_pulse2 | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
spawnflags | int: animation flags… | ||
color1 | color (default is 0,0,0) | ||
color2 | color (default is 1,1,1) | ||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
attack | float (default is 1) | ||
sustain1 | float (default is 1) | ||
sustain2 | float (default is 1) | ||
decay | float (default is 1) | ||
light_flicker | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
spawnflags | int: animation flags… | ||
color1 | color (default is 1,1,1) | ||
color2 | color (default is 0,0,0) | ||
color3 | color (default is 0,0,0) | ||
color4 | color (default is 0,0,0) | ||
color5 | color (default is 0,0,0) | ||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
speed | int (default is ?) | ||
light_runway | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
spawnflags | int: animation flags… | ||
color | color (default is 1,1,1) | ||
target | |||
alarm_type | bool (default is 0) | ||
falloff1 | int (default is 10) | ||
falloff2 | int (default is 100) | ||
speed | int (default is ?) | ||
steps | int (default is 0) | ||
ingpong | bool (default is 0) | ||
Special Entities | |||
mirror_surface | |||
origin | pos (default is 0,0,0) | ||
alpha_level | int (default is ?) | ||
door_elevator | |||
name | string (default is " ") | ||
path_name | string (default ?) | ||
trigger[0-7]_name | string (default ?) | ||
force_field | |||
name | string (default " ") | ||
color | color (default is 0.5,.8,1) | ||
trigger[0-7]_name | string (default ?) | ||
ai_special_node | |||
name | string (default " ") | ||
origin | pos (default is 0,0,0) | ||
Path Entities | |||
path_node | |||
name | string (default " ") | ||
next_node | string (default ?) | ||
next_time | int (default ?) | ||
path_start | |||
name | string (default " ") | ||
next_node | string (default ?) | ||
next_time | int (default ?) | ||
Trigger Entities | |||
trigger | |||
name | string (default " ") |