Dynamic Lighting - Torch



This tutorial is designed to show how create a torch with a lighting effect. To view this map in Shadow Warrior download torch.zip This tutorial was written by Starman any questions you may have should be directed to him.




Fig 1. Shading the walls of the main sector.

1. First create the sector where you want your torch to go using the spacebar. The height of this sector whatever height suits you and apply some kind of texture to the walls and ceiling. The completed sector should look something like the one in Fig 1. Notice how the walls are shaded differently? To create a realistic effect, correct shading is important. Use the numeric keypad - key (3D mode) to darken one of your walls, then hit Shift CTRL Enter. This should shade it for you correctly.


Fig 2. Insert vertices.

2. In 2D mode, Insert 2 vertices as shown (Fig 2.) above in one corner of your sector using the Insert key.


Fig 3. Creating another sector.

3. Connect the two vertices using the spacebar. The lines will turn red as shown in Fig 3.


Fig 4. Darken the Back sector floor.

4. In 3D mode raise the level of your split (child) sector a couple of page-ups. You can also lower the ceiling here if you desire. There are several different ways to do this.....I am just showing you one of the easiest. When completed the sector should look like the illustration above. Use the plus or minus keys on the numeric keypad to shade this split sector to be lighter than the walls of the main sector.


Fig 5. Inserting the torch sprite.

5. Now we are ready to insert our torch sprite. Place the cursor on the spot where you want your sprite to go and hit the "S" key. Usually a gray texture will appear. Then hit the "V" key twice. Then hit the "G" key and type 430 and hit enter. There are other torch sprites available but picnum 430 is the one I used here.


Fig 6. Inserting a ST1 sprite.

6. Inserting the ST1 sprites and tagging them properly. I am going to assume here that you know what an ST1 sprite is. For those of you that don't it is picnum 2307. Insert an ST1 sprite at the base of the torch sprite and give it the following tags. Hi-tag should be 69 (SPAWN_SPOT), Low-tag should be your next match tag....hit F5 from 2D mode to see what your next match tag is. Tag 3 should be 12, Tag 4 should be 1536, Tag 5 should be 12. When you are done tagging this sprite from 2D mode it should look something like Fig 6. in 3D mode.


Fig 7. Raising the ST1 sprite.

7. Now we need to raise this sprite up to the level of the torch. Use the PgUp key to get this done. When finished it should look something like Fig 7.


Fig 8. Tagging the torch and adding a ST1 sprite.

8. Next place the cursor on the torch sprite itself and give it the following tags. Note: this can be done from either 3D or 2D mode. Hit Alt-H from 2D mode for Hi-Tag and Alt-T for Low-Tag. From 3D mode it is '1 for Hi-Tag and '2 for low tag and so on. The torch gets Hi-Tag which is your next match tag and a Low-Tag of 257 (TAG_SPRITE_HIT_MATCH). Tag 3 should be 32, Tag 4 should be 1536, Tag 5 should be 0, Tag 7 should be 3, And Tag 8 should be 2. Next we need to insert one more ST1 sprite at the base of our torch and give it the following tags. Hi-Tag should be 108, Low-Tag should be the same as the Hi-Tag we just gave our torch sprite. Tag 3 should be 2, Tag 4 should be 8, Tag 5 should be 20, Tag 7 should be 1, And Bool1 should be 1. The map should now look something like the Fig 8. in 3D mode.

9. Okay, we now need only one more sprite to complete our map. Insert one more ST1 sprite somewhere in our main sector and give it the following tags. Hi-Tag should be 109 (LIGHTING_DIFFUSE), Low-Tag should be the same as the Hi-Tag we gave our torch sprite, Tag 3 should be 2, Tag 4 can be either 2,4,or 6 depending on the speed and intensity of the effect you desire. Tag 5 should be 20 and you are done. Seems like alot to do to get the walls to flicker with your torch but the rewards in realism in your maps are well worth it.




Back to my Shadow Warrior site.