m2m : quake map converter : response files format description , version 1.0
(c) by PiRaMidA aka Ivan S. Manida : piramida@usa.net

-=-=-=-=-=-=-=-=-=-
textures.m2m format
-=-=-=-=-=-=-=-=-=-
Any line starting with ';' or '//' is comment, empty lines ignored.

There is a special section at the beggining of the file. It's format is
as follows: first you put the name of quake2 texture which should
have special flags, then you put the flags. Like:

<q2/texture> <contents> <surface> <value>

Flags summary:
Content flags:
  1: solid
  2: window
  4: aux (unused)
  8: lava
 16: slime
 32: water
 64: mist

Surface flags (simply add together to combine effects... 8+16 for water etc):
  1: Light   - this makes the texture emit light.
  2: Slick   - sets the surface slippery.
  4: Sky     - show sky instead of a texture here
  8: Warp    - for liquids
 16: Trans33 - transparent surface
 32: Trans66 - transparent surface (less transparent than trans33)
 64: flow    - moving texture?
128: nodraw  - makes the engine not draw the polygon. (use for skies with 4?)

Value is a light value, in case texture has surface flag "light" on.

(credits for this summary: Fingers)

You still can specify mapping for special texture, in the Normal textures section.

Normal textures:
Mapping is one line with two strings: first being texture name
in quake1 map, second - texture name that would be substituted
for quake2 map:

<quake1texture> <quake2/texture>

 NOTE: All the textures that don't have an explicit mapping in
 textures.m2m would be left as is, and their names would be shown in m2m.err,
 so you'll know which textures you need to cut out from .bsp by hand
 (or add mappings for them), use any bsp extraction tool, and then pcx2wal.exe
 (by Fingers, http://www.planetquake.com/5thD) to convert .pcx's to .wal's

-=-=-=-=-=-=-=-=-
params.m2m format
-=-=-=-=-=-=-=-=-
Any line starting with ';' or '//' is comment, empty lines ignored.

There are nine mapping types allowed for parameters (parameter:
an entity's key with a value, like "origin" "0 0 0"). In the
description below, <entity> would mean classname of an entity,
like "info_player_start", <key> would mean parameter name, like
"origin", and <value> would mean parameter's value, like "0 0 0"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1. Add parameter: adds <key> to any entity with classname <entity>
   , setting value to <value>. If the <key> is set already, you must
   remove it before setting new value (see next mapping).

<entity> + <key> = <value>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2. Subtract: removes <key> from all <entity>s

<entity> - <key>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3. Map: changes classname for all <entity1>s to <entity2>

<entity1> = <entity2>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
4. Remove: removes all <entity>s

<entity> *
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
5. Swap: swaps params, i.e. adds parameter <key2> to <entity2> with
value of parameter <key1> of <entity1>, and removes <key1> from <entity1> :)

<entity1> & <key1> = <entity2> & <key2>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
6. Removes entity's brush(es), calculates first brush's center and adds a key
   to this entity with a value, equal to the centers position (for teleports):

<entity> % <key1>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
7. Reposition: move origin of an <entity> by <vector>, where <vector> is "x y z"
NOTE: drop-to-floor feature is activated when x, y and z are 0.

<entity> ^ <vector>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
8. Overlap: add another <entity2> at each <entity1> origin point, you can't define
any keys for that new entity right away, please use '+' mapping, etc.

<entity1> # <entity2>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
9. Skip: specify that this entity doesn't need to be changed, i.e. it is
left as-is in Quake2.

<entity> ~
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
10. Condition: performs any of the 1-9, but with condition on <entity1>:

<entity1> ( <key1> = <value1> ) ...

performs mapping ... only when <key1>=<value1> and classname is <entity1>
You can add several conditions on one line, they will be combined with
logical AND:

<entity1> ( <key1> = <value1> ) ( <key2> = <value2> ) ...

When all key1, key2, etc match corresponding <value>s the mapping would be performed.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Examples:
-=-=-=-=-
monster_army = monster_soldier
worldspawn - wad
light + _color = 1 1 0.5
trigger_changelevel & map = worldspawn & nextmap
       ('map' parameter value from 'trigger_changelevel' will be assigned
         to 'nextmap' parameter of 'worldspawn' entity)
monster_army *
       (the following 2-line block shows multi-rule example)
item_super_damage = item_quad
item_super_damage + spawnflags = 1794

item_health ( spawnflags = 2 ) = iteam_health_mega
item_health ( spawnflags = 2 ) - spawnflags
item_health ( spawnflags = 2 ) + spawnflags = 1794
item_health ( spawnflags = 1 ) = item_health_large
       (would change all 100% healths into item_health_mega and change
       it's spawnflags to 1794, and also change 25% healthes to item_health_large.
       Note that you have to subtract key first for it to be added with new value!)

trigger_teleport % origin
trigger_teleport = misc_teleporter
info_teleport_destination = misc_teleporter_dest
       (this should replace all old-style teleporters with new one's)

ammo_nails = item_bullets
ammo_nails ^ 16 16 16
       (reason for this is different ammo box positioning in q1 and q2)

info_player_start ^ 0 0 0
info_deathmatch_start ^ 0 0 20
       (first line drops player start pad to the first underlying floor brush,
       second line raises it to stick a little bit out of the ground)

info_player_deathmatch # weapon_shotgun
        (that is the one and only way to give each player shotgun - at the playerstarts.
        if you think that you should have shotgun, please review params.m2m,
        find -=infos=- section and uncomment corresponding lines there)

light ~
       (shows that light entity stays the same and therefore shouldn't be reported as error)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Howto cut all torches from Quake1 map
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1. cut entity bit - a text part - from <yourmap>.bsp using your favourite
   hex editor
2. unzip params.m2m from included m2mtorch.zip
3. run m2m with -p cmdline parameter
4. rename m2m output file to <yourmap>.map
5. run "qbsp -onlyents <yourmap>"
