Sector_SetLink

From ZDoom Wiki
Jump to: navigation, search

51:Sector_SetLink (controltag, tag, surface, movetype)

  • controltag: Tag of the control sector.
  • tag: Tag of the sector(s) to link to the control sector.
  • surface: Whether to link to the control sector's ceiling (true) or floor (false).
  • movetype: Type of movement that will be linked. See below.

Creates a link between two or more sectors so that they will move together. This allows notably for the creation of complex lifts comprised of many sectors that will hold together if their movement gets blocked by the player or another actor.

If the control tag is 0, this special will be executed when the map is loaded with the line's front sector as the control sector. If the control tag is not 0, it will be executed at run time so it can be used in scripts or with switches. The control sector will be the first one with the matching tag. (New from 2.4.0) A sector can be linked to itself, allowing to link a ceiling's movement to its floor's, or vice-versa. To do that, the sector must have a tag, referenced in the tag argument; however controltag must be zero and so the special must be placed on one of the sector's front-facing lines.

type can be a combination of the following flags:

  • 1: link the tagged sector's floor to the specified surface of the control sector
  • 2: link the tagged sector's ceiling to the specified surface of the control sector
  • 4: the floor movement is the opposite direction as the control sector's surface (bit 1 is required)
  • 8: the ceiling movement is the opposite direction as the control sector's surface (bit 2 is required)

If type is 0, the sectors will be unlinked from the control sector.

Examples

There is one in this forum link.

See also