Bypassing locked doors

Archive of the old editing forum
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.
User avatar
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

Post by Ed the Bat »

Yeah, the idea itself is valid on its own, but not exactly compatible with what I'm aiming for.
User avatar
Mr. Tee
Posts: 1111
Joined: Sun Feb 08, 2004 7:49 pm
Contact:

Re: Bypassing locked doors

Post by Mr. Tee »

Enjay wrote:I'm not really sure why you are getting so aggravated. :?
Mr. Tee wrote:I'm typing this on my Crackberry which aggrivates me further that this topic normally would.
Everytime I pressed the return key on it the damn thing would load http://www.google.com for no reason. Very annoying (I'm only human after all, just like everyone else).

-------------------

As for the key thing, I may have found something, but not sure if it will work and I cannot test it on this computer. I apologize if something similar had already been suggested.

How about creating a SkeletonKey item in DECORATE that inherits from the Key actor, coupled with a LOCKDEFS lump whose first entry is "CLEARLOCKS", and which then redefines each original lock type to include the SkeletonKey, in the following manner:

LOCKDEFS Lump:

Code: Select all

CLEARLOCKS

Lock 1
{
	Any { RedCard SkeletonKey }
	Message "$PD_REDC"
	RemoteMessage "You need a red card to activate this object"
	Mapcolor 255 0  0
}

Lock 2
{
	Any { BlueCard SkeletonKey }
	Message "$PD_BLUEC"
	RemoteMessage "You need a red card to activate this object"
	Mapcolor 0 0 255
}

Lock 3
{
	Any { YellowCard SkeletonKey }
	Message "$PD_YELLOWC"
	RemoteMessage "You need a red card to activate this object"
	Mapcolor 255 255 0
}

Lock 4
{
	Any { RedSkullkey SkeletonKey }
	Message "$PD_REDK"
	RemoteMessage "You need a red card to activate this object"
	Mapcolor 255 0 0
}

etc...
DECORATE Lump:

Code: Select all

ACTOR SkeletonKey : Key
{
  Inventory.PickupMessage "You picked up a Skeleton Key!"
  Inventory.Icon "xxxx"
  States
  {
  Spawn:
    xxxx A 10
    xxxx B 10 Bright
    Loop
  }
}
http://zdoom.org/wiki/LOCKDEFS

http://zdoom.org/wiki/Key_types



EDIT: Fixed the code up a bit
Last edited by Mr. Tee on Thu Jan 31, 2013 1:01 pm, edited 1 time in total.
User avatar
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

Post by Ed the Bat »

Original Post:
Ed the Bat wrote: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.
That's exactly what I'm doing. The problem here is that if a map defines a new LOCKDEF, one will overwrite the other, so I have to cover that contingency with a specialized external patch for it.
User avatar
Mr. Tee
Posts: 1111
Joined: Sun Feb 08, 2004 7:49 pm
Contact:

Re: Bypassing locked doors

Post by Mr. Tee »

*facepalm for not rereading original post*

I see... And there is no way to concatenate multiple instances of LOCKDEFS, should a WAD already have one.

I wonder, would they really overwrite each other before being parsed by ZDoom? If ZDoom parses each lump as they are loaded, it's possible that the information won't be overwritten unless a WAD's LOCKDEFS lump already messed around with the original key locks...

Shoot, this is really tricky.


EDIT: I travel over 75% of my time for my job and thus am tired all the time (timezone changes, lack of sleep) , so please excuse some scattered ignorance on my part here and there.
User avatar
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

Post by Ed the Bat »

Mr. Tee wrote:I see... And there is no way to concatenate multiple instances of LOCKDEFS, should a WAD already have one.
The LOCKDEFS lump itself can have multiple instances, but locks are defined by numbers, and if any number should appear more than once, the last instance will take precedent over the others.
Mr. Tee wrote:I travel over 75% of my time for my job...
Say no more. We all understand how tough that can be on a person. I'm personally grateful that I can stay put for the things I need to do. Travel is not really in my blood...
Mr. Tee wrote:Shoot, this is really tricky.
Welcome to my world, fiddling around with things that people probably shouldn't be. :P
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49229
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Bypassing locked doors

