Import / Export:

Think of it as a new mode.

You *must* do a -light, then an -export, and then you can -import it back again, after you manipulate it. Basically, if you recompile the map in any way, then the exported lightmaps are invalid. So if you change the BSP at all, then the lightmaps won't match up anymore and you're hosed. Lightmap allocation is the last thing that happens, so each time you compile the map, the lightmaps will be reordered/different.


Each map you do this for will get its own different directory in maps/

 

export

Exports lightmaps to .tga images.

import

Imports lightmaps from .tga images.
Note: importing & exporting lightmaps

Export can also be used as an additional option with -light, in order to light and export in just one call to Q3Map. It will import/export lightmaps as maps/mapname/ lightmap_nnn.tga, where nnn = ???

info

usage: q3map -info mapname.bsp or q3map -game wolf -info mapname.bsp

Outputs map information. Please note: this is a standalone switch, used to dump information about a compiled map to the screen or a text file. The -game switch is necessary so that Q3Map knows what kind of  BSP it will be loading.

 

Custom surfaceparms

 

With the new Q3Map tool, you can add custom surface parameters for mods, without the need to recompile Q3Map.exe. These custom surface parameters are stored in a file called “custinfoparms.txt” in the folder scripts. An example of this file, with a new surfaceparm treacle, and surfaceparm grass, is shown below.

 

// Custom Infoparms File

// Custom Contentsflags

{

treacle 0x4000

}

// Custom Surfaceflags

{

grass 0x80000

}

 

NOTE: For Linux users, when using the custinfoparms parameter, Q3Map first looks in your homedir, and then, if it doesn't find a custinfoparms.txt there, it uses the one stored in the Quake3 install dir (usually /usr/local/games).

Content Flags

Contents flags are flags similar to CONTENTS_FOG in the original Q3A. These flags define the contents of volumes inside the game (for instance lava, fog, water, etc.).

 

If you look in the source file, game/surfaceflags.h, it has defines for all contents flags. The define is split into a name and a hexadecimal value. For instance, CONTENTS_PLAYERCLIP 0x10000. These hexadecimal values are powers of 2, and can be ored together (binary) to form a bit mask. Up to 32 contents flags can be ored together this way.

 

Example: Creating a volume with treacle:

 

The following outlines how a custom contents flag can be added and used in a mod. First, open the “custinfoparms.txt” file, and add “treacle 0x4000” to the Custom Contentsflags section, as shown in the example file above (0x4000 is one of the unused values available for custom use). Next, write a shader script which uses “surfaceparm treacle”. Apply this new shader to all sides of a brush in a test map. When you compile the map, add the custinfoparms parameter to the command line following Q3Map. Then, add CONTENTS_TREACLE 0x4000 to the source file game/surfaceflags.h in your mod. Now you can call the point contents function.

 

If the point is inside the brush with the shader using the “surfaceparm treacle”, then the point contents call will return a bit mask with CONTENTS_TREACLE set. This can, for instance, be used to slow down player movement when a player is inside such a brush.

Surface Flags

The surface flags are texture properties that often affect entities in contact with surfaces using such flags. The “surfaceparm metalsteps” parameter, from Q3A, is a good example. If you look in the source file, game/surfaceflags.h, it has defines for all surface flags. The define is split into a name and a hexadecimal value. For instance, SURF_NODAMAGE 0x1. These hexadecimal values are powers of 2, and can be ored together (binary) to form a bit mask. Up to 32 surface flags can be ored together this way.

 

Example: Making ‘footsteps on grass’ sounds

 

The following outlines how a custom surface flag can be added and used in a mod. First: Open up the “custinfoparms.txt” file, and add “grass 0x80000” to the Custom Surfaceflags section, as shown in the example file above. (0x80000 is the first available unused value in surfaceflags.h for surface flags). Next, write a shader script which uses a grass image, and has “surfaceparm grass”. Create a test map with the grass shader covering the ground surface. When you compile the map, add the custinfoparms parameter to the command line following Q3Map. Then, add SURF_GRASS 0x80000 to the source file game/surfaceflags.h in your mod. Now you'll be able to execute a trace, and the trace information will be returned in the trace_t structure.

 

If the trace hits a surface with the grass surfaceparm, then the SURF_GRASS flag will be set in trace_t->surfaceFlags. Such a trace can be used to trigger playing the sound of a person stepping on grass. For a reference example, see the existing metalsteps in the game code.