First off, you should download this zip folder containing shard sprites, or you can use your own or something. I'd use these though, since they work best for most kinds of windows. Anyways, after you added the sprites, find a window texture you want/like. It's important to use a fitting window depending on the theme of a map.
If you don't wanna spend a long time looking for the right texture, use this for now until you find another.
Anyways, let's get into the actually important stuff.
First off, you need to create a SNDINFO lump and ANIMDEFS lump, for a switch definition. Here's the code for both of those:
SNDINFO:
Code: Select all
glass/break DSGLASS
$limit glass/break 0
$pitchshift glass/break 3
$rolloff glass/break 1000 2000
Code: Select all
switch SDWINDOW
on sound glass/break
pic BKWINDOW tics 0
off
pic SDWINDOW tics 0
Put those into their proper lumps, then save and go into Doom Builder or something like that.
Now, you need to create a line and make it impassible. After that, give it the window texture. Now, give it action 49 and make it triggered when a projectile passes and on projectile impact. After that, go into the map and it should work like a whistle!
If you need an example, here's one to use.