Post by Graf Zahl »

Sorry to disappoint you, but hoping that add-ons that manipulate game data work with other mods modifying the same game data is futile.
It simply can't be done because it'd resort to second guessing a modder's intent even before he made the mod.
User avatar
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

Post by Ed the Bat »

Then I guess I'll just have to keep doing it how I'm doing it.
Gez
 
 
Posts: 17942
Joined: Fri Jul 06, 2007 3:22 pm

Re: Bypassing locked doors

Post by Gez »

Suppose a method suddenly appears. For example, DoomScript happens and you can reprogram directly the action functions themselves. Yeehaw, you can now get in at a lower level than everybody else and make your mod compatible with everything by redefining all the *Locked* specials. Except... Two weeks later, another, different mod appears, which also redefined all the *Locked* specials to achieve some different result, and you're back to needing compatibility patches. As soon as you can mod something, you can create a mod conflict. This is inevitable.

(Also, this hypothesis ignores the UDMF locknumber property which can be placed on any linedef, meaning that any special can be locked anyway, even those that don't use a locknumber parameter.)

You could think that a foolproof method would be to go at the very lowest level and code it directly in C++, as a feature suggestion. But unfortunately, even that isn't guaranteed to work in all cases, since it has been a relatively common practice for people to duplicate lock systems in ACS with inventory checks...
User avatar
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

Post by Ed the Bat »

Gez wrote:...duplicate lock systems in ACS with inventory checks...
That one's been a pain in my ass before... Thankfully, there's less reason for people to do that, now that ACS_LockedExecute can check for keys outside of the script.

I know I can't cover every contingency. That's why I load my KEYCONF before other mods, not after. If I load it before, and the map has a different lock set, then I can still pick up those locks; the skeleton keys just won't work. If I loaded mine afterwards, ONLY the skeleton key would work; custom keys inside the map may break, which is definitely the greater of two evils there.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Bypassing locked doors

Post by XutaWoo »

Ed the Bat wrote:KEYCONF
These aren't the keys you're looking for. :P
User avatar
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

Post by Ed the Bat »

XutaWoo wrote:
Ed the Bat wrote:KEYCONF
These aren't the keys you're looking for. :P
Brilliant, yes. You're right. I typed that without thinking. I'm sure y'all probably guessed I meant LOCKDEFS when I said that.

This is particularly ironic because I have to load my KEYCONF after custom maps (as opposed to LOCKDEFS before them, like I said above), due to how setslot and clearplayerclasses will muck up anything that was loaded before them.
User avatar
Mr. Tee
Posts: 1111
Joined: Sun Feb 08, 2004 7:49 pm
Contact:

Re: Bypassing locked doors

Post by Mr. Tee »

Gez wrote:Suppose a method suddenly appears. For example, DoomScript happens and you can reprogram directly the action functions themselves. Yeehaw, you can now get in at a lower level than everybody else and make your mod compatible with everything by redefining all the *Locked* specials. Except... Two weeks later, another, different mod appears, which also redefined all the *Locked* specials to achieve some different result, and you're back to needing compatibility patches. As soon as you can mod something, you can create a mod conflict. This is inevitable.
I guess then the only surefire way would be to modify zdoom.exe itself and embed the skeleton key object within. The caveat is you'd have to give this executable to your friends if you all wanted to use this item, and I can imagine something simple like this causing odd bugs elsewhere in the code...
User avatar
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

Post by Ed the Bat »

Editing the executable is probably never a good idea. But, y'know, even if it's not perfectly elegant, the method I've got right now certainly gets the job done for me and my friends, so... I think we'll live. :)
Locked

Return to “Editing (Archive)”