You need a XXX card to open this door

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:

You need a XXX card to open this door

Post by Hidden Hands »

By default, it seems that when you examine a locked door, it says "you need a blue/red/yellow card to activate this object / unlock this door etc. This is a problem, as firstly, my game doesn't use keycards and secondly, they aren't coloured. How can I change this? I can't seem to do anything to alter it.

Thanks in advance.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: You need a XXX card to open this door

Post by Nevander »

The simplest way is to just change the actual text lines. You will need to change lines in LANGUAGE to change this behavior.

Let's assume you use a carnival game dart as a key. Obviously step one is to replace the sprites of the red, blue or yellow card or skull; so let's assume the sprites for the red keycard are changed. Now in LANGUAGE, add these lines:

Code: Select all

GOTREDCARD = "You pick up a dart key.";
PD_REDC = "You need a dart key.";
PD_REDCO = "You need a dart key.";
Now the red card is technically still a red card, but the game won't say that anymore. The only issue left is the color of the locked lines in the automap. To change that, you need to do a change in LOCKDEFS, like so:

Code: Select all

Lock 1 Doom
{
	//$Title "Red Keycard"
	RedCard
	Message "$PD_REDC"
	RemoteMessage "$PD_REDCO"
	Mapcolor 255 0 0 // change this to the color you want to represent the dart key in RGB (not hex)
}
Don't forget there are other lock types, like any red key and stuff. Either change those too or avoid those lock types.
Last edited by Nevander on Wed Aug 02, 2017 4:17 pm, edited 1 time in total.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: You need a XXX card to open this door

Post by Mikk- »

You can go about this a few different ways

change the key related strings in [wiki]LANGUAGE[/wiki] or DEHACKED and replace the graphics with something more suitable.
or
create new keys and strings in [wiki]LOCKDEFS[/wiki]
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: You need a XXX card to open this door

Post by Hidden Hands »

Thanks a ton, I'm working on this now. But on the Mapcolor line, what exactly is that and what do I do with it exactly? Also, just got this error when testing :

Here is my LANGUAGE lump code.

Code: Select all

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.";
Attachments
error.png
error.png (7.24 KiB) Viewed 1742 times
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: You need a XXX card to open this door

Post by wildweasel »

Hidden Hands wrote:Thanks a ton, I'm working on this now. But on the Mapcolor line, what exactly is that and what do I do with it exactly?
If the player is using custom automap colors and has a certain option enabled, locked doors will be drawn on the automap in their Mapcolor. Supply it with a set of color numbers (ranged from 0 to 255, representing Red, Green, and Blue respectively) and that can be used to differentiate locks from each other on the map.
Also, just got this error when testing :

Here is my LANGUAGE lump code.

Code: Select all

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.";
Your Language lump has to specify at least one language that the strings are a part of. Simply add a line like this to the top:

Code: Select all

[en default]
and your strings will apply to all forms of English (en) and be considered the defaults if other languages have not written translations for them.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: You need a XXX card to open this door

Post by Hidden Hands »

Excellent, that fixed it. Thanks so much. One final issue - when I pick up the key it still says "picked up a yellow/red/blue keycard" and not what I wanted it to say. Would I change this in DECORATE or...?

EDIT: Okay, it seems to only be happening with the yellow card. Its the yellow one that isn't working. All others are fine....?!

Also, on a seperate but somewhat related note, could I use the LANGUAGE lump to create examine messages? IE; You examine a book shelf and it says "its a bookshelf. nothing of interest" etc. ?
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: You need a XXX card to open this door

Post by Nevander »

Hidden Hands wrote:One final issue - when I pick up the key it still says "picked up a yellow/red/blue keycard" and not what I wanted it to say. Would I change this in DECORATE or...?

EDIT: Okay, it seems to only be happening with the yellow card. Its the yellow one that isn't working. All others are fine....?!
There are separate lines for each key color, they will all need to be changed if you don't want any more key lines mentioning colors.
Also, on a seperate but somewhat related note, could I use the LANGUAGE lump to create examine messages? IE; You examine a book shelf and it says "its a bookshelf. nothing of interest" etc. ?
Sort of, you can write out strings in LANGUAGE and then reference them via ACS with Print and HudMessage to cut down on text duplication. So as an example, in LANGUAGE (I think you have to escape the single quote, so I did to be sure, if you get an error just remove the slash):

Code: Select all

MSG_BOOKSHELF = "It\'s a bookshelf, nothing of interest.";
and then in an ACS script attached to a line of a bookshelf:

