I've got a major problem with KEYS opening 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.
Locked
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

I've got a major problem with KEYS opening DOORS.

Post by Hidden Hands »

I have a serious problem here. I have replaced all in game keys with my own ones and now the keys wont open the doors they are meant for. Here is what I have done. Help is urgently needed please.

LANGUAGE LUMP

Code: Select all

[en default]
GOTREDCARD = "It's a key with a question mark on the tag.";
PD_REDC = "It's locked. A question mark is etched under the keyhole.";
PD_REDCO = "It's locked. A question mark is etched under the keyhole.";

GOTBLUECARD = "It's a key with an exclamation mark on the tag.";
PD_BLUEC = "It's locked. An exclamation mark is etched under the keyhole.";
PD_BLUECO = "It's locked. An exclamation mark is etched under the keyhole.";

GOTYELWCARD = "It's a key with a full stop on the tag.";
PD_YELLOWC = "It's locked. A full stop is etched under the keyhole.";
PD_YELLOWCO = "It's locked. A full stop is etched under the keyhole.";

GOTREDSKUL = "It's a key with a yin-yang on the tag.";
PD_REDS = "It's locked. A yin-yang is etched under the keyhole.";
PD_REDSO = "It's locked. A yin-yang is etched under the keyhole.";

GOTYELWSKUL = "It's a key with a pentagram on the tag.";
PD_YELLOWS = "It's locked. A pentagram is etched under the keyhole.";
PD_YELLOWSO = "It's locked. A pentagram is etched under the keyhole.";

GOTBLUESKUL = "It's a key with a crucifix on the tag.";
PD_BLUES = "It's locked. A crucifix is etched under the keyhole.";
PD_BLUESO = "It's locked. A crucifix is etched under the keyhole.";
LOCKDEFS

Code: Select all

Lock 1 Doom
{
   //$Title "Red Keycard"
   RedCard
   Message "$PD_REDC"
   RemoteMessage "$PD_REDCO"
   Mapcolor 255 0 0 
}

Lock 2 Doom
{
   //$Title "Blue Keycard"
   BlueCard
   Message "$PD_BLUEC"
   RemoteMessage "$PD_BLUECO"
   Mapcolor 255 0 0 
}

Lock 3 Doom
{
   //$Title "Yellow Keycard"
   YellowCard
   Message "$PD_YELLOWC"
   RemoteMessage "$PD_YELLOWCO"
   Mapcolor 255 0 0 
}

Lock 4 Doom
{
   //$Title "Red Skull"
   RedSkull
   Message "$PD_REDS"
   RemoteMessage "$PD_REDSO"
   Mapcolor 255 0 0 
}

Lock 5 Doom
{
   //$Title "Yellow Skull"
   YellowSkull
   Message "$PD_YELLOWS"
   RemoteMessage "$PD_YELLOWSO"
   Mapcolor 255 0 0 
}

Lock 6 Doom
{
   //$Title "Blue Skull"
   BlueSkull
   Message "$PD_BLUES"
   RemoteMessage "$PD_BLUESO"
   Mapcolor 255 0 0 
}
DECORATE

Code: Select all

//KEYS
ACTOR FullStopKey : YellowCard replaces YellowCard
{
  Inventory.PickupMessage "$GOTYELWCARD"
  Inventory.Icon "STKEYS1"
  States
  {
  Spawn:
    YKEY A 100
    YKEY B 3 Bright
	YKEY A 3
	YKEY B 3 Bright
    Loop
  }
}

ACTOR ExclamationKey : BlueCard replaces BlueCard
{
  Inventory.PickupMessage "$GOTBLUECARD"
  Inventory.Icon "STKEYS1"
  States
  {
  Spawn:
    BKEY A 100
    BKEY B 3 Bright
	BKEY A 3
	BKEY B 3 Bright
    Loop
  }
}


ACTOR QuestionKey : RedCard replaces RedCard
{
  Inventory.PickupMessage "$GOTREDCARD"
  Inventory.Icon "STKEYS1"
  States
  {
  Spawn:
    RKEY A 100
    RKEY B 3 Bright
	RKEY A 3
	RKEY B 3 Bright
    Loop
  }
}
This looks fine to me. So why then when I pick up the "fullstopkey" for example, does it not open a door locked by the fullstoplock? Really need help with this thank you so much in advance.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: I've got a major problem with KEYS opening DOORS.

Post by gwHero »

I think you have to add the new keys to the LOCKDEFS lump too.

This code is from the lockdefs from a wad I created some years ago. I had added the keys HrRedKey, HrBlueKey & HrYellowKey to the specific original 129-131 locks, and that worked:

Code: Select all

Lock 129 Doom
{
	Any { RedCard RedSkull KeyGreen HrRedKey }
	Message "Door locked. You need a RED key to open it."	// "$PD_REDK"
	RemoteMessage "$PD_REDO"
	Mapcolor 255 0 0
}

Lock 130 Doom
{
	Any { BlueCard BlueSkull KeyBlue HrBlueKey }
	Message "Door locked. You need a BLUE key to open it."	//"$PD_BLUEK"
	RemoteMessage "$PD_BLUEO"
	Mapcolor 0 0 255
}

Lock 131 Doom
{
	Any { YellowCard YellowSkull KeyYellow HrYellowKey }
	Message "Door locked. You need a YELLOW key to open it." 	// "$PD_YELLOWK"
	RemoteMessage "$PD_YELLOWO"
	Mapcolor 255 255 0
}
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: I've got a major problem with KEYS opening DOORS.

Post by Nevander »

Basically if you create all new keys, you need to add them into your LOCKDEFS. So for Lock 1 instead of RedCard you need to put QuestionKey. Same for the others.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I've got a major problem with KEYS opening DOORS.

Post by Hidden Hands »

Keys are fixed. Thanks for all the help.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: I've got a major problem with KEYS opening DOORS.

Post by Graf Zahl »

Nevander wrote:Basically if you create all new keys, you need to add them into your LOCKDEFS. So for Lock 1 instead of RedCard you need to put QuestionKey. Same for the others.

Alternatively you can give the new keys a species which refers to a key it's supposed to emulate.
Locked

Return to “Editing (Archive)”