Jump to content
  • 0

Key cards no longer working when using inheritance?


Doomsday

Question

I think that's what it's called atleast. I've just been trying to make Key cards make a pick up sound and for some reason I won't be able use them on doors. Atleast keys that are in the map, the keys that go into my inventory when I use give all work however. 

Edited by Doomsdλy1993

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

If all you want is to change the general key pickup sound, the simplest way is to include the new sound in the PWAD (for example KEYUP), then add SNDINFO lump with the line:

misc/k_pkup      KEYUP

This way it replaces the existing pickup sound for keys.

 

If you want to create completely new keys, you need to make a Key actor (inheriting from Key class) and then add a LOCKDEFS lump with the appropriate lock definition (determining, for example, what key is required to open it). You will assign a number for the lock, which you can set on a line action in the editor.

 

Here's a key template (the standard blue keycard) you can refer to when making your custom key:

https://zdoom.org/wiki/Classes:BlueCard

 

Here's the reference for LOCKDEFS (with examples):

https://zdoom.org/wiki/LOCKDEFS

 

And here's a list of used lock numbers (so pick one that is not one of them and in between 1 and 255):

https://zdoom.org/wiki/Key_types

Edited by Aurelius

Share this post


Link to post
  • 0

Keys are tricky because they are connected to other lumps, namely LOCKDEFS. Redefining a key also implies redefining the locks with the new key name.

Share this post


Link to post
  • 0

 

On 9/18/2020 at 1:19 PM, Aurelius said:

If all you want is to change the general key pickup sound, the simplest way is to include the new sound in the PWAD (for example KEYUP), then add SNDINFO lump with the line:


misc/k_pkup      KEYUP

This way it replaces the existing pickup sound for keys.

I never actually noticed that there was a pick up sound for keys already in DOOM. I was hoping to have a seperate sound for skulls but this will have to do.

Share this post


Link to post
  • 0
4 hours ago, Doomsdλy1993 said:

I was hoping to have a seperate sound for skulls

 

You can make actors to replace the existing keys and determine the pickup sounds for each however you want.

 

Here's an example for a yellow key and yellow skull replacements where the only thing that is changed is the sound:

Actor YellowCardAlt : YellowCard replaces YellowCard
{
	Inventory.PickupSound "keycard/pickup"
}

Actor YellowSkullAlt : YellowSkull replaces YellowSkull
{
	Inventory.PickupSound "skullkey/pickup"
}

To make these work, load your pickup sounds into your wad/pk3 (let's say they're called SKEYUP and CKEYUP) and then add to the SNDINFO

keycard/pickup     CKEYUP
skullkey/pickup    SKEYUP

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...