Linedef

From ZDoom Wiki
(Redirected from Linedefs)
Jump to navigation Jump to search
DoomWiki.org
For more information on this article, visit the Linedef page on the Doom Wiki.

Linedefs are what make up the 'shape' (for lack of a better word) of your map. Every linedef is between two vertices and contains one or two sidedefs (which contain texture data). There are two major purposes of linedefs. The first is to give your map a definitive boundary between the player and the void (any area of a map behind a one-sided linedef is considered void space), and the second is to trigger action specials.

Linedefs can be assigned any of the action specials and will trigger them when a specified action occurs. You may flag linedefs to have their special executed when the player walks over the line, when the player uses the line (switches) or when the player pushes the line (similar to Quake or Quake 2 switches). Monsters may also trigger specials by walking over the line, and finally a projectile impact or cross can also trigger a special if you so desire.

In ZScript linedefs are controlled by the Line struct.

Specification (Doom format)

Bytes Data type Description
0-1 Unsigned short Beginning vertex
2-3 Unsigned short Ending vertex
4-5 Unsigned short Flags
6-7 Unsigned short Line type
8-9 Unsigned short Sector tag
10-11 Unsigned short Right sidedef - 0xFFFF means there is no sidedef
12-13 Unsigned short Left sidedef - 0xFFFF means there is no sidedef

Specification (Hexen format)

Bytes Data Type Description
0-1 Unsigned short Beginning vertex
2-3 Unsigned short Ending vertex
4-5 Unsigned short Flags
6 Unsigned byte Action special
7 Unsigned byte Action argument 1
8 Unsigned byte Action argument 2
9 Unsigned byte Action argument 3
10 Unsigned byte Action argument 4
11 Unsigned byte Action argument 5
12-13 Unsigned short Right sidedef - 0xFFFF means there is no sidedef
14-15 Unsigned short Left sidedef - 0xFFFF means there is no sidedef

Linedef flags

There are several conflicts in the flag list, depending on game. Map translators are used to define how values are associated to flags in a binary map. UDMF allows to solve these conflicts by not using a bitfield array but instead referring to each flag by name. UDMF also allows to define the remaining flags without having to use a function such as Line_SetIdentification, and several flags are only available in this map format.

Flag Bit Hex Description Mode UDMF name Line_SetBlocking name
BLOCKING 0 0x0001 blocks players and monsters Doom blocking BLOCKF_CREATURES
BLOCKMONSTERS 1 0x0002 blocks monsters Doom blockmonsters BLOCKF_MONSTERS
TWOSIDED 2 0x0004 two sided Doom twosided
DONTPEGTOP 3 0x0008 upper texture is unpegged Doom dontpegtop
DONTPEGBOTTOM 4 0x0010 lower texture is unpegged Doom dontpegbottom
SECRET 5 0x0020 secret (shows as one-sided on automap) Doom secret
SOUNDBLOCK 6 0x0040 blocks sound Doom blocksound BLOCKF_SOUND
DONTDRAW 7 0x0080 never shows on automap Doom dontdraw
MAPPED 8 0x0100 always shows on automap Doom mapped
RAILING 9 0x0200 line is a railing Strife jumpover BLOCKF_RAILING
PASSUSE 9 0x0200 passes use action Boom passuse
REPEAT_SPECIAL 9 0x0200 can be activated more than once ZDoom repeatspecial
BLOCK_FLOATERS 10 0x0400 Line blocks floating monsters Strife blockfloating BLOCKF_FLOATERS
3DMIDTEX 10 0x0400 Actors can walk on mid texture. Eternity midtex3d
SPAC_Use 10-12 0x0400 activated when used by player ZDoom playeruse
SPAC_MCross 10-12 0x0800 activated when crossed by monster ZDoom monstercross
SPAC_Impact 10-12 0x0C00 activated when hit by projectile ZDoom impact
SPAC_Push 10-12 0x1000 activated when bumped by player ZDoom playerpush
SPAC_PCross 10-12 0x1400 activated crossed by projectile ZDoom missilecross
SPAC_UseThrough 10-12 0x1800 activated when used by player (with pass through) ZDoom blocking
TRANSLUCENT 12 0x1000 line is 25% translucent (alpha of 0.75) Strife translucent
13 0x2000 line is 75% translucent (alpha of 0.25) Strife transparent
MONSTERSCANACTIVATE 13 0x2000 line can be activated by players and monsters ZDoom monsteractivate
BLOCK_PLAYERS 14 0x4000 blocks players ZDoom blockplayers BLOCKF_PLAYERS
BLOCKEVERYTHING 15 0x8000 blocks everything (includes gunshots & missiles) ZDoom blockeverything BLOCKF_EVERYTHING
SPAC_Cross - - activated when crossed by player (default) ZDoom playercross
SPAC_AnyCross - - activated by anything crossing it ZDoom anycross
SPAC_MUse - - activated by monsters using it ZDoom monsteruse
SPAC_MPush - - activated by monsters bumping into it ZDoom monsterpush
FIRSTSIDEONLY - - Line can only be triggered from the front side. ZDoom firstsideonly
ZONEBOUNDARY - - Line is a boundary for sound reverb zones. ZDoom zoneboundary
CLIP_MIDTEX - - Line's mid textures are clipped to floor and ceiling (default in Strife). Strife clipmidtex
WRAP_MIDTEX - - Line's mid textures are wrapped. ZDoom wrapmidtex
CHECKSWITCHRANGE - - Switches can only be activated when vertically reachable. ZDoom checkswitchrange
BLOCKPROJECTILE - - Line blocks all projectiles ZDoom blockprojectiles BLOCKF_PROJECTILES
BLOCKUSE - - Line blocks all use actions ZDoom blockuse BLOCKF_USE
BLOCKSIGHT - - Line blocks line of sight for monsters ZDoom blocksight BLOCKF_SIGHT
BLOCKHITSCAN - - Line blocks hitscan attacks ZDoom blockhitscan BLOCKF_HITSCAN
3DMIDTEX_IMPASS - - Causes the mid texture to behave like an impassible line (projectiles pass through it). Used in conjunction with midtex3d. ZDoom midtex3dimpassible
BLOCKLANDMONSTERS - - Line blocks ground-based monsters (Monsters without the FLOAT flag). ZDoom blocklandmonsters BLOCKF_LANDMONSTERS

UDMF properties

In addition to the above flags, the Universal Doom Map Format allows to set a number of properties on linedefs. Unless otherwise specified, default values for integers and float is 0, and false for booleans. They include:

Name Type Description
alpha float Translucency of this line, default is 1.0.
arg0str string Alternate string-based version of arg0, used for named scripts.
arg0 integer First parameter.
arg1 integer Second parameter.
arg2 integer Third parameter.
arg3 integer Fourth parameter.
arg4 integer Fifth parameter.
comment string A comment. This is purely for map authors' convenience as it is ignored by the engine.
locknumber integer Line special is locked, see key types and LOCKDEFS.
renderstyle string Render style, can be "translucent" or "add", default is "translucent".
sidefront integer Front sidedef index. No default value: a linedef without a front sidedef invalidates the entire map.
sideback integer Back sidedef index. Default = -1 for "no back side".
special integer Action special for the line.
moreids string Additional line tags, specified as a space-separated list of numbers, e.g., "2 666 1003 4505".

See also