How do I add new Keys?

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.
Locked
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

How do I add new Keys?

Post by Amuscaria »

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?
User avatar
Jimmy
 
 
Posts: 4726
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Post by Jimmy »

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. :wink:
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

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.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

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.
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.
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. :wink:
Hm...this seems promising. Thanks a bunch! :D
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

In a coop game, only the player that picks up the key gets the key, but it works like a weapon in multiplayer (in terms of how it's picked up)

If you create the same idea with an inventory item, it's easy enough. Make a pickup that is reuseable, and stays indefinitely. I'd assume this is possible.
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

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.
That's the way I'd do it too, but Graf wanted it to be complicated.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

WTF are you babbling?
User avatar
Enjay
 
 
Posts: 27115
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Proper, definable keys via lockdefs would be the best way to go in most cases IMO. But that doesn't explain why I went for scripted fake keys in NJHThief. Actually, I'm not sure that anything can explain that. :?
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Enjay wrote:Actually, I'm not sure that anything can explain that. :?
One of those unexplanable mysteries in life.... :) So far, LOCKDEF seems most reasonable. But for the Key types, do i just enter thelock number that i make up myself in LOCKDEF? or what? That wiki didnt explain how I can use my own keys. o_o
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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:

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
}

to be opened with Door_LockedRaise(tag, speed, delay, 12)
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

IS there a index limit? And what numbers are not used? I'm aware 1-6 and 129 are used? SO i can make any number between and after those? Or are they used for other games (Heretic, Hexen, Strife,etc)?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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.
User avatar
Shadelight
Posts: 5113
Joined: Fri May 20, 2005 11:16 am
Location: Labrynna

Post by Shadelight »

LOCKDEFS and regular Decorate would be the way to do it. :)
Locked

Return to “Editing (Archive)”