Linedef

From SRB2 Wiki
Jump to: navigation, search
A section of GFZ1 with a linedef highlighted.

A linedef is a map component that connects two vertices on a map in a straight line. Linedef mark the boundaries between sectors, and a typical sector is defined by a closed loop of linedefs. No two linedefs may cross, and they all must be shorter than 32768 fracunits in length.

Rendering

For details on how textures are rendered, see Sidedef.

Somewhat contrary to intuition, linedefs themselves are not rendered by the game engine. Instead, certain textures of the sidedef(s) associated with each linedef are rendered, as necessary. Each linedef can have either one or two sidedefs – every linedef must have a sidedef on its front side, while it is normal (but not always needed) to have one on its back side as well. If the back side of the linedef faces empty space (i.e. sector 0), it doesn't need a back sidedef (except for some linedef specials that require it), but if the backside of a linedef faces another sector, it needs a back sidedef. These settings are normally automatically set by the map editor.

Relationship to sectors

The sectors to which a linedef belongs are not determined by the geometrical structure of the map, but by the sector references of the linedef's sidedefs. This allows sectors to be disjoint. However, it also means that illegal sector configurations such as unclosed sectors are possible (for example, multiple linedefs facing the same region but with different sector references on the relevant sidedefs), which can lead to crashes. Such circumstances can often arise when deleting linedefs in such a way that the map editor does not correct the sector references automatically.

Linedef properties

Zone Builder's Linedef Properties Dialog. Click to enlarge.

Action

For a list of linedef actions, see Linedef types.

Also known as a linedef special or linedef effect, this property is a number that specifies a special effect. Depending of what type of special this is, it will either affect the linedef itself or a specified target sector. In the second case, the linedef should belong to a control sector outside of the main map. Linedefs without a special effect have linedef type 0.

Tag

This property specifies which sector(s) the linedef action will affect. The effect will be applied to all sectors whose tags match this property. Certain effects, such as the Change Music special, do not apply to special sectors, in this case, the tag can be left as 0. Note that if a linedef that needs a tag is tagged with 0, it will affect all untagged sectors. Certain linedefs can be tagged with 65535 to affect all sectors in the map. This is useful for certain visual effects that should apply to the whole map.

Flags

Linedef flags are used to give special properties to a linedef or the effect it exhibits. The table below lists the normal significance of the linedef flags. For some linedef specials, the flags have different meanings. In those cases, the effects will be listed in the appropriate article.

Decimal Hexadecimal Editor name Internal name Description
1 0x0001 Impassable ML_IMPASSIBLE Makes the linedef impassable.
2 0x0002 Block Enemies ML_BLOCKMONSTERS Prevents almost all moving enemies and bosses from crossing the linedef. Does not prevent enemies from detecting the player if the linedef is between them. This flag is also often used for other purposes by specific linedef types.
4 0x0004 Double-Sided ML_TWOSIDED Indicates that a linedef has a back sidedef, i.e., that its back does not face into empty space. This flag is normally set automatically by map editors.
8 0x0008 Upper Unpegged ML_DONTPEGTOP (Two-sided linedefs only)

If this flag is set, the upper texture is attached to the higher of the two ceilings that border the linedef. Otherwise, it is attached to the lower of the two ceilings. See Pegging. This flag is also used to make timed linedef executors.

16 0x0010 Lower Unpegged ML_DONTPEGBOTTOM (Two-sided linedefs only)

If this flag is set, the lower texture is attached to the lower of the two floors that border the linedef, and the middle texture is attached to the higher of the two floors. Otherwise, the lower texture is attached to the higher of the two floors, and the middle texture is attached to the lower of the two ceilings that border the linedef. See Pegging.

32 0x0020 Slope Skew ML_EFFECT1 (Two-sided linedefs only)

If any of the linedef's upper or lower textures are attached to a slope, setting this flag will cause them to be skewed to match the angle of the slope. See Slope > Texture skewing for further details. This flag is also often used for other purposes by specific linedef types.

64 0x0040 Not Climbable ML_NOCLIMB Prevents climbing characters, e.g., Knuckles, from climbing walls on this linedef. This flag is also often used for other purposes by specific linedef types.
128 0x0080 No Midtexture Skew ML_EFFECT2 If the middle texture is attached to a slope, it will usually be skewed to match the angle of the slope. Setting this flag disables the skewing effect. See Slope > Texture skewing for further details. This flag is also often used for other purposes by specific linedef types.
256 0x0100 Peg Midtexture ML_EFFECT3 (Two-sided linedefs only)

Inverts the pegging behavior of the middle texture. If the middle texture would be attached to the ceiling otherwise, setting this flag will make it attach to the floor. If it would be attached to the floor otherwise, setting this flag will make it attach to the ceiling. This flag is also often used for other purposes by specific linedef types.

512 0x0200 Solid Midtexture ML_EFFECT4 (Two-sided linedefs only)

Makes the middle texture solid. This flag is also often used for other purposes by specific linedef types.

1024 0x0400 Repeat Midtexture ML_EFFECT5 (Two-sided linedefs only)

Tiles the middle texture so that it fills up the empty space between the upper and lower texture, rather than just being rendered once. The X offset can be used to control how often the texture is tiled: For each extra copy of the texture, 4096 should be added to the X offset. For example, an offset of 8192 will cause the texture to be rendered three times. This flag is also often used for other purposes by specific linedef types.

2048 0x0800 No Sonic ML_NOSONIC Prevents a linedef action from having an effect when playing as a character with the thok ability. Does not work in multiplayer games.
4096 0x1000 No Tails ML_NOTAILS Prevents a linedef action from having an effect when playing as a character with the fly ability. Does not work in multiplayer games.
8192 0x2000 No Knuckles ML_NOKNUX Prevents a linedef action from having an effect when playing as a character with the glide/climb ability. Does not work in multiplayer games.
14336 0x3800 None1 ML_NETONLY Prevents a linedef action from having an effect unless in multiplayer games. Overrides the effects of No Sonic, No Tails and No Knuckles.
16384 0x4000 Bouncy Wall ML_BOUNCY Causes objects to bounce off walls on this linedef. This flag is also occasionally used for other purposes by specific linedef types.
32768 0x8000 Transfer Line ML_TFERLINE Allows the attributes for each side of an FOF to be specified individually. The control sector must have at least the same number of sides as the target sector(s). Useful for making multi-property FOFs where each side has its own properties.

1 This flag does not actually exist in the context of map editors; it is a special effect that is triggered only by having all the character ability flags (No Sonic, No Tails and No Knuckles) toggled on at the same time.

  Map components [view]

ThingLinedefSidedefVertexNodeSectorRejectBlockmap