Map translator

From ECWolf Wiki

The map translator specifies how the engine should handle translating binary format maps into internal structures (which map closely to UWMF). A map translator is sometimes referred to as xlat, but besides being a similar concept has nothing to do with the map translators in ZDoom. There is no particular lump name that the translator must conform to, but it must be referenced in MAPINFO.

A translator contains 3 sections which correspond to the three planes in a binary map: tiles, things, and flats. Each section is similar to a UWMF block in that it is enclosed in braces. Each plane consists of series of 2-byte values for each "tile," so when an oldnum is asked for it should be assumed to be some value 0-65535 (although using 0 should probably be avoided in most cases).

Including other translators

Other translation files can be included:

  • include "lumpname"
If the lumpname is "$base" then the default translator for the game will be loaded.
include statements can appear anywhere in the global scope (i.e. outside of the tiles, things, and flats blocks).
include statements are the equivalent of copying in the contents of the referenced file.

Feature flags

Special meaning to some tiles can be enabled through feature flags. The following is to be placed outside of any block.

Enables Blake Stone meta data tiles. Currently incomplete and subject to change.
  • enable lightlevels;
Enables Rise of the Triad global light level. In the first map plane (2,0) can be set to a value 0xD8 through 0xDF (dark to light) and (3,0) can be set to values 0xFC through 0x10B (low visibility to high visibility). These translate to the following values in Doom lighting terms. (For reference a visibility of 8.0 is the default in ZDoom.)
Note: These numbers were derived by eye-balling the output from Rise of the Triad. They may be subject to change in the future should more accurate numbers be provided. Visibilities above 0x104 are accepted per released map specs, but they appear to allow the player nearly see clearly across the entire map and thus map to the same value.
Value Light Visibility
0 130 0.53
1 138 0.86
2 146 2.0
3 154 8.0
4 162 15.0
5 170 29.0
6 178 56.0
7 186 108.0
8-15 N/A 200.0
Enables the level height feature of Rise of the Triad. The value of the thing plane at (0,0) will be used to determine the height of the level in 64 unit tiles. Values between 0x5A (90) and 0x61 (97) will translate to 1-8 tiles in height, values between 0x1C2 (450) and 0x1C9 (457) are use for 9-16 tiles in height. Any other value is undefined.
Things will have their Z height set according to the value in the info plane. To set a Z height set the high byte to 0xB0 and the low byte will indicate the signed height of the thing relative to the floor in increments of 4 units (1/16th of a tile).

Music

Enables selection of a music track by placing a tile somewhere in the top row of the info plane (upper leftmost corner preferred). High byte must be 0xBA and low byte selects the index in the provided table. Invalid values are ignored.

Tiles

  • modzone oldnum [fillzone] ambush;
Checks for a thing in the tile. If one exists, the thing has the ambush flag set.
If the optional fillzone keyword is specified, the tile's sound zone is taken from an adjacent tile.
  • modzone oldnum [fillzone] changetrigger action { properties }
Searches all adjacent tiles for triggers with the specified action. For each one found, the trigger is disabled on the side facing the modzone and a new trigger for that side is added based on the properties specified.
All properties from a UWMF trigger definition (other than x, y, and z) are valid.
If the optional fillzone keyword is specified, the tile's sound zone will be set to the first valid zone found in the tiles adjacent on the east, north, west, and south sides (in that order).
  • tile oldnum { properties }
Assigns a wall tile to the oldnum.
All properties from a UWMF tile definition are valid.
  • trigger oldnum { properties }
Assigns a trigger to the tile.
All properties from a UWMF trigger definition (other than x, y, and z) are valid.
  • zone oldnum {}
Assigns a sound zone to the oldnum.

Note: There are no limits to how you allocate your 65536 oldnums. Doors are simply the combination of a tile and trigger with the same number.

Things

  • elevator oldnum; (New from 1.4)
Creates a Rise of the Triad compatible elevator destination point. Place these between a door and switch (the door and switch must be in line with each other) and the elevator will round robin between the destination points. The elevator starts in the uppermost spot (or leftmost if in same y position).
  • trigger oldnum { properties }
Assign a trigger to the tile it is contained in. This will be in addition to any triggers already on the tile. Typically a pushwall would use this.
All properties from a UWMF trigger definition (other than x, y, and z) are valid.
  • { oldnum, actor, angles, flags, minskill }
Maps the oldnum to the actor name that is assigned in DECORATE.
The angles parameter indicates how many sequential indexes should be assigned to rotations. For example, if angles is 4 and oldnum is 100, then 100-103 would be assigned to this mapping with each being at 90 degrees.
minskill indicates the minimum skill level required for this thing to spawn (starting at 0).
flags are:
  • HOLOWALL - When placed into a wall, this thing will make the wall non-solid. When combined with the PATHING flag then the wall immediate in front will be non-solid as well. Combine the flags using a pipe: PATHING|HOLOWALL
  • PATHING - This monster follows a patrol route instead of sitting in the Spawn state.
  • AMBUSH - This monster is deaf to sound.

Flats

  • ceiling { flats, ... }
  • floor { flats, ... }
Assigns floor/ceiling textures to sequential codes starting with 0. Up to 256 textures can be defined in each.

Info

Currently the fourth map plane does not have any translator options. It is enabled for all maps which contain a fourth plane and maps to the Rise of the Triad info plane.

This plane is used to assign functions to switches and touch plates (a touch plate is a tile which activates something when walked over). To use, simply create a trigger using any of the method above. It doesn't matter what activation method is used in the trigger as it will be adjusted automatically based on if the activating tile is a wall or not. On the tile where a trigger was placed, put 0xXXYY (coordinates in hexadecimal) as the fourth plane. A tag will be created and assigned to the arg0 parameter and then all triggers will be moved to the given coordinates.