Shootable switch only activate on hitting lower?
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.
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?
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?
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?
- 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?
Make the switch a separate sector/linedef.
Re: Shootable switch only activate on hitting lower?
I'm sorry, I'm not sure what you mean by that - or maybe I didn't explain properly. So, here's a picture:
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.
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.
- 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?
Then maybe it's a bug of GZDoom
Re: Shootable switch only activate on hitting lower?
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.
Re: Shootable switch only activate on hitting lower?
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.
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.
Re: Shootable switch only activate on hitting lower?
That explains why the switch height check didn't work, thanks.Gez wrote:the height check is only implemented for use
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.
- 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?
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...
Re: Shootable switch only activate on hitting lower?
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.
Re: Shootable switch only activate on hitting lower?
There are also world line (pre)activated event which can do this (check height from floor to actor-activator).
- 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?
tired: replying after failing to read the entire post
inspired: independent verification
inspired: independent verification
Re: Shootable switch only activate on hitting lower?
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.
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.
Re: Shootable switch only activate on hitting lower?
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
Some UDB support and proper documentation would really help