Swinging Doors



This is the basic tutorial to teach you how create swinging doors connected to a fence. So, when you open the doors they will swing open. Though you do not need to make it this way. Rather, you can just have your swinging door(s) in a archway like the other doors. I just decided to do it this way. To view this map in Shadow Warrior download door5.zip




Fig 1. 2D mode of sector.

1. Create a large sector (2D mode numeric Enter toggles). The doors will be 10 default grid squares each (20 for two doors). Make sure to have enough on each side of the doors for the fence. You can make everything smaller if you want. Make the height of this sector 240 pixels high. This is done in 3D mode by placing the cursor on the ceiling and holding the left mouse button down as you press PgUp. Go to 2D mode and hit the Tab key (with the cursor in the sector you are checking) and the height of the sector is displayed in the lower left of your screen. You can now add any textures you want for the walls, ceiling, and floor.


Fig 2. Peninsula sector.

2. Insert two vertices on the north (top) wall two grid squares apart (2D mode). This is done by placing the cursor on the wall and press the Insert key. Now, place the cursor on one of the vertice you created and hit the Space Bar. Bring the cursor straight down the length you want this side of the fence to be and hit Space Bar. Move the cursor over to line up with the other vertice on the north wall and hit the Space Bar. Finially, move the cursor to the vertice on the north wall and hit the Space Bar. The line you just drew should have now turned red. If you need the wall longer or shorter in length just place the cursor on the lower vertices (one at a time), hold down the left mouse button, and move it to it's new location.


Fig 3. 3D mode of peninsula sector.

3. Go to 3D mode (numeric pad Enter) and place the cursor on the floor where you think the new fence sector is. Press and hold the left mouse button and hit PgUp. If you did not get the fence sector hit PgDn, release the mouse button, and try again. Raise the sector so it's height is 100 pixels high (This is the height from the ceiling to the top of the fence). Change the fence texture to one you like. Now, create the second fence sector to the south of this one. I left 20 grid squares for the doors between the two fence sectors.


Fig 4. Creating island sectors.

4. Go to 2D mode (numeric pad Enter) and create two rectangles (as shown) using the Space Bar. We do not want them connected to the fence sectors. These two rectangles will appear as impassable pillars in 3D mode.


Fig 5. Creating island sectors.

5. Place the cursor inside one of the white rectanglar box we created and hit Alt-S. The white lines now turn to red and we have created a sector inside a sector. Go ahead and do the same to the other one. Go to 3D mode and raise these two sectors as we did in step 3 above. Their height should be 112 pixels high.


Fig 6. Positioning island sectors.

6. Go to 2D mode and move the vertices of the two sectors (our doors) as shown. We do not want our doors to be connected to any other sectors. This is why we create them separate from the other sectors and then move the vertices over to the other sectors. The doors will open towards the east while rotating on the pivot vertices. The northern door will rotate counter clockwise and the southern door will rotate clockwise. The door sectors do not have to touch the other sectors as I have done. You can leave a tiny space between them, and is the best way to do it if the player(s) will be able to see the top of the doors. This is our plan so let's set it up with the ST1 sprites (picnum 2307).


Fig 7. Adding ST1 sprites.

7. Time to insert the ST1 sprites (picnum 2307). Go to 2D mode press "G" to go the smaller grid squares. Insert a ST1 sprite (hit "S")on each of the pivot vertices. Give these sprites a HiTag (Alt-H) of 144 (SECT_ROTATOR_PIVOT) and a LowTag (Alt-T) of 1 (our first match tag for this map). Insert a ST1 sprite inside each door sector. Give these sprites a HiTag of 143 (SECT_ROTATOR) and a LowTag of 1 (match tag). Insert a ST1 sprite somewhere by or on a door (for sound), and give it a HiTag of 134 (SOUND_SPOT) and a LowTag of 1 (our match tag for these doors).

8. Referring to the SPRITAGS.TXT file go to Hitag 143 (SECT_ROTATOR). Place the cursor on one of the ST1 sprite in 2D mode with this HiTag. There are TAG# and BOOL# numbers that need to address for your door to work at all. This you can see in the SPRITAGS.TXT. To change the values of TAG# place the mouse cursor on the sprite (2D mode). Next, you press and hold the ' (under the ") key and the number you need to address. To change TAG3, press ' and 3 then enter the value and press Enter.

Ok, now for the BOOL#. To enter a BOOL# you need to press ; and number. The number can only be a 1 or 0 nothing else.

No BOOL# needs to be changed for these doors.



Fig 8. 3D view.

9. All that you need to do now is just add the textures and shading (+ and - numeric pad keys) you want. Picnum 132 is a good one for this door. Use the numeric pad to stretch or shrink any tiles (2, 4, 6, and 8). To move (realign) a tile (picnum)use the Shift key and (2, 4, 6, and 8). If you want to copy a sprite, wall, ceiling, or floor texture just place the cursor on it in 3D mode and hit the TAB key. Now, when insert a new sprite, or point at the texture you want to change and hit Enter the copied sprite/texture will appear.




Back to my Shadow Warrior site.