Bypassing locked doors
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.
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.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Bypassing locked doors
I'm trying to develop a special item that works like a master key, to let the player use locked doors/buttons without having the actual key. I'm not sure what the cleanest way to achieve this is, though. The best method I've come up with so far is to create a new actor inheriting from Key, and then redefine every lock in LOCKDEFS to accept it. However, some maps may redefine locks themselves, and this can create a conflict that I can only solve with extra patch files. Kind of messy. Another thing to mention that may complicate this matter is that I have two versions of this master key; one permanent until the end of a level (like most keys), and one temporary.
I know there's no way to create new powerups, but in theory, a power that allows for bypassing locked doors, as if they were unlocked, would get me exactly where I want to be. Is that even worth suggesting, or is that just too far out there to consider?
Anyone have any other thoughts?
I know there's no way to create new powerups, but in theory, a power that allows for bypassing locked doors, as if they were unlocked, would get me exactly where I want to be. Is that even worth suggesting, or is that just too far out there to consider?
Anyone have any other thoughts?
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: Bypassing locked doors
Have those switches and doors locked at first by assigning the appropriate specials ([wiki]Door_LockedRaise[/wiki], for instance). Make the use of the master key "unlocks" them by changing their assigned specials at run-time using [wiki]SetLineSpecial[/wiki] to [wiki]Door_Raise[/wiki].
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Bypassing locked doors
So you're suggesting I remake every map, in order to make this work. That's... not exactly a reasonable solution...
Re: Bypassing locked doors
Would it spoil the feel you are trying to get if you just called it a "master key powerup" (or similar) but what it actually did was just give you all the keys? Perhaps if you wanted to hide things you could make a status bar that only drew the key icons if an item (also given by the powerup) was not in your inventory (if such a thing is possible). That wouldn't work for the alt-HUD though.
Of course, if you want the powerup to run out and the player to return to normal, that would complicate things but you might be able to keep a track of which keys the player had when the powerup was activated and then restore his key inventory to its previous state with a script.
Mind you, the powerup running out could end up trapping the player on the other side of a door that he no longer has a key for.
Of course, if you want the powerup to run out and the player to return to normal, that would complicate things but you might be able to keep a track of which keys the player had when the powerup was activated and then restore his key inventory to its previous state with a script.
Mind you, the powerup running out could end up trapping the player on the other side of a door that he no longer has a key for.

- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Bypassing locked doors
Giving all the keys can be tricky. If I did it with ACS, I would slap the player in the face with errors about keys that aren't available in the current session. If I had access to the algorithm that the console cheat or IDKFA cheat used, which seems cleaner... that would solve the one issue, but still make things troublesome for the temporary version. As for using scripts to track-and-restore, it would get incredibly messy, especially when you consider what might happen if the player picks up a legitimate key DURING the powerup.
What you said about the powerup running out is certainly true, but the way I intended to use it would be more of a toggle-based power than time-based.
What you said about the powerup running out is certainly true, but the way I intended to use it would be more of a toggle-based power than time-based.
Re: Bypassing locked doors
Oh, yes. I didn't think about that.Ed the Bat wrote:As for using scripts to track-and-restore, it would get incredibly messy, especially when you consider what might happen if the player picks up a legitimate key DURING the powerup.
- 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: Bypassing locked doors
What if you replaced each key with a custominventory item that gave 2 items, the key itself plus a flag to let the engine know the player "really" picked up a key, and on removal of the masterkey powerup it would check for the presence of the item and pass over that key if that item was present?Ed the Bat wrote:As for using scripts to track-and-restore, it would get incredibly messy, especially when you consider what might happen if the player picks up a legitimate key DURING the powerup.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Bypassing locked doors
I'd run into warnings for keys that aren't available natively inside the engine. I'd need to make separate patches for those instances to load only for maps/packs that use those keys, so then I'm no better off than I am now with my separately-loaded LOCKDEFS lumps that make my master key work on those locks. So... lateral move, at best. Plus, with two kinds of master key powerup, removing one with that method might remove the other when it shouldn't. Begets more problems...
Re: Bypassing locked doors
The thing with wanting to support maps not designed with this powerup in mind is that they are not designed with this powerup in mind, and level progression can get completely broken as a result. (Getting trapped after the powerup expires being one example; and there's also the Courtyard example where the exit is just by the player's start point but behind a locked door so you can just leave right away without even playing through the level.)
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Bypassing locked doors
Well this powerup was designed to be untimed. Surely you're familiar with powerups that last an indefinite length of time? Berserk, or maybe Computer Area Map, for instance?
Re: Bypassing locked doors
Why are you trying to create a powerup whose only purpose appears to be to break map progression if you're not making custom maps for the project?
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Bypassing locked doors
We never saw it as broken progression. That's like asking why anyone would want a flight powerup, or the high-jump powerup.
Re: Bypassing locked doors
If said powerups were being used in standard/non-mod maps, then those would be fair questions too. However, with the keys in particular there whole reason for existing is to shape the path and progression through the map. If you are bypassing them, why not just make a powerup that teleports you to the exit switch 

- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Bypassing locked doors
If my audience wanted it, then sure. From what I've seen, it seems that opening locked doors is the weaker link to their experience, so having the ability to hack into locked doors at the expense of combat downtime, action-movie style, seems to be well-received with them.
Re: Bypassing locked doors
The main big difference with such things is that they appear in maps that are designed for them. Someone makes a map and says "I'll put a flight powerup here". There is a fundamental difference between that and "but I'll have to make extra patches to put flight powerups in maps that define their own keys" if you get what I'm saying.
For example, I could buy a skeleton key powerup in some sort of RPG-ish mod where there are plenty of keys (like Strife, but worse) and progression through the adventure is limited by player stats and the need to level up before there is a reasonable chance of vanquishing the bosses. There, the keys serve more to open secret areas and explore stuff rather than to short-circuit through the game.
In normal Doom gameplay, though, as a powerup that would randomly replace the backpack or whatever, and which is supposed to be used in just about anything... It's completely different.
For example, I could buy a skeleton key powerup in some sort of RPG-ish mod where there are plenty of keys (like Strife, but worse) and progression through the adventure is limited by player stats and the need to level up before there is a reasonable chance of vanquishing the bosses. There, the keys serve more to open secret areas and explore stuff rather than to short-circuit through the game.
In normal Doom gameplay, though, as a powerup that would randomly replace the backpack or whatever, and which is supposed to be used in just about anything... It's completely different.