Quest.txt format

From NetHackWiki
Revision as of 21:38, 20 December 2015 by ChasonBot (talk | contribs)
Jump to navigation Jump to search

quest.txt is a text data file residing in the NetHack source dat-directory. It contains text messages for the quest leaders, nemeses and guardians to say, and other texts related to the quests. It also contains angelic and demonic maledictions.

This page is a stub. Should you wish to do so, you can contribute by expanding this page.

A user has suggested improving this page or section as follows:

"actually document the format here..."


Text Replacement Formatting

The messages can contain special characters that will be replaced at run-time with some other data. For example in a string "Hello, %p" the "%p" would be replaced by the player's name.

Code Explanation
%p Player's name
%c Player's role, eg. "Archeologist"
%r Player's current rank title, eg. for an archeologist it could be "Field Worker"
%R Rank title required to get on the quest.
%s "sister" or "brother"
%S "daughter" or "son"
%l Name of the quest leader
%i Name of the intermediate level, eg. "the Tomb of the Toltec Kings"
%o Name of the quest artifact
%n Name of the quest nemesis
%g Name of the quest guardians
%G "god" or "goddess", depending on player's original alignment
%H Name of the quest home level
%a Player's original alignment
%A Player's current alignment
%d Player's original god
%D Name of the lawful god
%C "chaotic"
%L "lawful"
%N "neutral"
%x "see", or "sense" if player is blind
%Z Name of the first dungeon ("Dungeons of Doom")
%% "%"

The special replacement codes above can be immediately followed by some modifiers. For example "%NC" would show "Neutral" - %N shows normally "neutral", but the modifier C capitalizes the first letter.

Formatting code modifiers
Code Explanation
A Prefix with "A " or "An "
a Prefix with "a " or "an "
C Capitalize the first letter
p Pluralize
P Pluralize and capitalize the first letter
s Append possessive suffix
S Append possessive suffix and capitalize the first letter
t Remove "the " prefix


This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.