Difference between revisions of "Status hilites"

From NetHackWiki
Jump to navigation Jump to search
(Note on hunger.)
(Revise and reformat into sections; add list of valid colors, add how to compile)
Line 1: Line 1:
{{todo|Many (most?) fields don't work correctly with <tt>downup</tt>. <tt>gold</tt>, for one.}}
+
'''Hilite_status''' is an option added to [[NetHack 3.6.0]] that allows the player to configure the display colors of status indicators and conditions. It is considered an experimental feature and is not compiled in by default (although many servers have it enabled), and it is likely to be modified in the future.
 +
 
 +
The information on this page is based primarily on reading the source. Due to a bug and some other minor limitations, some things cannot be tested.
  
This is as of 3.6.0. Given how weird it is, it will probably be changed in the future.
+
== Specification ==
 +
Hilite_status is specified like other options, and takes this form:
  
Also, this is based primarily on reading the source. Due to a major bug (detailed below) and some other minor limitations, more than a few things cannot be easily tested or used.
+
OPTIONS=hilite_status:field/threshold/down-color/up-color
  
Hilite_status uses the game's internal representation of your attributes, which results in some counterintuitive quirks.
+
The ''field'' is the value you wish to color.
  
Each entry takes the form <tt>field/threshold/down-color/up-color</tt>.
+
The ''threshold'' is the value over which it will be displayed as ''up-color'' and under which it will be displayed as ''down-color'', or the special operator "updown".
  
Thresholds can be one of these types:
+
''Up-color'' and ''down-color'' define these colors. Note that hilite_status will display colors regardless of whether you have the [[Options#color|color]] option enabled.
* An arbitrary number (e.g. "40"). If the field is equal to or less than the number specified, it will be hilighted as down-color; otherwise, it will be hilighted as up-color. As of 3.6.0, there is a bug where arbitrary number thresholds will not be parsed from a config file, which severely limits what you can do without pasting macros into the options menu.
 
* A percentage (e.g. "25%"). This is only valid for <tt>hitpoints</tt> and <tt>power</tt>, and is the same as an arbitrary number except that the threshold is a certain percentage of that value's maximum instead of a specific number.
 
* <tt>downup</tt>. The value will be hilighted down-color if it decreases, and up-color if it increases; the rest of the time, it will be displayed normally. The game also recognizes <tt>updown</tt>, <tt>up</tt>, and <tt>down</tt>, but they are treated as synonyms and do not change the order or meaning of the colors.
 
* The parser also recognizes a "changed" threshold, but it is currently unimplemented, likely because "updown" would make it redundant.
 
  
Fields:
+
Only one threshold, and two colors, are currently allowed. There is not a way to
  
These fields mean and behave exactly what and how you'd expect: <tt>dexterity</tt>, <tt>constitution</tt>, <tt>intelligence</tt>, <tt>wisdom</tt>, <tt>charisma</tt>, <tt>score</tt>, <tt>gold</tt>, <tt>power</tt>, <tt>power-max</tt>, <tt>armor-class</tt>, <tt>time</tt>, <tt>hitpoints</tt>, and <tt>hitpoints-max</tt>.
+
=== Valid fields ===
 +
These fields mean and behave exactly what and how you'd expect: '''dexterity''', '''constitution''', '''intelligence''', '''wisdom''', '''charisma''', '''score''', '''gold''', '''power''', '''power-max''', '''armor-class''', '''time''', '''hitpoints''', and '''hitpoints-max'''.
  
These are straightforward, but need a little explanation:
+
However, hilite_status uses the game's internal representation of your attributes, which results in some counterintuitive quirks for other fields. These need a little explanation:
  
* <tt>strength</tt> is, of course, your current strength stat. 1-18 are per normal, but "19" is actually 18/01; "119" is actually 19, and so on through 125. (19-25 are displayed as "18/**"). 19-118 are 18/01 through 18/99.
+
* '''strength''' is, of course, your current strength stat. 1-18 are per normal. Then, 18/01 is actually 19, 18/02 is actually 20, and so on through 18/99 being actually 118, as far as hilite_status is concerned. 19 strength corresponds to 119, and so on all the way up to 25 strength corresponding to 125.
* <tt>experience-level</tt> is your current character level. <tt>experience</tt> is your total XP. The latter isn't displayed at all unless <tt>showexp</tt> is enabled.
+
* '''experience-level''' is your current character level. '''experience''' is your total XP. The latter isn't displayed at all unless '''showexp''' is enabled.
* <tt>HD</tt>: When you are polymorphed into a monster, your character level display is replaced with the monster level (aka "hit dice") of your polymorphed form.
+
* '''HD''': When you are polymorphed into a monster, your character level display is replaced with the [[monster level]] (aka "hit dice") of your polymorphed form.
* <tt>carrying-capacity</tt> is 0 if unencumbered (in which case it won't be visible at all), 1 if burdened, 2 if stressed, 3 strained, 4 overtaxed, 5 overloaded.
+
* '''carrying-capacity''' is 0 if unencumbered (in which case it won't be visible at all), 1 if burdened, 2 if stressed, 3 strained, 4 overtaxed, 5 overloaded.
* <tt>hunger</tt> is 0 if satiated, 1 if not hungry (not shown on UI), 2 if hungry, 3 weak, 4 fainting, 5 fainted (as in actually unconscious from lack of food), and 6 starved. Despite of "hungry" being bigger than "satiated", if you want a yellow color when you are hungry the right syntax is "hunger/2/yellow/normal", not "hunger/2/normal/yellow".
+
* '''hunger''' is 0 if satiated, 1 if not hungry (not shown on UI), 2 if hungry, 3 weak, 4 fainting, 5 fainted (as in actually unconscious from lack of food), and 6 starved. Despite of "hungry" being bigger than "satiated", if you want a yellow color when you are hungry the right syntax is "hunger/2/yellow/normal", not "hunger/2/normal/yellow".
 
   
 
   
Arbitrary number thresholds are not allowed for <tt>title</tt>, <tt>alignment</tt>, and <tt>dungeon-level</tt>. So, you cannot have different colors for different alignments, and you cannot highlight being above/below a certain level of the dungeon. The only allowed comparison is "updown"; when they change, they are highlighted as if they went up.  
+
Thresholds are not allowed for '''title''', '''alignment''', and '''dungeon-level'''. So, you cannot have different colors for different alignments, and you cannot highlight being above/below a certain level of the dungeon. The only allowed comparison is "updown"; when they change, they are highlighted as if they went up.
  
<tt>condition</tt> is special. It is a bitmask comprised of the following flags:
+
'''condition''' is special. It is a bitmask comprised of the following flags:
  
 
* 0x01 (1) : Blind
 
* 0x01 (1) : Blind
Line 39: Line 39:
 
* 0x40 (64): Sliming
 
* 0x40 (64): Sliming
  
You are considered "over" if you have any of the statuses in the bitmask you specify and "under" if not. To make your bitmask, take your desired conditions in the table above and add their numbers together. <tt>updown</tt> will highlight as if "up" when you gain any status, and as if "down" when you lose any status. (Note that the latter won't be visible when you lose your only status as there is no text to highlight.)
+
You are considered "over" if you have any of the statuses in the bitmask you specify and "under" if not. To make your bitmask, take your desired conditions in the table above and add their numbers together. "updown" will highlight as its "up" color when you gain any status, and as its "down" color when you lose any status. (Note that it won't be visible when all your status afflictions disappear, because then there is no text to highlight.)
 +
 
 +
=== Thresholds ===
 +
{{todo|Many (most?) fields don't work correctly with <tt>downup</tt>. <tt>gold</tt>, for one.}}
 +
 
 +
Thresholds can be one of these types:
 +
* An arbitrary number (e.g. "40"). If the field is equal to or less than the number specified, it will be hilighted as the down-color; otherwise, it will be hilighted as the up-color. {{caption||'''There is currently a bug where thresholds of this type cannot be set via a config file.''' A workaround is to set these via the options menu in-game.}}
 +
* A percentage (e.g. "25%"). This is only valid for the ''hitpoints'' and ''power'' fields, and is the same as an arbitrary number except that the threshold is a certain percentage of that value's maximum instead of a specific number.
 +
* The special value ''updown''. The value will be hilighted down-color if it decreases, and up-color if it increases; the rest of the time, it will be displayed normally. The game also recognizes ''downup'', ''up'', and ''down'', but they are treated as synonyms and do not change the order or meaning of the colors.
 +
* The parser also recognizes a ''changed'' threshold, but it is currently unimplemented, likely because ''updown'' would make it redundant.
 +
 
 +
=== Colors ===
 +
The following colors are valid: "red", "green", "brown", "blue", "magenta", "cyan", "gray", "orange", "bright-green", "yellow", "bright-blue", "bright-magenta", "bright-cyan", and "white".
 +
 
 +
You can also specify "bold", "inverse" or "normal" as colors, which have the respective effect on white text. They can't be combined with any of the colors.
 +
 
 +
"Black" and "transparent" also appear to be valid, but don't do anything.
 +
 
 +
== Compiling ==
 +
Most distributions of NetHack 3.6.0 likely don't have hilite_status enabled. You will need to compile it yourself in order to play with it locally.
 +
 
 +
To do this, go into config.h and uncomment the following lines:
 +
 
 +
#define STATUS_VIA_WINDOWPORT /* re-work of the status line
 +
                                  updating process */
 +
#define STATUS_HILITES        /* support hilites of status fields */
 +
 
 +
After this, you should be able to compile normally.
  
 
{{nethack-360}}
 
{{nethack-360}}

Revision as of 01:57, 27 April 2017

Hilite_status is an option added to NetHack 3.6.0 that allows the player to configure the display colors of status indicators and conditions. It is considered an experimental feature and is not compiled in by default (although many servers have it enabled), and it is likely to be modified in the future.

The information on this page is based primarily on reading the source. Due to a bug and some other minor limitations, some things cannot be tested.

Specification

Hilite_status is specified like other options, and takes this form:

OPTIONS=hilite_status:field/threshold/down-color/up-color

The field is the value you wish to color.

The threshold is the value over which it will be displayed as up-color and under which it will be displayed as down-color, or the special operator "updown".

Up-color and down-color define these colors. Note that hilite_status will display colors regardless of whether you have the color option enabled.

Only one threshold, and two colors, are currently allowed. There is not a way to

Valid fields

These fields mean and behave exactly what and how you'd expect: dexterity, constitution, intelligence, wisdom, charisma, score, gold, power, power-max, armor-class, time, hitpoints, and hitpoints-max.

However, hilite_status uses the game's internal representation of your attributes, which results in some counterintuitive quirks for other fields. These need a little explanation:

  • strength is, of course, your current strength stat. 1-18 are per normal. Then, 18/01 is actually 19, 18/02 is actually 20, and so on through 18/99 being actually 118, as far as hilite_status is concerned. 19 strength corresponds to 119, and so on all the way up to 25 strength corresponding to 125.
  • experience-level is your current character level. experience is your total XP. The latter isn't displayed at all unless showexp is enabled.
  • HD: When you are polymorphed into a monster, your character level display is replaced with the monster level (aka "hit dice") of your polymorphed form.
  • carrying-capacity is 0 if unencumbered (in which case it won't be visible at all), 1 if burdened, 2 if stressed, 3 strained, 4 overtaxed, 5 overloaded.
  • hunger is 0 if satiated, 1 if not hungry (not shown on UI), 2 if hungry, 3 weak, 4 fainting, 5 fainted (as in actually unconscious from lack of food), and 6 starved. Despite of "hungry" being bigger than "satiated", if you want a yellow color when you are hungry the right syntax is "hunger/2/yellow/normal", not "hunger/2/normal/yellow".

Thresholds are not allowed for title, alignment, and dungeon-level. So, you cannot have different colors for different alignments, and you cannot highlight being above/below a certain level of the dungeon. The only allowed comparison is "updown"; when they change, they are highlighted as if they went up.

condition is special. It is a bitmask comprised of the following flags:

  • 0x01 (1) : Blind
  • 0x02 (2) : Confused
  • 0x04 (4) : Food Poisoned
  • 0x08 (8) : Ill
  • 0x10 (16): Hallucinating
  • 0x20 (32): Stunned
  • 0x40 (64): Sliming

You are considered "over" if you have any of the statuses in the bitmask you specify and "under" if not. To make your bitmask, take your desired conditions in the table above and add their numbers together. "updown" will highlight as its "up" color when you gain any status, and as its "down" color when you lose any status. (Note that it won't be visible when all your status afflictions disappear, because then there is no text to highlight.)

Thresholds

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

"Many (most?) fields don't work correctly with downup. gold, for one."

Thresholds can be one of these types:

  • An arbitrary number (e.g. "40"). If the field is equal to or less than the number specified, it will be hilighted as the down-color; otherwise, it will be hilighted as the up-color.
    There is currently a bug where thresholds of this type cannot be set via a config file. A workaround is to set these via the options menu in-game.
  • A percentage (e.g. "25%"). This is only valid for the hitpoints and power fields, and is the same as an arbitrary number except that the threshold is a certain percentage of that value's maximum instead of a specific number.
  • The special value updown. The value will be hilighted down-color if it decreases, and up-color if it increases; the rest of the time, it will be displayed normally. The game also recognizes downup, up, and down, but they are treated as synonyms and do not change the order or meaning of the colors.
  • The parser also recognizes a changed threshold, but it is currently unimplemented, likely because updown would make it redundant.

Colors

The following colors are valid: "red", "green", "brown", "blue", "magenta", "cyan", "gray", "orange", "bright-green", "yellow", "bright-blue", "bright-magenta", "bright-cyan", and "white".

You can also specify "bold", "inverse" or "normal" as colors, which have the respective effect on white text. They can't be combined with any of the colors.

"Black" and "transparent" also appear to be valid, but don't do anything.

Compiling

Most distributions of NetHack 3.6.0 likely don't have hilite_status enabled. You will need to compile it yourself in order to play with it locally.

To do this, go into config.h and uncomment the following lines:

#define STATUS_VIA_WINDOWPORT /* re-work of the status line
                                 updating process */
#define STATUS_HILITES        /* support hilites of status fields */

After this, you should be able to compile normally.


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

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

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