Door Linked to a Gong



This is the basic tutorial to teach you how to link a Gong to a door. So, when you shoot a gong it will open a door. To view this map in Shadow Warrior download doorgong.zip



1. Create your door. We will use the door that we created in door1.map (Ceiling to Floor Door). You will recall our match tag for this door was 1. I did change the speed of the door TAG4 to 80 (HiTag 92) and the sound TAG4 to 168 (HiTag 134).


Fig 1. Inserting a switch sprite.

2. We need to make a switch on the other side of the door so the player can open it to get back to the gong side of the doorway. Go to 3D mode (numeric pad Enter key toggles) and point the mouse cursor on the wall where you want the switch. Press "S" to insert the sprite. If the sprite for the switch you want to use did not appear point at the sprite and press "V" twice. The sprites for the switches are tiles (picnums) 551-584. Press "G" and enter 574 for our switch and press Enter to go to this sprite tile (picnum). Now press Enter and the sprite appears on the wall. You can click and hold on the sprite with the left mouse button and use the PgUp and PgDn keys to position the sprite's height on the wall. Release the mouse button when you are done. Since we assigned BOOL1 = 1 to our SECT_VATOR when we created our door in door1.map we must use the second switch tile (picnum) for the switch (trust me). Give the switch sprite a HiTag the same value as your matched LoTag for the door (1 in our case). Insert a ST1 sprite close to the switch and give it a HiTag of 134 (SOUND_SPOT) and a LoTag of the match door LoTag (1 in our case). Give the SOUND_SPOT a TAG4 value of 201 (switch sound). Note: you will hear this switch sound when you shoot the gong. So, you may opt not to put in this SOUND_SPOT for the switch.


Fig 2. Inserting the gong sprites.

3. We need to put two gong sprites (picnum 273) back to back. Give them a LoTag of 257 (TAG_SPRITE_HIT_MATCH section 3.2 of SPRITAGS.TXT) and point the angles in the opposite direction of each other (in our case one point west and the other pointing east). Give them both a LoTag of 2 (or your next match tag value). Give one a flag value of 151 (B, R, 1, H), and the other a flag value of 155 (B, F, R, 1, H). If your flag value is too high hit H again. Give each of the TAG_SPRITE_HIT_MATCH (gong) sprites the following TAGS:

Place a ST1 (SOUND_SPOT) by the gong and give it a LoTag of 2 and a TAG4 value of 190 (gong sound).


Fig 3. Creating a trigger sector.

4. Ok, let's tie everything together. Make a small sector outside the play area (a place the player can not get to). Insert a ST1 sprite into this sector and give it a HiTag of 92 (SECT_VATOR) and a LoTag of 2 (the match tag of the gong). This sector will be treated as a ceiling to floor door so you need to flip the ST1 sprite. Place the cursor on this ST1 sprite and press F twice. No sound is given to this trigger sector. Give the following values to this ST1 sprite.

We needed to put in the trigger sector because of the sound match tags. We do not want to hear the sound of the gong when the switch is thrown, but rather the door sound. This is why the gong sound has a different match tag than our door.




Back to my Shadow Warrior site.