Adding music and sound effects to your levels is fairly easy. This tutorial will explain the three main ways the MUSICANDSFX sprite is used to add music and effects to your Duke Nukem 3D maps!
Note: This tutorial does not contain any screenshots. Using the MUSICANDSFX sprite is more of a technique than a visual "how-to". See my Common Questions Page to download a list of the sounds available to use.
To add a sound effect to an effect you've created (such as a door opening or a sector rising), simply put a MUSICANDSFX sprite in the sector that contains the LOTAG function. In other words, place the sprite in the actual sector that is moving/being effected. For a basic door, place the sprite in the door sector. For a door with a switch, you would also place the MUSICANDSFX sprite in the door sector (not the sector where the switch is).
Now, using the sound effects list, set the LOTAG of the MUSICANDSFX sprite to the sound number you want played when the sector effect is triggered. That's all there is to it. Very easy!
This is a common question! Adding bar music and other "ambient" sounds is quite easy. First, place the MUSICANDSFX sprite in the area where you want the sound. However, don't place it in a sector that has a LOTAG function. Otherwise, you'll be setting up a sound effect as explained above. Second, set the sprites LOTAG to the sound value of your ambient sound (such as 95 for the bar music). Now, set the HITAG equal to the distance you want the sound to be heard. "How far is that?!", you ask. Read on...
When editing in BUILD, hit 'G' until the grid is turned off. Now hit 'G' one more time so the grid is on it's largest setting. One of the sized squares is equal to 1024 units of "sound distance". If you had a MUSICANDSFX sprite in the middle of one of those grid squares and set the HITAG to 1024, you would only hear the music when inside that square. Set the HITAG to 2048 and you now have sound that reaches out one more square all around the original square. The best way to see how this works is to try it in one of your maps. Play around with different HITAG values so your "room" is properly filled with the ambient sound.
The echo effect adds some nice realism to the right area of a map. Creating the echo is very easy. As with an ambient sound, you must first place the MUSICANDSFX sprite in a sector with no LOTAG function. Next, set the LOTAG equal to 1000 + amount_of_echo (from 0 to 255). If you want maximum echo, set the LOTAG to 1255. If you want minial echo, try 1080. If you want a medium echo, try the middle (1128). Finally, set the HITAG equal to the distance you want the echo effect to have. See the above description under ambient sound to see how far the value should be.
This page will change as warranted by your comments, so please let me know if this helped you!
Patrick Steele
pjsteele@home.com
Copyright © 1996, Patrick J. Steele, Last Updated -
07/12/11 02:41 AM