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.

Shootable switch only activate on hitting lower?

Postby Enjay » Mon Mar 23, 2020 3:58 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Shootable switch only activate on hitting lower?

Postby axredneck » Mon Mar 23, 2020 4:50 pm

Make the switch a separate sector/linedef.
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Shootable switch only activate on hitting lower?

Postby Enjay » Mon Mar 23, 2020 5:31 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Shootable switch only activate on hitting lower?

Postby axredneck » Mon Mar 23, 2020 5:47 pm

Then maybe it's a bug of GZDoom
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Shootable switch only activate on hitting lower?

Postby Enjay » Mon Mar 23, 2020 5:50 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Shootable switch only activate on hitting lower?

Postby Gez » Mon Mar 23, 2020 5:52 pm

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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Shootable switch only activate on hitting lower?

Postby Enjay » Mon Mar 23, 2020 5:55 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Shootable switch only activate on hitting lower?

Postby Matt » Wed Mar 25, 2020 2:19 pm

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
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Shootable switch only activate on hitting lower?

Postby Enjay » Wed Mar 25, 2020 2:45 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Shootable switch only activate on hitting lower?

Postby Apeirogon » Wed Mar 25, 2020 3:50 pm

There are also world line (pre)activated event which can do this (check height from floor to actor-activator).
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Shootable switch only activate on hitting lower?

Postby Matt » Thu Mar 26, 2020 5:41 pm

tired: replying after failing to read the entire post

inspired: independent verification
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Shootable switch only activate on hitting lower?

Postby Nash » Fri Mar 27, 2020 12:27 am

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Shootable switch only activate on hitting lower?

Postby Enjay » Fri Mar 27, 2020 3:30 am

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
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest