------------------------------------------------
Shadow Warrior Wall and Sector Tagging Reference
Compiled And Edited By Keith Schuler
(c) 1997 3D Realms Entertainment
------------------------------------------------

This document is your reference guide to using the sector and wall tags
in Shadow Warrior, including sector objects. Some examples of these tags
can be found in EXAMPLE.MAP, so be sure to check that map out. You'll find
it in the \GOODIES\TOOLS directory on your Shadow Warrior CD.

Refer to these documents in the \GOODIES\DOC directory on your Shadow
Warrior CD for other important information:

ADVANCED.TXT - Brief explanations of room-over-room, sector objects, and
other advanced Shadow Warrior mapping topics.
EDITART.TXT  - Instructions and reference for using the EDITART program.
EXAMPLE.TXT  - Documentation to accompany EXAMPLE.MAP, which includes
demonstrations of almost all of Shadow Warrior's map functionality.
SLABSPRI.TXT - Instructions and reference for using the SLABSPRI program.
SWSOUNDS.TXT - An index of the sound effects and ambient sounds.
SPRITAGS.TXT - Sprite tagging reference. Your guide to all the special
sprites in Shadow Warrior and how to use them.
SWBUILD.TXT  - A tutorial and reference guide to using the BUILD editor.
WALLTAGS.TXT - Wall and sector tagging reference. These are all the wall and
sector tags used in Shadow Warrior.
-----------------------------------------------------------------------------


--------
Contents
--------

Sector Tags                                             1
        Sector Triggers                                 1.1
                43. TAG_TRIGGER_MISSILE_TRAP
                116. TAG_LEVEL_EXIT_SWITCH
                206. TAG_SECTOR_TRIGGER_VATOR
                210. TAG_LIGHT_TRIGGER
                211. TAG_TRIGGER_EVERYTHING
                212. TAG_TRIGGER_EVERYTHING_ONCE
                216. TAG_SPAWN_ACTOR_TRIGGER
                217. TAG_SECRET_AREA_TRIGGER
                240. TAG_SPRING_BOARD
        Sine wave floor or ceiling                      1.2
                400. TAG_SINE_WAVE_FLOOR
                420. TAG_SINE_WAVE_CEILING
                440. TAG_SINE_WAVE_BOTH
        Sector Object Tags                              1.3
                501. TAG_OBJECT_CENTER

Wall Tags                                               2
        Sine wave wall effect                           2.1
                300. TAG_WALL_SINE_Y_BEGIN
                301. TAG_WALL_SINE_X_BEGIN
                302. TAG_WALL_SINE_Y_END
                303. TAG_WALL_SINE_X_END
        Other Wall Tags                                 2.2
                305. TAG_WALL_CLIMB
                306. TV_CAMERA_SCREEN
                307. TAG_WALL_BREAK
                900. TAG_WALL_PLAY_SOUND
        Sector Object Wall Tags                         2.3
                500. TAG_WALL_LOOP_DONT_SPIN
                501. TAG_WALL_LOOP_REVERSE_SPIN
                502. TAG_WALL_LOOP_SPIN_2X
                503. TAG_WALL_LOOP_SPIN_4X
                504. TAG_WALL_LOOP_OUTER
                507. TAG_WALL_LOOP_DONT_SCALE
                508. TAG_WALL_LOOP_OUTER_SECONDARY
                550. TAG_WALL_ALIGN_SLOPE_TO_POINT

-----------------------------------------------------------------------------

-------------------
1.      Sector Tags
-------------------

Many things can be done in Shadow Warrior using sector tags. In general, the
sector's lotag is used to identify the effect the sector will produce, while
the hitag is used to supply supplemental information like a match tag or a
track to follow.

1.1     Sector Triggers:

A "trigger" is the term in Shadow Warrior for a sector that triggers some
match tag event when the player steps into it, much like a switch does. In
Duke Nukem 3D, they were called "touchplates," but the general idea is the
same. The sector triggers available are as follows:

Lotag 43:       TAG_TRIGGER_MISSILE_TRAP
                Hitag = Match

Shoots a fireball from a FIREBALL_TRAP (hitag 43), BOLT_TRAP (hitag 44), or
a SPEAR_TRAP (hitag 63) ST1 sprite with a lotag that matches the sector's
hitag.

Lotag 116:      TAG_LEVEL_EXIT_SWITCH
                Hitag = Next level

