Transparent Smashable Glass - How?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Transparent Smashable Glass - How?

Post by CaptainToenail »

I want some smashable glass in my map. I want a bit where there is a corridor with glass tubes along the sides containing inactive monsters. When a certain line is reached, the glass smashes, and the monsters come out and get you.

I'm guessing it's a combination of texture, blocking line, sound and activate scripts.

Can anyone tell me how to do it for certain?
User avatar
Enjay
 
 
Posts: 27058
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Transparent Smashable Glass - How?

Post by Enjay »

CaptainToenail wrote:I'm guessing it's a combination of texture, blocking line, sound and activate scripts.

Can anyone tell me how to do it for certain?
I can do better than that. I can make you a quick example...

http://www.zen64060.zen.co.uk/smash02.zip

The above is an edited version of my smashable mirror example from my examples site. Shoot the mirror to smash it and flick the switch to release the imp. If I was making this from scratch, I'd make a better DECORATE glass shard item but this map is based on an old example and uses one of the Hexen glass shards instead.

Use what you like from it. :biggrin:
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Post by CaptainToenail »

Wow, thanks, that's great, although I was hoping for something a bit simpler.
User avatar
Enjay
 
 
Posts: 27058
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Well, script 3 is the one that does the smashing of the imp chamber. If you don't want to spawn any glass shards it would be a lot simpler looking.

Code: Select all

script 3 (void)
{
		Sector_SetColor(1, 255, 255, 255);
		Thing_Deactivate (4);
		thingsound(2, "glass", 127);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "njsmsh01");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "njsmsh01");
		delay(const:4);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "njsmsh02");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "njsmsh02");
		delay(const:4);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "njsmsh03");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "njsmsh03");
		delay(const:4);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "njsmsh04");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "njsmsh04");
		delay(const:4);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "-");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "-");
		Setlineblocking(103,OFF);
		Thing_Activate (3);
}
Removing the animated smashing glass effect would simplify it further:

Code: Select all

script 3 (void)
{
		Sector_SetColor(1, 255, 255, 255);
		Thing_Deactivate (4);
		thingsound(2, "glass", 127);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "-");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "-");
		Setlineblocking(103,OFF);
		Thing_Activate (3);
}
And removing additonal effects like sector colour and the fountain boils it down to - play a sound, remove the glass texture, unblock the lines and activate the imp

Code: Select all

script 3 (void)
{
		thingsound(2, "glass", 127);
		setlinetexture (103, SIDE_FRONT, TEXTURE_MIDDLE, "-");
		setlinetexture (103, SIDE_BACK, TEXTURE_MIDDLE, "-");
		Setlineblocking(103,OFF);
		Thing_Activate (3);
}
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Post by CaptainToenail »

Excellent! Thanks!

Edit: I can't get this thing to work. Can't I use a built in command from Strife or something?
User avatar
Enjay
 
 
Posts: 27058
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

I don't *think* you can activate Strife smashing glass remotely and you wouldn't be able to build in any additional effects, like activating the monsters in your tubes.

What kind of difficulties are you having getting it working (ie what happens (or doesn't happen) any error messages when compiling the script or playing the game etc)? Is it possible for you to post your map - or a section of it - and your script for people to look at and try to figure out what is wrong?
Karate Chris
Posts: 307
Joined: Wed Aug 23, 2006 7:58 am

Post by Karate Chris »

When I shoot the mirror with the BFG9000 it does not seem to break.
User avatar
Enjay
 
 
Posts: 27058
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Same here. Don't know why. :?
User avatar
Kappes Buur
 
 
Posts: 4180
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Transparent Smashable Glass - How?

Post by Kappes Buur »

CaptainToenail wrote:I want some smashable glass in my map. ...
Over the years I have played many levels with smashable glass, with more or less success.
The most memorable levels are GOKSCRIB.WAD by an unknown author. Another interesting
aspect of this level is the skewed entrance when slopes were not even thought of. And the
other level is CSCASTLE.WAD by our very own Biff. I believe that this is one of the top levels
in anyone's DM arsenal.
Locked

Return to “Editing (Archive)”