Code: Select all

HudMessage(l:"MSG_BOOKSHELF"; ... rest of parameters);
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: You need a XXX card to open this door

Post by Hidden Hands »

I'm alittle confused by the last part. Where do I make this ACS code please and what does rest of parameters mean? Sorry, I never dealt with this part of doom editing before.
User avatar
phantombeta
Posts: 2169
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: You need a XXX card to open this door

Post by phantombeta »

You have to escape any double quotes (") inside the string. Single quotes (') are fine.
So this:

Code: Select all

This " string " uses " double " quotes
becomes this:

Code: Select all

DOUBLE_QUOTES_STRING = "This \" string \" uses \" double \" quotes";
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: You need a XXX card to open this door

Post by Nevander »

Hidden Hands wrote:I'm alittle confused by the last part. Where do I make this ACS code please and what does rest of parameters mean? Sorry, I never dealt with this part of doom editing before.
[wiki]HudMessage[/wiki] is just a function in ACS that can be used to print messages to the screen with your own coordinates and size, etc. That is used inside an ACS script like any other ACS function you might be used to. You can also just use [wiki]Print[/wiki] but you don't get hardly any options.

Or... a better way might be to define a new lock in LOCKDEFS with the message you want (It's a bookshelf, nothing of interest) as the message you see when you don't posses the key for that lock. Then, just don't place any of the keys on the map and or don't even make a key for it. Attach it to a dummy script that does nothing (i.e. do ACS_LockedExecute and then just do a one tic delay). In fact, I bet that would work very well actually. I can test an example later if you can't get it working.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: You need a XXX card to open this door

Post by Hidden Hands »

Code: Select all

Lock 1 Doom
{
   //$Title "Red Keycard"
   RedCard
   Message "$PD_REDC"
   RemoteMessage "$PD_REDCO"
   Mapcolor 255 0 0 // change this to the color you want to represent the dart key in RGB (not hex)
}

Lock 2 Doom
{
   //$Title "Blue Keycard"
   BlueCard
   Message "$PD_BLUEC"
   RemoteMessage "$PD_BLUECO"
   Mapcolor 255 0 0 // change this to the color you want to represent the dart key in RGB (not hex)
}

Lock 3 Doom
{
   //$Title "Yellow Keycard"
   YellowCard
   Message "$PD_YELLOWC"
   RemoteMessage "$PD_YELLOWCO"
   Mapcolor 255 0 0 // change this to the color you want to represent the dart key in RGB (not hex)
}

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.";

GOTYELLOWCARD = "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.";

MSG_BOOKSHELF = "It\'s a bookshelf filled with books on the occult.";
MSG_PLANEPIC = "It's a painting of a spitfire. My Dad loved spitfires.";
MSG_NODOOR = "Nope. It won't budge.";
I made this. The red and blue keys works perfect but the yellow is still default? Am I doing something wrong here?
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: You need a XXX card to open this door

Post by Hidden Hands »

Nevander wrote:
Hidden Hands wrote:I'm alittle confused by the last part. Where do I make this ACS code please and what does rest of parameters mean? Sorry, I never dealt with this part of doom editing before.
[wiki]HudMessage[/wiki] is just a function in ACS that can be used to print messages to the screen with your own coordinates and size, etc. That is used inside an ACS script like any other ACS function you might be used to. You can also just use [wiki]Print[/wiki] but you don't get hardly any options.

Or... a better way might be to define a new lock in LOCKDEFS with the message you want (It's a bookshelf, nothing of interest) as the message you see when you don't posses the key for that lock. Then, just don't place any of the keys on the map and or don't even make a key for it. Attach it to a dummy script that does nothing (i.e. do ACS_LockedExecute and then just do a one tic delay). In fact, I bet that would work very well actually. I can test an example later if you can't get it working.
So when you say ACS do you mean as a lump in the WAD or in the MAP itself? I'd love to try this but I just don't get it.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: You need a XXX card to open this door

Post by Nevander »

Hidden Hands wrote:So when you say ACS do you mean as a lump in the WAD or in the MAP itself? I'd love to try this but I just don't get it.
ACS is just Doom's (technically Hexen's) way of adding more advanced semi-programming to the game. ACS scripts are put together through maps by using the Script Editor which is standard in Doom Builder since the first one I think. In the WAD it is SCRIPTS when uncompiled and BEHAVIOR when compiled.
Locked

Return to “Editing (Archive)”