Sector Type (DED)

From Doomsday Wiki
Jump to: navigation, search
Sector Type
Attributes: Copy
Type ReferenceDED Syntax

These definitions specify the properties of a generalized sector type, for use with the XG system. XG is a (potentially) complex topic, with many core concepts which the mod author must be familiar with in order to use the system effectively. See the reference guide for further information.

The focus of this article is to detail how these properties are exposed to mod authors and the specifics of the syntax.

Core concepts

Ambient sounds

Sounds can be played for ambient effect in sectors with this type. #Ambient sounds are played at the interval specified (which, is (possibly randomly) calculated according to the minimum and maximum interval range) and will appear to emanate from the middle of all sector(s) with this type.

Angles

All angles are specified in degrees of a anticlockwise system where 0=east, 90=north, 180=west and 270=south. All floating-point values are accepted (even negative ones) though they'll be cycled into a normalized range automatically.

Chains

Each sector type may specify up to four different chains; ceiling, floor, inside and ticker. All chains are defined in the same way, however their behavior differs according to the chain type. See the sector type chain documentation in the XG reference guide for more information.

Behavior flags

These flags determine how the relevant chain will behave, both how and when they are triggered. There are _a and _d variations, which specify whether the behavior is effective when the chain is activated or deactivated, accordingly.

Note: Both versions of a flag cannot be used at once by the same chain
Name(_a/_d) Description
any Any mobj cause a chain event to be sent.
missile Mobjs that have the MF_MISSILE flag cause a chain event to be sent.
monster Mobjs that have the MF_COUNTKILL flag cause a chain event to be sent.
other Non-player mobjs cause a chain event to be sent.
player Player mobjs cause a chain event to be sent. player_a will send an activating event and player_d a deactivating event.
ticker Use only with the #Ticker chain. Chain events will be sent based on the game ticker, up to 35 times per second. The chain's start time, end time and chain min/max intervals can be used to configure how often the ticker sends the chain events.
Note: In DED version 5 syntax (or earlier), sector chain flags are prefixed with "scef_"

Functions

Provide the means to automatically set specific properties of a sector to a dynamically resolved value as described by a function expression. See the XG function script documentation for a detailed description of function expressions.

Ambient light functions

Set the intensity of the ambient light or color to the value of the function expression. Ambient light functions support random evaluation intervals. For example, the intensity of the ambient light might be randomized to create an "electrical-fault like" effect.

Plane height functions

Set the height of the plane to the value of the function expression. Plane height functions support relative offsets and scale factors as well as random evaluation intervals. For example, the height of a floor plane might be oscillated to create a "wave like" effect.

Syntax

[ Copy ] Sector Type {
}

ID

A unique identifying number (integer) for the sector type. Map editors use the id to refer to this sector type. Valid IDs are in the range 1...65535

Note: User-defined sector types have precedence over those of the original game, allowing their functionality to be easily customized in mods. For example, if the ID number 8 is specified, which, is the same as Doom's "Light Glows" sector type, then this sector type will be used instead.

Comment

Intended for a textual description of what the sector type does and used as a development aid for mod authors. Doomsday itself does not use this string for anything presently.

Flags

Name Description
crush The sector will crush things that don't fit inside it after moving a plane with #Functions.
friction The custom friction set with #Friction is used inside the sector.
gravity The custom gravity set with #Gravity is used inside the sector.
tagtexmove Texture movement angle for both the ceiling and floor planes is determined by finding the first line that belongs to the sector and has the line tag number specified with Act tag. Textures will scroll in the direction of the line.
ceilingwind Wind only affects mobjs that are touching the ceiling.
floorwind Wind only affects mobjs that are touching the floor.
tagwind Wind direction is determined by finding the first line that belongs to the sector and has the line tag number specified with #Act tag. Wind will blow in the direction of the line.
windany Wind affects all mobjs inside the sector.
windmissile Wind affects all mobjs with the MF_MISSILE flag inside the sector.
windmonster Wind affects all mobjs with the MF_COUNTKILL flag inside the sector.
windother Wind affects all non-player mobjs inside the sector.
windplayer Wind affects all player mobjs inside the sector.
Note: In DED version 5 syntax (or earlier), sector type flags are prefixed with "stf_"

Friction

Friction inside the sector. Only used if the friction flag is set, otherwise the default friction for the map is used instead.

Gravity

Gravity inside the sector. Only used if the gravity flag is set, otherwise the default gravity for the map is used instead.

Act tag

Activation tag number for the sector type. Several types can have the same activation tag. This number can be used in sector references (with for instance lsref_act_tagged). All signed 32-bit integer values are accepted.

Ambient sound

ID of the Sound to be played in sectors with this type. See Sector Type#Ambient sounds

Ambient min interval

Minimum interval in playing the ambient sound of the sector, in seconds.

Ambient max interval

Maximum interval in playing the ambient sound of the sector, in seconds.

Ceiling chain

ID number of an XG Line Type. See Sector Type#Chains

Ceiling chain flags

See Sector Type#Behavior flags

Ceiling chain start time

Number of seconds measured from the beginning of the level to the moment when the chain begins operating.

Ceiling chain end time

Number of seconds measured from the beginning of the level to the moment when the chain stops operating. If this is equal to or less than zero, the chain will continue operating indefinitely.

Ceiling chain min interval

Minimum interval, in seconds, between two consecutive chain events. The real interval is a random number between the minimum and maximum intervals.

Ceiling chain max interval

Maximum interval, in seconds, between two consecutive chain events.

Ceiling chain count

