Difference between revisions of "Map translator"

From ECWolf Wiki
(Clarifications and formatting updates)
Line 1: Line 1:
 
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]].
 
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 plans in a binary map: ''tiles'', ''things'', and ''flats''.  Each section or block is enclosed in braces and the specific contents varies. 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).
+
A translator contains 3 sections which correspond to the three planes in a binary map: <tt>'''tiles'''</tt>, <tt>'''things'''</tt>, and <tt>'''flats'''</tt>.  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).
  
Other translation files can be included using <tt>'''include''' ''lumpname''</tt>If the <tt>lumpname</tt> is <tt>''"$base"''</tt> then the default translator will be loaded.
+
==Including other translators==
 +
Other translation files can be included:
 +
* <tt>'''include ''lumpname'';'''</tt>
 +
:If the <tt>lumpname</tt> is <tt>"$base"</tt> then the default translator for the game will be loaded.
 +
:<tt>include</tt> statements can appear anywhere in the global scope (i.e. outside of the <tt>tiles</tt>, <tt>things</tt>, and <tt>flats</tt> blocks).
 +
:<tt>include</tt> statements are the equivalent of copying in the contents of the referenced file.  
  
 
== Feature flags ==
 
== Feature flags ==
 
Special meaning to some tiles can be enabled through feature flags.  The following is to be placed outside of any block.
 
Special meaning to some tiles can be enabled through feature flags.  The following is to be placed outside of any block.
* <tt>enable lightlevels;</tt>
+
* <tt>'''enable lightlevels;'''</tt>
: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.)
+
: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.}}
 
{{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.}}
 
:{| class="wikitable"
 
:{| class="wikitable"
Line 56: Line 61:
 
* <tt>'''modzone ''oldnum'' [fillzone] ambush;'''</tt>
 
* <tt>'''modzone ''oldnum'' [fillzone] ambush;'''</tt>
 
:Checks for a thing in the tile. If one exists, the thing has the [[UWMF#Things|<tt>ambush</tt>]] flag set.  
 
:Checks for a thing in the tile. If one exists, the thing has the [[UWMF#Things|<tt>ambush</tt>]] flag set.  
:If the optional <tt>fillzone</tt> keyword is specified, the tile's sound zone is taken from an adjacent tile.  The sound zone to use is the first one of the east, north, west, or south zone to be found.
+
:If the optional <tt>fillzone</tt> keyword is specified, the tile's sound zone is taken from an adjacent tile.
 
* <tt>'''modzone ''oldnum'' [fillzone] changetrigger ''action'' { ''properties'' }'''</tt>
 
* <tt>'''modzone ''oldnum'' [fillzone] changetrigger ''action'' { ''properties'' }'''</tt>
 
:Searches all adjacent tiles for triggers with the specified [[Action specials|<tt>''action''</tt>]]. For each one found, the trigger is disabled on the side facing the <tt>modzone</tt> and a new trigger for that side is added based on the properties specified.
 
:Searches all adjacent tiles for triggers with the specified [[Action specials|<tt>''action''</tt>]]. For each one found, the trigger is disabled on the side facing the <tt>modzone</tt> and a new trigger for that side is added based on the properties specified.
:If the optional <tt>fillzone</tt> keyword is specified, the tile's sound zone is taken from an adjacent tile.  The sound zone to use is the first one of the east, north, west, or south zone to be found.
+
:If the optional <tt>fillzone</tt> 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.
 
* <tt>'''tile ''oldnum'' { ''properties'' }'''</tt>
 
* <tt>'''tile ''oldnum'' { ''properties'' }'''</tt>
 
:Assigns a wall [[UWMF#Tiles|tile]] to the <tt>''oldnum''</tt>.  
 
:Assigns a wall [[UWMF#Tiles|tile]] to the <tt>''oldnum''</tt>.  
Line 69: Line 74:
 
:Assigns a sound [[UWMF#Zones|zone]] to the <tt>''oldnum''</tt>.
 
:Assigns a sound [[UWMF#Zones|zone]] to the <tt>''oldnum''</tt>.
  
Notes:
+
'''Note:''' There are no limits to how you allocate your 65536 <tt>oldnum</tt>s. Doors are simply the combination of a tile and trigger with the same number.
* There are no limits to how you allocate your 65536 <tt>oldnum</tt>s. Doors are simply the combination of a tile and trigger with the same number.
 
  
 
== Things ==
 
== Things ==

Revision as of 03:58, 15 December 2016

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.

  • 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

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.
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, ednum, angles, flags, minskill }
Maps the oldnum to the ednum 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 PATHINGflag 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.

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.