Difference between revisions of "Quest.txt format"

From NetHackWiki
Jump to navigation Jump to search
(text replacement chars)
(Text Replacement Formatting: format modifiers)
Line 80: Line 80:
 
| <tt>%%</tt>
 
| <tt>%%</tt>
 
| "%"
 
| "%"
 +
|}
 +
 +
The special replacement codes above can be immediately followed by some modifiers. For example "<tt>%NC</tt>" would show "Neutral" - <tt>%N</tt> shows normally "neutral", but the modifier <tt>C</tt> capitalizes the first letter.
 +
 +
{| class="prettytable striped"
 +
|-
 +
!colspan="2"| Formatting code modifiers
 +
|-
 +
! Code
 +
! Explanation
 +
|-
 +
| <tt>A</tt>
 +
| Prefix with "A " or "An "
 +
|-
 +
| <tt>a</tt>
 +
| Prefix with "a " or "an "
 +
|-
 +
| <tt>C</tt>
 +
| Capitalize the first letter
 +
|-
 +
| <tt>p</tt>
 +
| Pluralize
 +
|-
 +
| <tt>P</tt>
 +
| Pluralize and capitalize the first letter
 +
|-
 +
| <tt>s</tt>
 +
| Append possessive suffix
 +
|-
 +
| <tt>S</tt>
 +
| Append possessive suffix and capitalize the first letter
 +
|-
 +
| <tt>t</tt>
 +
| Remove "the " prefix
 
|}
 
|}
  

Revision as of 16:23, 8 June 2013

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