Shootable switch only activate on hitting lower?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Shootable switch only activate on hitting lower?

Post by Enjay »

Yup, that was a mess of a title!

Is there any way to make a shootable switch that only activates if the lower part of the sidedef is hit?

I have a small pedestal made from a sector that rises 32 units above the surrounding floor. On the lower side is a switch texture and the switch is partially obscured by a 3D floor above it. I want the player to be spot the cunningly hidden switch and be able to shoot it to find a secret. However, in normal combat, the player is quite likely to shoot at something, firing across (above) the 3D floor and this activates the switch too.

I have set the "Switch Height Check" flag in UDMF but that hasn't stopped the problem. So, can what I want be done?
User avatar
axredneck
Posts: 357
Joined: Mon Dec 11, 2017 2:09 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Arch
Graphics Processor: nVidia with Vulkan support
Location: Russia
Contact:

Re: Shootable switch only activate on hitting lower?

Post by axredneck »

Make the switch a separate sector/linedef.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Enjay »

I'm sorry, I'm not sure what you mean by that - or maybe I didn't explain properly. So, here's a picture:

Image

The red line on the front of the blue box is the activatable line. An observant player can spot the switch inside the black structure, fire through the gap and hit the switch (green arrow).

However, it is just as likely that the player will fire over the top of the black structure for whatever reason (purple arrow) and this will also activate the line with out the player perhaps even realising that there was a cunning hidden switch under there.


As a work-around, I've put a low HP very short actor in front of the switch that can be shot and when it dies, it runs a script. However, I'd still like to know if the original idea (lower wall activation only) is possible.
User avatar
axredneck
Posts: 357
Joined: Mon Dec 11, 2017 2:09 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Arch
Graphics Processor: nVidia with Vulkan support
Location: Russia
Contact:

Re: Shootable switch only activate on hitting lower?

Post by axredneck »

Then maybe it's a bug of GZDoom
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Enjay »

Nope, lines have always behaved like that. Go to map 18 of Doom 2, shoot the door to open it then shoot through the door - every time you do, you can hear the switch activate. It was like that in Doom2.exe I'm trying to find a way that does something different to that vanilla behaviour.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Shootable switch only activate on hitting lower?

Post by Gez »

No, it's not a bug, the height check is only implemented for use -- it's ignored for cross and impact activations.

A potential workaround if using portals. With a floor/ceiling portal, you can have the lower area be a technically separate part of the map, and so the line will only exist in the lower area, not in the upper one. Of course this solution may not be easy to integrate in an existing map.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Enjay »

Gez wrote:the height check is only implemented for use
That explains why the switch height check didn't work, thanks.

The portal idea is cunning but unnecessarily complex for the situation in my map. If the height check can't work, then my little invisible actor sitting in front of the switch will do the job just fine.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Matt »

The only way I can see this done is to have a scripted shootable actor in place of (or invisible and directly in front of) the switch...
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Enjay »

Yup. me too:
Enjay wrote:As a work-around, I've put a low HP very short actor in front of the switch that can be shot and when it dies, it runs a script.
;)
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Shootable switch only activate on hitting lower?

Post by Apeirogon »

There are also world line (pre)activated event which can do this (check height from floor to actor-activator).
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Matt »

tired: replying after failing to read the entire post

inspired: independent verification
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Nash »

I feel like ZZYZX's "destructible geometry" feature is exactly what this can solve, however, shortly after implementing it into GZDoom, he forgot to expose the editor to it... :P

This is a feature silently implemented into GZ a while back that basically gives lines and actors health values and callbacks (you are able to individually "damage" them, and they get to do things and call scripts, things like that). Unfortunately this is as far as I know; it really is an obscure (although mostly complete) feature.

I'll see what I can dig up later, if no one else beats me to it.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Shootable switch only activate on hitting lower?

Post by Enjay »

Oh yes, I know about that feature and have even pointed people to the demo file before. Its lack of uptake, possibly due to lack of editor support, means it's easy to forget about, despite it being a potentially very useful feature.

Some UDB support and proper documentation would really help
Post Reply

Return to “Mapping”