Destroyable windows - An easier way

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Post Reply
User avatar
enderkevin13
Posts: 1383
Joined: Tue Jul 07, 2015 7:30 am
Location: :noiƚɒɔo⅃

Destroyable windows - An easier way

Post by enderkevin13 »

Okay, so we all know that destroyable windows make any map neat, right? Yes, and that's what I wanna talk about. Up until now, I thought making destroyable windows had to be advanced, until Laser Pineapple here on the forums helped me out, and I don't want others to go through the same amount of trouble I did while trying to do it the hard way. Anyways, let's start.

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.
Shard sprites.zip
Download the sprites here.
(5.3 KiB) Downloaded 264 times
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.
Image

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
ANIMDEFS:

Code: Select all

switch SDWINDOW 
	on sound glass/break 
	pic BKWINDOW tics 0
	
	off
	pic SDWINDOW tics 0
What I suggest for the broken window texture is a blank one, but use whatever you want I guess.

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.
Breakable glass.wad
Example to use
(96.24 KiB) Downloaded 317 times
User avatar
protox
Posts: 39
Joined: Sat Mar 22, 2014 6:40 pm

Re: Destroyable windows - An easier way

Post by protox »

Very cool, thanks for sharing.
Post Reply

Return to “Tutorials”