																			  Part 3 - Page 1
	
	B E G I N N E R S   G U I D E   T O   D E U
																	 
Part 3 - Switches, Tripwires, and Lifts

This part of the Guide will cover various types of switches used
in DOOM, and how to make Sectors that move up and down.  These Sectors
are sometimes called lifts, elevators, platforms, drawbridges, etc.
I've included a PCX file (DEUGP3.PCX) with this section of the guide.
I'll refer to this PCX later, so it would be a good idea to make a
printout of it now.  Also included is a PWAD file (DEUGP3.WAD) of the
completed level we will build in this lesson.

Start up DEU and load in your "three Sectors and a door" level that
we constructed in Part 2.  Get into Line mode by pressing "L".  In
the lower room (Sector #0), select the eastern wall by moving the
mouse cursor across it.  Split this wall into two sections by hitting
the "F10" key, then choosing 4 - Split LineDef (add new Vertex).  The
east wall should now be comprised of two Lines.  Select each of those
Lines and split each one in half again.  When you are done, the east
wall should have four Lines, each with a LineDef Flag of Im, a Type
of 0 - Normal, and a Sector Tag of 0 (none).  Each LineDef should have
a 1st SideDef with the same Normal texture that the wall started with,
no upper or lower textures, and be a part of Sector #0.  The LineDefs 
should not have a 2nd SideDef (you'll never see the other side of the
wall, so why bother?)

Now select one (JUST one) of the east-wall Lines, and we'll turn it
into a switch that opens our door.  Hit Enter to modify the Line,
and choose 1 - Edit the LineDef.  Then choose 2 - Change Type, and
2 - Doors.  From the list of door types, pick 5 - SR Open door (closes
after 5 seconds).  This turns the Line into a repeating switch that
opens a door, which will then close after 5 seconds.  How does the
Line know which door to open?  Good question, grasshopper!

With that same Line selected hit the Enter key to modify the Line,
then choose 1 - Edit the LineDef.  Choose 3 - Change Sector tag, and
enter a decimal value of 37.  Why 37?  Because I happen to be 37
years old, that's why.  You see, it really doesn't matter what number
goes here, all that matters is that whatever Sector you want the Line 
to trigger has the same number for it's LineDef tag.

After you've entered the Sector tag number, hit the "S" key to get 
into Sector mode.  Select the Sector that has our door in it (#1).
Hit the Enter key to edit the Sector, and choose 7 - Change LineDef
tag.  Enter in the number (you guessed it) 37.  Now this Sector will
be activated by any switch that has a Sector tag of 37.  It is possible
for a switch to activate more than one Sector, and for a Sector to
be activated by more than one switch.  Notice that, while in Line mode,
if you DON'T have the switch Line selected, it shows up on your screen
in purple.  When you DO have the switch Line selected, the Sector it
activates shows up on your screen in red.  Cool, huh?  In Sector mode,
selecting a Sector that has a valid LineDef tag lights up the Line
that activates it, in red.  An unselected Sector with a valid LineDef
shows up in green.











																			  Part 3 - Page 2

Let's add a distinctive texture to our switch Line, so we know where
the switch is.  In Line mode, select the Line, and hit Enter to modify it.
Choose 2 - Edit the 1st SideDef.  Choose 1 - Edit Normal Texture.  Pick
one of the switch textures, SW1STRTN matches the STARTAN texture our Lines
started with.  To make the Line fit the size of the texture, go into Vertex
mode (the "V" key) and adjust the two Vertices of our switch Line to
be 64 units apart.

So, now we have a switch that opens our door.  The door can also be
opened by walking up to it and pressing the spacebar.  Now let's add
a tripwire that opens the door.  "What's a tripwire?", you may ask.
Well, remember back in E1M1, when you went past those two pylon light
pole thingies just before the exit room, and then when you went back
into the zig-zag slime pool room you noticed one of the walls
had dropped to reveal a secret tunnel leading to an alcove with a
shotgun?  The wall that dropped was activated by a tripwire.  (The
pylons had nothing to do with it, they're just there as a visual clue).
The tripwire in this case is a Line with LineDef flags of 2S (two sided)
and Up (the upper texture is unpegged), and has a LineDef type of 
W1 Lower Floor >N (walking across the Line lowers the floor to it's 
nearest neighbor's level), and a Sector tag of 1, which matches the
LineDef tag of Sector #59 (the Sector that drops).  It has both a 
1st SideDef and a 2nd SideDef (all 2S lines MUST have both), but 
neither one has a normal texture assigned, making the Line invisible
at ground level.  Got it?  Good!

Before we add in the tripwire Line, let's make a few new Vertices in our
lower room (Sector #0).  In Line mode, select the west wall Line, and 
split it into four sections, just like we did with the east wall Line.
Then, in Vertex mode, select the Vertice on each Line that is just
below the north edge of the room.  Hit the Insert key to add a Line
between those vertices.  Go to Vertex mode, and the screen should be 
something like Figure 1 of the PCX file included with this lesson.

In Line mode, select the new Line you just added.  Modify the Line to
give it only one flag - 2S, a LineDef Type of WR - Open Door, and Sector tag
of 37 (there's that number again!).  Make sure that it has both a 1st
SideDef and a 2nd SideDef, but no textures assigned to either one.
You should also make the 1st and 2nd SideDef sector references Sector #0.

So now we have three ways to open our door - pushing the door itself,
throwing the switch on the wall, or walking over the tripwire.  Now
would be a good time to load our level into DOOM and give these three
techniques a workout.  When you get back, we'll tackle movable Sectors.

Okay, once you are back in DEU, with our level loaded in and ready to
edit, get into Line mode and put the mouse cursor in the lower left
corner of our southern room.  Hit the "F9" key to insert an object inside
the room.  Choose a rectangular object, with a width and height of 64.
Then, with all four of our new Lines marked, hit the Insert key to
make a new Sector.  Modify the Sector to give it a floor height of
64, and ceiling height of 128.  Give the Sector a LineDef tag of 50.
Mark all four of the Lines again, and give them 1st SideDef lower textures.
Don't give them upper or normal textures, or any 2nd SideDef textures at all.
Figure 2 shows this new Sector added to our room.

Now select the Line on the east wall that contains the switch we used
to open the door.  Change the Sector tag on this Line to 50, to match
the Sector #3 LineDef tag.  Edit the LineDef, change the Type, pick
Floors... and then choose 1 - S? Lower floor to match Ne. floor.  Plop
a chainsaw Thing on top of our newest Sector, and try the level out!

																 

																			  Part 3 - Page 3

When you are done playing with the chainsaw, get back into DEU, and 
we'll add an "elevator" type Sector to our level.  Move the cursor to
the middle of the upper room (Sector #2), and hit F9.  Choose rectangle,
and make the dimensions 64 by 64.  Hit the Insert key to make the Lines
into a new Sector.  Give the Sector a floor height of 64, and a ceiling
height of 128.  Give it a LineDef tag of 60.  Mark each of the Lines
in this Sector, and give them a LineDef type of WR Lower Lift, a Sector 
tag of 60, and a 1st SideDef lower texture.

This makes the Sector a lift that lowers when the player walks off it.
Of course, the lift starts off raised, so let's add something to lower 
the lift when the player walks through the doorway.  We *could* just run
a tripwire across two of the northern Sector Vertices, but adding Lines
to Sectors can get kind of tricky.  A much easier way to lower the lift
is to add a "trigger plate" Sector.  Position the cursor just above the
doorway into the northern room, hit F9, choose rectangle, and use a
width of 100 and a height of 10.  Hit the Insert key to make the lines
into a Sector.  Make the Sector 128 in height.  Give the LineDefs a Type 
of WR - Lower lift, and a Sector tag of 60.  Make sure the LineDefs are 2S, 
and have a 1st and 2nd SideDef with no textures.  This Sector is our trigger 
plate.  When the player walks over the plate, the lift will lower.  As 
the player leaves the lift, it will lower again.  See Figure 3 for this.

You may have noticed that there are quite a few different types of
floor, ceiling, and lift options.  Experiment with these for a while,
and you'll get a feel for when and where a moving Sector will add just
the right flavor to your own personal DOOM levels.  Have fun!

Blackfist (a.k.a. Rich Dersheimer)
CIS 72123,1521

Soon to come: Part 4 - Pits, Windows, and Stairs.

A Note On Adding Lines To Sectors:
Adding Lines to Sectors can be a very tricky process, 'cause DEU sometimes
forgets which sectors are available.  There are some techniques that can
be helpful with this - when you want to delete an area, try deleting the
Sector, the Lines, and the Vertices.  If you just delete the Vertices, sure
the Lines and Sector go away, but I don't think DEU completely deletes them.
Also, try to keep your Sectors as single enclosed box-type areas.  I know
the tripwire we put in the south room works, but it's much more elegant
to divide the room into two Sectors.  You end up with lots of Sectors,
but in the long run the level is much easier to work with.  Of course,
this means that you actually have to PLAN out the level in advance, instead
of "building on the fly", but the end result is worth it.  I've taken to
designing a level in a paint program, printing it out, and working from
the paper map.  This saves MUCH time that I used to spend fiddling with
SideDef sector designations.  Also, please realize that the authors of
DEU, Raphael Quinet and Brendon Wyber, have placed question marks, or
the word "unknown" on several of the pick lists in DEU's menus.  One can
assume that they are not 100% sure of how *everything* works in DOOM, but
have done their best to describe how the program functions.  So, if your
LineDefs aren't doing exactly what you expect, keep experimenting, and
if you find something new, let the DOOM DEU-ers of the world hear about it!

DOOM is a trademark of, and is Copyright (c) 1993, by id Software, Inc.