Number of times the chain can be processed successfully. When the chain counter becomes zero, the chain will stop operating. Negative values mean the chain counter is disabled and it will continue to work until the chain end time passes.

Floor chain

ID number of an XG Line Type. See Sector Type#Chains

Floor chain flags

See Sector Type#Behavior flags

Floor chain start time

Number of seconds measured from the beginning of the level to the moment when the chain begins operating.

Floor chain end time

Number of seconds measured from the beginning of the level to the moment when the chain stops operating. If this is equal to or less than zero, the chain will continue operating indefinitely.

Floor chain min interval

Minimum interval, in seconds, between two consecutive chain events. The real interval is a random number between the minimum and maximum intervals.

Floor chain max interval

Maximum interval, in seconds, between two consecutive chain events.

Floor chain count

Number of times the chain can be processed successfully. When the chain counter becomes zero, the chain will stop operating. Negative values mean the chain counter is disabled and it will continue to work until the chain end time passes.

Inside chain

ID number of an XG Line Type. See Sector Type#Chains

Inside chain flags

See Sector Type#Behavior flags

Inside chain start time

Number of seconds measured from the beginning of the level to the moment when the chain begins operating.

Inside chain end time

Number of seconds measured from the beginning of the level to the moment when the chain stops operating. If this is equal to or less than zero, the chain will continue operating indefinitely.

Inside chain min interval

Minimum interval, in seconds, between two consecutive chain events. The real interval is a random number between the minimum and maximum intervals.

Inside chain max interval

Maximum interval, in seconds, between two consecutive chain events.

Inside chain count

Number of times the chain can be processed successfully. When the chain counter becomes zero, the chain will stop operating. Negative values mean the chain counter is disabled and it will continue to work until the chain end time passes.

Ticker chain

ID number of an XG Line Type. See Sector Type#Chains

Ticker chain flags

See Sector Type#Behavior flags

Ticker chain start time

Number of seconds measured from the beginning of the level to the moment when the chain begins operating.

Ticker chain end time

Number of seconds measured from the beginning of the level to the moment when the chain stops operating. If this is equal to or less than zero, the chain will continue operating indefinitely.

Ticker chain min interval

Minimum interval, in seconds, between two consecutive chain events. The real interval is a random number between the minimum and maximum intervals.

Ticker chain max interval

Maximum interval, in seconds, between two consecutive chain events.

Ticker chain count

Number of times the chain can be processed successfully. When the chain counter becomes zero, the chain will stop operating. Negative values mean the chain counter is disabled and it will continue to work until the chain end time passes.

Light fn

The function expression string. See Sector Type#Ambient light functions

Light fn min tics

Minimum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Light fn max tics

Maximum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Red fn

The function expression string. See Sector Type#Ambient light functions

Red fn min tics

Minimum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Red fn max tics

Maximum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Green fn

The function expression string. See Sector Type#Ambient light functions

Green fn min tics

Minimum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Green fn max tics

Maximum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Blue fn

The function expression string. See Sector Type#Ambient light functions

Blue fn min tics

Minimum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Blue fn max tics

Maximum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Ceiling fn

The function expression string. See Sector Type#Plane height functions

Ceiling fn offset

This number will be added to the value of the function. This is a fixed offset unlike the dynamic offset that can be set with the function expression string.

Ceiling fn scale

The value of the function (usually between 0 and 1) will be multiplied with this factor.

Ceiling fn min tics

Minimum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Ceiling fn max tics

Minimum/maximum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Floor fn

The function expression string. See Sector Type#Plane height functions

Floor fn offset

This number will be added to the value of the function. This is a fixed offset unlike the dynamic offset that can be set with the function expression string.

Floor fn scale

The value of the function (usually between 0 and 1) will be multiplied with this factor.

Floor fn min tics

Minimum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Floor fn max tics

Maximum number of tics between evaluation steps. The real number of tics is a random number between the minimum and maximum tics.

Floor texmove angle

Direction for floor texture scrolling in degrees. This is not used if the tagtexmove flag is set.

Floor texmove speed

Speed of floor texture scrolling as map units per game tic (35 Hz). The speed of 2 would scroll the texture 70 units per second.

Ceiling texmove angle

Direction for ceiling texture scrolling in degrees. This is not used if the tagtexmove flag is set.

Ceiling texmove speed

Speed of ceiling texture scrolling as map units per game tic (35 Hz). The speed of 2 would scroll the texture 70 units per second.

Wind angle

Direction of wind inside the sector in degrees. This is not used if the tagwind flag is set.

Wind speed

Horizontal wind speed. The unit for wind speed is units/tic2 (see Wind).

Vertical wind

Vertical wind speed. Positive speed lifts things upward, negative one pushes them down. The unit for wind speed is units/tic2 (see Wind).

Examples

Ticker chain triggering

Sector Type {
  ID = 5002;
  Comment = "Immediately trigger line type 6101";
  Ticker chain = 6101;
  Ticker chain count = 1;
}

A chain event be will sent once, immediately, to the Line Type 6101.

Water current

Sector Type {
  ID = 5001;
  Comment = "Scroll along tag 9999";
  Flags = tagtexmove | tagwind | windplayer;
  Act tag = 9999;
  Floor texmove speed = 1.8;
  Wind speed = 0.16875;
}

The sector has a scrolling floor and wind that affects player mobjs. Wind will blow and the floor material will scroll, in the direction that sector line with the act tag 9999 is pointing. Material scrolling and wind speed are synchronized. This gives the appearance that the floor is moving and will move the player with it.

See also