SWITCHES

From DoomWiki.org

The SWITCHES lump is a Boom feature for defining additional switches. Although some modern editors such as SLADE 3 allow to create and edit this lump directly in binary form, the original method devised by TeamTNT involved creating a text file and converting it with a small utility called swantbls (switch and animation tables). SWITCHES lumps are supported by all Boom compatible ports and Doomsday.

SWITCHES lumps are not cumulative; only the last one loaded will be used.

Format[edit]

SWITCHES is a series of 20 byte entries:

Length Description
9 bytes Null-terminated name of the "off" texture.
9 bytes Null-terminated name of the "on" texture.
2 bytes 16 bit int specifying which IWADs this switch works with:
  • 0: terminate SWITCHES list.
  • 1: Shareware.
  • 2: Shareware, Doom.
  • 3: Shareware, Doom, Doom II.

The last entry, with a 0 in its final two bytes, is not used.

If a switch is defined while its textures are not present, the vanilla engine will complain, which is why this tiered approach was adopted by id Software originally, and also why Doom II contains some identical switch definitions that are never used in its maps; they correspond to switches from Doom that were dummied out to prevent errors.

Swantbls syntax[edit]

The swantbls tool converts a plain text file into an ANIMATED and SWITCHES lump. The format of the plain text file prior to conversion is as follows (quoth defswani.dat):

# This file is input for SWANTBLS.EXE, it specifies the switchnames
# and animated textures and flats usable with BOOM. The output of
# SWANTBLS is two lumps, SWITCHES.LMP and ANIMATED.LMP that should
# be inserted in the PWAD as lumps.
#
#switches usable with each IWAD, 1=SW, 2=registered DOOM, 3=DOOM2
[SWITCHES]
#epi    texture1        texture2
1       SW1BRCOM        SW2BRCOM
...
#animated flats, spd is number of frames between changes
[FLATS]
#spd    last        first
8       NUKAGE3     NUKAGE1
...
#animated textures, spd is number of frames between changes
[TEXTURES]
#spd    last        first
8       BLODGR4     BLODGR1
...

See also[edit]

External links[edit]