Object - Operational Turret



This tutorial is designed to show how create an operational turret. It is best that you have section 4 of the ADVANCED.TXT handy while going over this turtorial. To view this map in Shadow Warrior download turop.zip.




Fig 1. Turret object sector.

1. First, create the sector that you plan to place your turret sector in. Next, create the outer most part of the turret (object) sector using the space bar. Place the cursor inside this sector and press the Alt-S keys and the lines will turn red. This I call the object sector. Before you create any sectors within the object sector it is a good habit to tag one of the walls of this wall loop first (section 4.1.1). with a LoTag of 504. Make sure that you place the cursor on the outside of the wall (see fig. 1). Note: any wall of the main object sector will work, but tag only one wall. Go into 3D mode and raise this sector up 8 PgUps.


Fig 2. Creating the gun base sector.

2. In 2D mode, create the gun base sector using the space bar then the Alt-S keys(fig. 2). The front of the turret will face to the north (towards the top of the picture).


Fig 3. Player area.

3. Using the space bar create the sector the player will operate the turret from. When you have connect the last vertice the lines should turn red. In 3D mode, raise the gun base sector 2 PgUps, and lower the player area 8 PgDns (the original ground level). You can now change the textures to what you want. I used picnums 754 for the outside, 8 for the inside, 4970 for the control panels, 2793 for the back side of the gun base, 398 for the front side of the gun base, and 2791 for the back of the gun base. For the top (floor textures) of the turret I used 754 for the outer sector, 2790 for the top of the gun base, and 4733 for the floor player area. All of these floor textures MUST be flagged in 3D mode using the R key and the E key if desired (I use it). Also, the gun base floor texture may have to be flipped using the F key. If you do not use the R key on the floor textures of the turret, the floor textures will not move with the turret.


Fig 4. Tagging the player sector.

4. You need to tag the player sector. In 2D mode place the cursor inside the player sector (fig. 4) and press H and enter 97. Now, press T and enter 501 (for our first sector object).


Fig 5. Insert the gun barrel sprites.

5. In 2D mode, insert two barrel sprites and change the angle to face to the right. Go into 3D mode and place the cursor on one (picnum 764) and press B, R, and H. This will set the Flags to 11 for the sprite. Now, do the same to the other barrel sprite.


Fig 6. Inserting ST1 sprites.

6. Insert a ST1 sprite at the very end of each gun barrel sprite, and give them a HiTag of 62 (SHOOT_POINT). Point the angle towards the front, and give TAG5, TAG6, and BOOL1 a value of 0 (zero). TAG3 = 1 is for a machine gun, and can be given another value if you want to (see HiTag 62 in the SPRITAGS.TXT file). We need to insert four key ST1 sprites into the player object sector (the one that we tagged in step 4 above). If you place these ST1 sprites in a non-tagged sector the sprite(s) will have no effect. Give the first ST1 spirte a HiTag of 1 (SECT_OPERATIONAL). Give the second ST1 sprite a HiTag of 16 (SO_ANGLE) and point the angle towards the front. The third ST1 sprite is given a HiTag of 76 (SO_MAX_DAMAGE) and a LoTag value for it's health (I gave it 200). Also, set TAG3 and TAG5 to 0 (zero), and point the angle towards the front. This sprite is for the amount of damage it can take (200 in our case) from an exploding type weapon before it breaks down. We will add a spawn sprite shortly to show that it is broken. The forth ST1 sprite has a HiTag of 134 (SOUND_SPOT) and your next match tag value 1 for our map (first match tag). Give TAG4 = 152, TAG5 = 154, and BOOL2 = 1 (very important). The next ST1 sprite gets a HiTag of 69 (SPAWN_SPOT) and a LoTag of 2 (next match tag for map). Set TAG3 and TAG6 to 3 for smoke to appear on the turret when it becomes broken.

Ok, we need to insert two more ST1 sprites to create what is known as the Bounding Box (section 4.1.2 of the ADVANCED.TXT). This is an "imaginary rectangle" that must be large enough to contain the entire outer wall loop plus the sprites that will move with the sector object (the gun barrels and SHOOT_POINT sprites in our case). The first ST1 sprite is given a HiTag of 500 (BOUND_SO_UPPER) since it is our first sector object on the map. It is placed to the upper left of the sector object. The second ST1 sprite is given a HiTag of 501 (BOUND_SO_LOWER). You will note that this is and MUST be the same value of the LoTag given to the turret object sector in step 4 above. This sprite is placed to the lower right of the sector object. Remember, this imaginary rectangle must contain the entire outer wall loop PLUS the gun barrels and SHOOT_POINT sprites. Insert another ST1 sprite for a SOUND_SPOT (HiTag 134) somewhere within the Bounding Box (I placed it in the upper right). Give it the same match tag that you gave to the SPAWN_SPOT sprite (2 in our case). Now, give TAG4 a value of 276 (hissing sound) and BOOL2 a value of 1 (important).




Back to my Shadow Warrior site.