Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

swapping out the "key" word

Recommended Posts

I'm looking to change the text output for the "key" readouts pertaining to doors in Doom. E.g. instead of the text reading "you need a blue key to activate this object", I'd like to be able to swap in something like "you need a floppy disc to activate this opbject". I've already changed the key graphics to reflect this, and the default text output does the trick, but the icing on the cake would be to have the text match the replacement graphics exactly. Can this be done the way of MAPINFO, and if so, what is the name of the variable(s)?

Share this post

Link to post

This is ZDoom right?

I don't entirely understand the question, but maybe taking a look at the LOCKDEFS page on the wiki will help you?

As an example, here's a section of LOCKDEFS from a thing I was working on:

Lock 1 Doom
	Message "You need a red prism to open this door."
	RemoteMessage "You need a red prism to activate this object."
	Mapcolor 255 0 0
There's a similar definition for Lock 129 which is "any red key".
Lock 129 Doom
	Any { RedPrismKey RedSphereKey KeyGreen }
	Message "$PD_REDK"
	RemoteMessage "$PD_REDO"
	Mapcolor 255 0 0
And then in my DECORATE code, I define the Prism key like this:
ACTOR RedPrismKey : RedCard replaces RedCard
    Inventory.PickupMessage "RED PRISM KEY"
        RKYY ABCDEFGHIJ 3 Bright
Where RKYY is the name of the sprite. (It's based on a rotating Heretic key, which is why it's so many frames. If you just want a floppy disk, one frame is probably fine.)

In my case I have this key replacing the red keycard, but that's not even necessary - you can have as many key objects as you want.

Hopefully that answers your question or at least points you in the right direction.

edit: several hours later your post makes perfect sense. I blame being tired. Anyhow, between my post and scifista's you've got several options on how to do it.

Share this post

Link to post

No, changing texts is not done via MAPINFO, it's done by LANGUAGE. Put a LANGUAGE lump in your wad. Similarly to MAPINFO, it's text based and the format is:

[enu default]

PD_BLUEO = "you need a floppy disc to activate this object"
More precisely:
[enu default] // header to tell the engine to replace a text string for english / default language

PD_BLUEO = "you need a floppy disc to activate this object"
  // A respective keyword referring to the text = your new text string
The keywords for keys are:
PD_BLUEO, PD_REDO, PD_YELLOWO - "you need a ... key to activate this object"
PD_BLUEK, PD_BLUEK, PD_YELLOWK - "you need a ... key to open this door"
PD_BLUEC, PD_REDC, PD_YELLOWC - "you need a ... card to activate this object"
PD_BLUES, PD_BLUES, PD_YELLOWS - "you need a ... skull to open this door"

This can be also done via DEHACKED.

EDIT: Actually, both my and plums's solutions are useable, if I understand it correctly. Plums's advice is more directly tied to keys (therefore it's "better" from coder's point of view), mine can be used on any strings which you're replacing or adding. But if you're having an altered DECORATE entry for your key, LOCKDEFS should be your preferred solution.

Share this post

Link to post

/having arrived at his destination, the elephant nervously eyed the entry to the glass house.

plums: aye, I'm using ZDOOM (ZMAPINFO) at the moment, but was thinking to do a Boom version of my wad after I got everything working there. I suppose I shouldn't expect all the ZMAPINFO stuff to just automatically work in Boom, huh? I'm a bit clumsy with code (read: slightly dyslectic - which in turn is a reason why my posts are so frequently either mis-spelled or EDIT'ed), so all the feature bells and special whistles I'm adding to my wad after default doom2/clean port content are strictly copy/paste from other places - bar brand new maps and graphics. Still, "if it works..." I tell myself. Might end up a ZDOOM-only house-of-cards in the end, if its ever done (Par.wad). Working with ZDOOM I miss the recording of a long demo ability for finished maps, but I seem able to squash the telltale leak-lines pretty efficiently and the large floor texture capacity is _really_ nice.

scifista42: At first glance, your solution looks like the safest bet for a man of my meager string-plucking skills.

Share this post

Link to post

DeHackEd works too. :) Go to the Strings table and you can alter the key messages to your heart's content.

Share this post

Link to post

Lumps like MAPINFO, ZMAPINFO, LOCKDEFS, LANGUAGE, DECORATE are of course ZDoom-specific and Boom disregards them. DEHACKED is definitely your best bet if you want an universal compatibility. But if you'll be targeting specifically ZDoom for sure, then using DEHACKED (at all) would be unnecessarily obsolete, because these special lumps (MAPINFO etc.) were developed to be far better in features and flexibility. ;)

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now