Lock 102 "That doesn't seem to work"

Ask about ACS, DECORATE, ZScript, or any other scripting questions 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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Enjay
 
 
Posts: 27055
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Lock 102 "That doesn't seem to work"

Post by Enjay »

While poking around in GZDoomBuilder and looking through LOCKDEFS lumps, I noticed that GZDB has the option to set key 102 on a locked door (listed as "Impossible" in the GZDB choices). When a line with that key value is used in game, the message "That doesn't seem to work" is printed to the screen (familiar from Strife).

Just out of interest, I've been poking around in gzdoom.pk3 to see if I can find where/how this "lock" is defined, but I can't see it anywhere. Does it exist in a LOCKDEFS-like format anywhere?

I know that the message is TXT_DOES_NOT_WORK and I also found this in the Strife xlat:

Code: Select all

165 = USE,		Door_LockedRaise (0, 0, 0, 102)
I also found this in a_keys.cpp

Code: Select all

	if (!lock) 
	{
		if (quiet) return false;
		if (keynum == 103 && (gameinfo.flags & GI_SHAREWARE))
			failtext = "$TXT_RETAIL_ONLY";
		else
			failtext = "$TXT_DOES_NOT_WORK";

		failsound = failage;
		numfailsounds = countof(failage);
	}
And that seems to be related but I can't find anything that looks like an actual lock definition. Does it exist? Could it be replicated somehow?




[Bonus Question]
I also notice that there are locks in LOCKDEFS that are basically repeats of each other (i.e. 129 and 132 (any red key), 130 and 133 (any blue key), 131 and 134 (any yellow key), 100 and 228 (any key)).

I assume that this is for historical reasons (different supported ports doing things differently) but does anyone know the exact reason?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lock 102 "That doesn't seem to work"

Post by Graf Zahl »

That message comes for any lock number that doesn't have a definition.

The duplications are indeed for historical reasons. The initial implementation was quite a hack job and used the seventh bit as a 'merge keys' flag, it never had multi-key logs properly defined. All that got only properly defined when LOCKDEFS came to be.

Many early ZDoom features weren't done for moddability but to represent the original feature set somehow and often went cheap with that - it was quite a bit of work to get these hard coded special cases out of the code and moved into user definable places.
User avatar
Enjay
 
 
Posts: 27055
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Lock 102 "That doesn't seem to work"

Post by Enjay »

Interesting that GZDB picks 102 and effectively makes that the "Impossible" key number, available "out of the box" for anyone trying to set that message.

Image



As I suspected about the historic reasons. Honestly, the more I find out about how much stuff had to be untangled to give us the modern, stable features that we now take for granted, I realise more and more what a monumental (and probably hugely frustrating at times) task it has been (and no doubt continues to be).

Thank you.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lock 102 "That doesn't seem to work"

Post by Graf Zahl »

It picks 102 because that's the documented number - or to be more precise, the one picked before LOCKDEFS.
User avatar
Enjay
 
 
Posts: 27055
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Lock 102 "That doesn't seem to work"

Post by Enjay »

Makes sense. Thanks again.
Post Reply

Return to “Scripting”