Status hilites

From NetHackWiki
Revision as of 01:57, 27 April 2017 by Phol ende wodan (talk | contribs) (Revise and reformat into sections; add list of valid colors, add how to compile)
Jump to navigation Jump to search

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.