Difference between revisions of "Map translator"

From ECWolf Wiki
m (New include feature.)
Line 3: Line 3:
 
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 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).
  
Other translation files can be included using '''include''' ''lumpname'' {{Hg|a7ba693|1.2}}.  If the lumpname is ''"$base"'' then the default translator will be loaded.
+
Other translation files can be included using '''include''' ''lumpname'' {{new}}.  If the lumpname is ''"$base"'' then the default translator will be loaded.
 +
 
 +
== 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;''' {{new}}
 +
: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.}}
 +
:{| class="wikitable"
 +
|-
 +
! 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 ==
 
== Tiles ==
Line 31: Line 79:
 
* '''floor''' { ''flats'', ... }
 
* '''floor''' { ''flats'', ... }
 
:Assigns floor/ceiling textures to sequential codes starting with 0. Up to 256 textures can be defined in each.
 
:Assigns floor/ceiling textures to sequential codes starting with 0. Up to 256 textures can be defined in each.
 +
 +
== Info ==
 +
{{new}}
 +
 +
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.

Revision as of 09:20, 12 June 2013

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).

Other translation files can be included using include lumpname (New from 1.4). If the lumpname is "$base" then the default translator will be loaded.

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; (New from 1.4)
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 then the thing has the AMBUSH flag set. If the fillzone keyword is used, one adjacent zone code is then filled into the spot.
  • 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.
  • tile oldnum { properties }
Assigns a wall tile to the oldnum.
  • trigger oldnum { properties }
Assigns a trigger to the tile.
  • zone oldnum {}
Assigns a sound zone to the oldnum.

Note that 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

  • 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.
  • { 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 PATHING flag then the wall immediate in front will be non-solid as well.
  • 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

(New from 1.4)

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.