How do I add new Keys?
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.
How do I add new Keys?
I've seen in KDIZD that there are a few more skullkeys and keycards. How's that done? Do I just make a actor inhereting the default Key Actor with Decorate and give some new graphics? Or is there more?
Also, How do I use these new keys to open doors? My guess is with ACS running some Checkinventory thing. Or am I wrong?
Also, How do I use these new keys to open doors? My guess is with ACS running some Checkinventory thing. Or am I wrong?
http://www.zdoom.org/wiki/index.php?title=LOCKDEFS
I don't know if you already know about this, but it should help if you don't.
I don't know if you already know about this, but it should help if you don't.

Well, the way I would do that sort of thing is have it as an inventory item, and have whatever needs to be activated run a script looking for the item, and if it does turn up, have it do what needs doing. Basically just write out the process longhand, with the option of extra options.
I could go dig up an example script if you want.
I could go dig up an example script if you want.
But how would I gives this key to all the players if they are on a coop game? Does the doom key gets transfered to all the players if one player picks it up? I wasn't aware that inventory items can do the same. Unless you're thinking of using an ACS script, which I guess can be done.Phobus wrote:Well, the way I would do that sort of thing is have it as an inventory item, and have whatever needs to be activated run a script looking for the item, and if it does turn up, have it do what needs doing. Basically just write out the process longhand, with the option of extra options.
I could go dig up an example script if you want.
Hm...this seems promising. Thanks a bunch!jimmy91 wrote:http://www.zdoom.org/wiki/index.php?title=LOCKDEFS
I don't know if you already know about this, but it should help if you don't.

- Bio Hazard
- Posts: 4019
- Joined: Fri Aug 15, 2003 8:15 pm
- Location: ferret ~/C/ZDL $
- Contact:
One of those unexplanable mysteries in life....Enjay wrote:Actually, I'm not sure that anything can explain that.

- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
You define a lock, give it an index and specify the keys you need. The index is the parameter you have to use in Door_LockedRaise or ACS_LockedExecute.
Example:
to be opened with Door_LockedRaise(tag, speed, delay, 12)
Example:
Code: Select all
Lock 12
{
MasterKey
Message "You need the master key to open this door"
RemoteMessage "You need the master key to activate this object"
Mapcolor 55 55 100
}
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
You can look at the LOCKDEFS lump in zdoom.pk3 to see which numbers are already in use. Currently it's 1-6, 100-102, 129-134 and 228-229 for Doom (the other games use different sets.) But if you don't use a particular lock overriding it doesn't really matter.
The index limit is 255 because that's the maximum you can use inside a map.
The index limit is 255 because that's the maximum you can use inside a map.
- Shadelight
- Posts: 5113
- Joined: Fri May 20, 2005 11:16 am
- Location: Labrynna