ASK ME ABOUT FOOTBALL / STEAM / DEAD CELEBRITIES / THE BLAIR WITCH PROJECT
In your other thread, you mentioned sliding doors. Assuming that means you are using Zdoom in ZdoomHexen mode, you can create a totally impassible, tranlucent line using a simple open script.
Just make the line that you want to be your window (a 2 sided lindef) a type 121 (a line identify type line) and give it a line ID as its first argument.
Then use the following in an open script:
This sets Line 100 to block everything (duh). That means it also blocks projectiles and bullet type shots, unlike the normal impassible flag which lets those things through.
The TranlucentLine statement gives the line a tranlucency of 96, which can make something like shawn2 look quite window like, but I recommend using your own texture.
If you do it this way, you can also set the line to be a projectile activated type and use the open script to set the line to run a script. That second script can then be used to "smash" the window by playing a sound that you have defined in SNDINFO, changing the texture to one that looks like a broken window and removing the blocking attribute of the line.
Something like this would appear in your open script:
setlinespecial(100, 80, 1, 0, 0, 0, 0);
That makes line 100 a type 80 (run a script) and tells it to run script 1.
Then your window smashing script would be something like this:
script 1 (void)
SetLineSpecial(100,0,0,0,0,0); //Removes line special type
thingsound(100, "glass", 127); //makes the sound glass at map spot with tid 100
Setlineblocking(100,off); //Stops line 100 blocking things
setlinetexture(100, SIDE_FRONT, TEXTURE_MIDDLE, "SW2NJ33"); //Makes the front side look broken
setlinetexture(100, SIDE_BACK, TEXTURE_MIDDLE, "SW2NJ33"); //makes the back look broken
The SNDINFO entry to define the glass sound would look something like this:
GLASS DSGLASS //Glass smashing
I think that should work anyway. I'm no scripting expert, but that was cut and pasted from one of my own levels and it works there.
Oh, BTW, SW2NJ33 is just the name of a texture I used that looks like a broken window.