Thing

From SRB2 Wiki
Jump to: navigation, search
For Objects, which are sometimes mislabeled as Things, see Object.
A section of a map with a Thing highlighted.

A Thing is a map component that is used to spawn an Object when the map is loaded. Examples include spawn points for players, enemies, rings, monitors and scenery items.

Things are closely related to Objects, but they are not the same. Most Thing types correspond directly to an Object type. For example, a Thing of the type "Crawla" will spawn an Object of the type "Crawla". However, some types of Objects cannot be placed directly on a map via a Thing, such as missiles or shields. Similarly, some Thing types are not directly linked to an Object type. For example, special placement patterns such as the Circle of Rings spawn a group of Objects in a predetermined arrangement rather than just a single Object.

Specification

The Things of a map are stored in the THINGS lump as a list. Each Thing has a 10-byte entry consisting of the following:

Bytes Data type Description
0–1 Signed 16-bit integer X position
2–3 Signed 16-bit integer Y position
4–5 Signed 16-bit integer Angle
6–7 Unsigned 16-bit integer Lower 12 bits: Type
Upper 4 bits: Parameter
8–9 Signed 16-bit integer Lower 4 bits: Flags
Upper 12 bits: Z position

Thing properties

Thing type

For a list of Thing types, see Thing types.
Zone Builder's Thing properties window. Click to enlarge.

Each Thing has its own number by which it can be identified, ranging from 0 to 4095. In map editors such as Zone Builder, SRB2 Doom Builder and SRB2 Workbench, the Things are separated into different categories by a drop-down list, which makes the Thing placement process easier.

In Zone Builder and SRB2 Doom Builder, additional properties for a Thing type will be displayed when selected in the Thing properties window. These are determined by the configuration file loaded for the editor.

X/Y position

For all Thing types, these are the absolute X and Y map coordinates the Thing is located at, measured in fracunits. These can be any value from -32768 to 32767. These properties are normally set when a Thing is first placed in the map or dragged around after being placed; however, in Zone Builder and SRB2 Workbench, they can also be changed manually through the Thing properties window.

Z position

For most Thing types, this property is the Z-offset that determines how far up from the floor – or how far down from the ceiling – the Thing is placed (measured in fracunits), depending on whether it hangs from the ceiling by default or not (if the Flip flag is checked, this will invert which of them is used). This can be any value from 0 to 4095. Thing types that do not use this property directly for determining the Thing's Z-offset (if at all) include the Axis, Axis Transfer, Axis Transfer Line, and the non-customizable Hoop.

This property's value is normally calculated as part of the Thing's total Flags value – see below for details.

Map editors such as Zone Builder, SRB2 Doom Builder and SRB2 Workbench also provide an Absolute option – when the box for this is checked, the Thing's absolute Z position from 0 is determined instead. The map editor will then calculate the required relative Z position automatically, which will be displayed when the Thing properties window is next opened.

Angle

For most Thing types, this property controls the direction the Thing is facing. This is measured relative to the east in a counterclockwise fashion, so 0º is north, 90º is east, 180º is south, and 270º is west. Some Thing types (e.g. the Star Post) use this property for additional effects; in these cases it can have any value and might even exceed 360º. Any value within a range of -32768 to 32767 can be used here.

Parameter

This is a special value ranging from 0 to 15 that can determine extra properties for a Thing. Notable Thing types that use this property include various NiGHTS items as well as the Fan Particle Generator and Flame Jets.

This value can be set directly in Zone Builder and SRB2 Workbench; in other map editors such as SRB2 Doom Builder, this property's value has to be added as a multiple of 4096 to the Thing type number – e.g. the Blue Crawla (Thing type 100) with a parameter value of 2 would have a Thing type number of 100 + 2×4096, or 8292.

Flags

These are a series of toggles that may be applied to a Thing to change how the Object spawned behaves in-game – outside the context of level editing these are referred to as Thing flags. Some Thing types (e.g. the NiGHTS Bumper) instead require combinations of these flags for certain effects; in these cases, the individual effects of these flags may or may not apply.

In map editors such as Zone Builder, SRB2 Doom Builder and SRB2 Workbench, these are displayed as a list of checkboxes that can be checked; the mathematical total of the corresponding values for the selected flags is given in the Flags Value box below the flags list. Note that this value also combines the Thing's Z position in its total multiplied by 16 – the resulting value given by Flags Value is: Thing Flags + Z position×16.

The flags and their purposes are given below:

Value Editor name Internal name Description
1 Extra none This flag is unused by most Thing types.
2 Flip MTF_OBJECTFLIP This flag inverts the Thing's gravity direction, and also inverts whether the Thing's Z position is measured from the floor or ceiling. For instance, power-up monitors will be flipped upside-down and laid on the ceiling instead of the floor, while Things that hang from the ceiling by default (e.g. chains) will be flipped upside-down but laid on the floor instead of the ceiling.

In most cases, this flag will also give the corresponding Object(s) the secondary Object flag MF2_OBJECTFLIP when checked. Exceptions to this include the following Thing types:

4 Special MTF_OBJECTSPECIAL This is a special flag that has no general effect but is rather used by certain Thing types for turning on extra features or alternative behavior.
8 Ambush MTF_AMBUSH This is a special flag that has no general effect but is rather used by certain Thing types for turning on extra features or alternative behavior.

In most cases, this flag will also give the corresponding Object(s) the Object flag MF_AMBUSH when checked. Exceptions to this include the following Thing types:

A flag named (Used for Z offsets) may also be displayed in some map editors below the flags listed above – this flag is reserved for calculating the Thing's Z-offset and should never be checked manually.

In some editors, the names of certain flags may change depending on the current Thing type. For example, the Ambush is renamed to Float for rings because it makes them hover 24 fracunits above the ground. For most power-up monitors, it is renamed to Random (Weak) because it makes them respawn randomly in a WRM fashion in multiplayer. Zone Builder supports renaming for all flags, SRB2 Workbench for the Special flag and the Ambush flag, and SRB2 Doom Builder only for the Ambush flag.

See also

  Map components [view]

ThingLinedefSidedefVertexNodeSectorRejectBlockmap