LOCKDEFS in Ultimate Doom Builder

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.
peewee_RotA
Posts: 393
Joined: Fri Feb 07, 2014 6:45 am

LOCKDEFS in Ultimate Doom Builder

Post by peewee_RotA »

I've created a LOCKDEFS to define a new key, and now Ultimate DB won't show a list of keys.

Normally it shows the list of all keys available to the game. Now that the lockdefs file exists, that list no longer shows, and the only option is my new key.

Is there a configuration I have to set?

I did not do anything drastic like clear existing keys, Here's my LOCKDEFS:

Code: Select all

Lock 12 Hexen
{
	VillageKey
	Message "You need the Village Key"
	RemoteMessage "You need the Village Key"
	Mapcolor 255 0 0
}
For clarity, here is what UDB looks like with and without a LOCKDEFS
LOCKDEFS_example.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by peewee_RotA on Tue Apr 12, 2022 10:59 am, edited 1 time in total.
User avatar
Kappes Buur
 
 
Posts: 4138
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada

Re: LOCKDEFS in Ultimate Doom Builder

Post by Kappes Buur »

The villagekey is a new actor.
Each actor needs a unique DoomED number, 12 is already used.
I usually use a number in the 15000 range.

How did you script the key in DECORATE or ZSCRIPT?
Last edited by Kappes Buur on Tue Apr 12, 2022 10:48 am, edited 1 time in total.
peewee_RotA
Posts: 393
Joined: Fri Feb 07, 2014 6:45 am

Re: LOCKDEFS in Ultimate Doom Builder

Post by peewee_RotA »

The key exists and I can place it in the level. Here's the zscript:

Code: Select all

class VillageKey : HexenKey
{
	Default
	{
		Inventory.Icon "KEYSLOTC";
		Inventory.PickupMessage "$TXT_KEY_VILLAGE";
	}
	States
	{
	Spawn:
		KEYC A -1;
		Stop;
	}
}
Here's the UDB configuration for the game definition for keys:

(This is the configuration file that starts with: "Doom Builder 2 Game Configuration for ZDoom-compatible port". I've copied the Hexen one to add configs for my game) so they show up in the editor.
Spoiler:

What I have found so far is that UDB overwrites the KEYS enum on the actual editor objects if LOCKDEFS is present. So even if I define a new keys enum, it manually replaces every single linedef's "keys" enum.
https://github.com/jewalky/UltimateDoom ... r.cs#L2790

From what I can see unless there is a way to replace ZDoom_linedefs.cfg to make these linedefs point at an enum not named "keys", it will always just overwrite it.

Is there a way to redefine those "door" action parameters in a Game Configuration file?
peewee_RotA
Posts: 393
Joined: Fri Feb 07, 2014 6:45 am

Re: LOCKDEFS in Ultimate Doom Builder

Post by peewee_RotA »

Added a picture to the original post to better explain the issue. It's with the Locks dropdown in the Generic Door action for the line.
User avatar
Kappes Buur
 
 
Posts: 4138
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada

Re: LOCKDEFS in Ultimate Doom Builder

Post by Kappes Buur »

I am not well versed with all the new fandangled scripting stuff, all I can tell you is that I have never seen anybody edit an editor config file as you have done. I always leave these config files as downloaded with the editor. The only time these should be edited is when making a new config for a yet nonexistant configuration, for example to differantiate between DOOM 2 and DOOM editing sessions.

To eliminate a lot of problems iy always advisable to include the gzdoom.pk3 file into resources, ticking the "Exclude ..." box
Spoiler:
Maybe this tutorial can help you,
or somebody who knows this stuff can give some further advice.
User avatar
Enjay
 
 
Posts: 26539
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: LOCKDEFS in Ultimate Doom Builder

Post by Enjay »

Yarp, I have created a few config files, but I create them as new files with their own names. Most of the time you can simply reference the default files within your own project without editing them. So all you need to do is create copies of the files where you will be changing/adding entries and use those in your own project alongside the unchanged originals.

The originals do occasionally get updated, so keeping your own files to a minimum makes sense otherwise you will miss the changes. In fact, I think if you have changed some of the original files, they will get overwritten when you update regardless of whether the update changes those files or not. So, it's best to write your own with unique names (or at least keep a backup).
peewee_RotA
Posts: 393
Joined: Fri Feb 07, 2014 6:45 am

Re: LOCKDEFS in Ultimate Doom Builder

Post by peewee_RotA »

I made a new file to define the game editor objects by copying the Hexen configuration. I didn't see another way to get the sprites to show up in the editor for new actors.
User avatar
Enjay
 
 
Posts: 26539
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: LOCKDEFS in Ultimate Doom Builder

Post by Enjay »

UDB is actually pretty good at reading resource files and auto-adding stuff to the menu.

For big projects, I prefer to write my own config files (and it really is just a personal choice to do that) but for smaller jobs I just let UDB handle it.
peewee_RotA
Posts: 393
Joined: Fri Feb 07, 2014 6:45 am

Re: LOCKDEFS in Ultimate Doom Builder

Post by peewee_RotA »

It sounds like Kappes Buur has the right answer. Excluding the resource would fix the problem.

The problem is that these LOCKDEFS are IN the map pack with other textures and actors. So I'll have to experiment to make sure it works right.

Thanks for all the help.

I ended up adding my key to the "keys" enum in my configuration copy, and removing the LOCKDEFS while working on the locked doors... then once that was done I added the LOCKDEFS back in. It saves fine without an issue, it just is hard to set keys when the enum breaks.
boris
Posts: 750
Joined: Tue Jul 15, 2003 3:37 pm

Re: LOCKDEFS in Ultimate Doom Builder

Post by boris »

That the default locks are overridden when a LOCKDEFS is present is intended behavior. Otherwise you'd have duplicate entries if you load gzdoom.pk3. Or have entries you don't even want for your custom game.

Return to “Mapping”