When the player steps into this sector, the level will end. The game will
then proceed to the level listed in the sector hitag, provided the current
level has the same filename as one of the levels that came with Shadow
Warrior. For most external maps, a hitag of 0 should be sufficient.

Lotag 206:      TAG_SECTOR_TRIGGER_VATOR
                Hitag = Match

Triggers a vator, spike, slidor, or rotator with a TAG2 that matches the
hitag of this sector.

Lotag 210:      TAG_LIGHT_TRIGGER
                Hitag = Match

Triggers all LIGHTING (hitag 108) ST1's with a TAG2 equal to the hitag of
this sector when the player steps into it.

Lotag 211:      TAG_TRIGGER_EVERYTHING
               Hitag = Match

Stepping into this sector triggers any event with a matching tag.

Lotag 212:      TAG_TRIGGER_EVERYTHING_ONCE
                Hitag = Match

Stepping into this sector triggers any event with a matching tag once and
only once.

Lotag 216:      TAG_SPAWN_ACTOR_TRIGGER
                Hitag = Match

Give an actor a lotag of 203, and a matching hitag, and he will not appear
normally at the map startup. Instead, he will teleport in when the player
steps on this sector.

Lotag 217:      TAG_SECRET_AREA_TRIGGER

Marks a sector as a secret area.

Lotag 240:      TAG_SPRING_BOARD
                Hitag = Height of the jump

Step on the sector, press the SPACEBAR, and it shoots you high into the air.
Hitag designates how high the player will jump. One example of this is the
ventilation shaft at the end of $NEWMINE.MAP.


1.2     Sine wave floor or ceiling:

You can have a maximum of five of these per level. See room GA in EXAMPLE.MAP
to see how this is done. Lotag the first sector with 400, the next with 401,
and so on up to 419. The WAVE will actually flow from the opposite end.
The wave direction is what is referred to when BEGINNING and END are
referred to below.

1st sector hitag = The range in pixels the floor will undulate in the
                   Z direction
2nd sector hitag = Range decrement - takes the range from the 1st sector
                   high tag and adjusts all the rest by this decrement -
                   makes the WAVE start off small and get LARGER toward
                   the end - THIS IS IN Z COORDINATES *NOT* PIXELS
3rd sector hitag = Speed of the motion - defaults to 3 
4th sector hitag = Number of sectors from one peak (top of the curve) to the
                   next. The default is the total number of sectors in the
                   entire sine wave. (max of 20)
Last sector hitag= Special tag to make a realistic ocean wave - modifies the
                   range toward the END (greatest range is usually here) of
                   the WAVE so that it dissapates quickly. Without this it
                   would just continue to get bigger toward the end of the
                   WAVE.

Lotag 400:      TAG_SINE_WAVE_FLOOR
                Hitag = Range in Z pixels floor will undulate

First sector lotag is 400, then 401, then 402, all the way up to a max of
419. Creates a sine wave on the floor. Slope the sectors to make a smooth,
sloping sine wave.

Lotag 420:      TAG_SINE_WAVE_CEILING
                Hitag = Range in Z pixels ceiling will undulate

First sector lotag is 420, then 421, then 422, all the way up to a max of
439. Creates a sine wave effect on the ceiling.

Lotag 440:      TAG_SINE_WAVE_BOTH
                Hitag = Range in Z pixels both floor and ceiling

First sector lotag is 440, then 441, then 442, all the way up to a max of
459. Creates a sine wave effect both on the floor and on the ceiling.


1.3     Sector Object Tags:

Sector objects (SO's) are groups of sectors that can be moved around together
as a unit. All SOs must have at a minimum:

1. Bounding sprites (upper left and lower right) that form an imaginary
   rectangle to contain all sectors and sprites to be moved.
   ST1 SECT_SO_BOUNDING tags 500-600 are used for this.
2. A sector marked as the center of the SO.
3. An outer wall loop which forms an unbroken single sector that entirely
   encircles the sector object. One of the walls in this loop must have a
   lotag of 504.

Sector lotags 500-596 are set reserved for sector objects. There is a
maximum of 20 SO's per level. Lotags 500-501 correspond to object 0,
505-506 to object 1, 510-511 to object 2, and so on, just like the
SECT_SO_BOUNDING ST1 sprites.

Lotag 501:      TAG_OBJECT_CENTER
                Hitag =    -1: Don't follow a track
                         0-94: Track to follow
                           95: Killable Sector Object
                           96: Auto turret
                           98: Operational

Lotag 501 tags the center sector of SO 0, while 506 would tag the center of
SO 1, and so on. The center sector lotag will always be the same as the
lower bounding sprite hitag. The sector hitag defines how the sector object
will behave.


-----------------
2.      Wall Tags
-----------------

Several things can be done in Shadow Warrior using wall tags. In general, the
wall's lotag is used to identify the effect the wall will produce, while
the hitag is used to supply supplemental information like a match tag.

2.1     Sine wave wall effect:

You can have a maximum of 5 of these per level. Lotag the first wall to sine
wave with 300, the last one with 302. Look in room GB in EXAMPLE.MAP to see
how to do this.

1st wall hitag = Range
2nd wall hitag = Speed
3rd wall hitag = A distance from one peak (top of curve) to the next

Lotag 300:      TAG_WALL_SINE_Y_BEGIN
                Hitag = Range

        Use this to start a sine wave effect on a horizontal wall. Sine wave
        will travel along the wall until it encounters a lotag 302.

Lotag 301:      TAG_WALL_SINE_X_BEGIN
                Hitag = Range

        Use this to start a sine wave effect on a vertical wall. Sine wave
        will travel along the wall until it encounters a lotag 303.

Lotag 302:      TAG_WALL_SINE_Y_END

        End a sine wave wall effect.

Lotag 303:      TAG_WALL_SINE_X_END

        End a sine wave wall effect.


2.2     Other Wall Tags:

Lotag 305:      TAG_WALL_CLIMB

        Climbable wall, used with SPRI_CLIMB_MARKER (hitag 30) ST1. You may
        only use this walltag on a red wall. Ladders aren't allowed on
        white walls.

Lotag 306:      TV_CAMERA_SCREEN
                Hitag = Match

        Use this walltag only on a mirror. The hitag is a match equal to the
        TAG2 of a MIRROR_CAM (hitag 1000) ST1. Allows a mirror to display
        the view of the camera instead of a reflection.

Lotag 307:      TAG_WALL_BREAK
                Hitag = Match

        Used in conjunction with BREAKABLE (hitag 132) ST1. Marks a wall as
        being breakable. The wall's hitag is equal to the BREAKABLE ST1's
        TAG2.

Hitag 900:      TAG_WALL_PLAY_SOUND
                Lotag = Sound effect #

        Notice that the hitag is 900, not the lotag! When the player presses
        SPACEBAR against this wall, the sound effect designated by the lotag
        will be played.

2.3     Sector Object Wall Tags:

These are mainly for sector objects that rotate. Tag ONE wall of the loop to
obtain the desired effect. See room FD in EXAMPLE.MAP for an example of how
to use this kind of walltag.

Lotag 500:      TAG_WALL_LOOP_DONT_SPIN

        This wall loop will not spin along with the rest of
        the sector object.

Lotag 501:      TAG_WALL_LOOP_REVERSE_SPIN

        This wall loop will spin in the opposite direction of the rest of
        the sector object.

Lotag 502:      TAG_WALL_LOOP_SPIN_2X

        This wall loop will spin two times as fast as the rest of the
        sector object.
        
Lotag 503:      TAG_WALL_LOOP_SPIN_4X

        This wall loop will spin four times as fast as the rest of the
        sector object.

Lotag 504:      TAG_WALL_LOOP_OUTER

        All sector objects use this. Tags the outermost bounding wall loop of
        the sector object.

Lotag 507:      TAG_WALL_LOOP_DONT_SCALE

        Tag one wall in a loop you don't want to scale with the rest of the
        sector object.
        
Lotag 508:      TAG_WALL_LOOP_OUTER_SECONDARY

        Rectangular clipping doesn't work too well if you've got an
        operational sector object in a stacked sector area. Use lotag 508
        on the secondary sector object instead of the usual 504 to make
        rectangular clipping behave. See the driveable boat in $YAMATO.MAP
        for an example of how to use this.

Lotag 550:      TAG_WALL_ALIGN_SLOPE_TO_POINT

        See room ED in EXAMPLE.MAP for an example of this. Used to make all
        slopes in a sector object align to a single point, usually as the
        point moves up and down.
