Difference between revisions of "Status hilites"

From NetHackWiki
Jump to navigation Jump to search
(Revise and reformat into sections; add list of valid colors, add how to compile)
(Add incomplete section for 3.6.1-specific status hilites)
Line 1: Line 1:
'''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.
+
'''Hilite_status''' is an option added in [[NetHack 3.6.0]] that allows the player to configure the display colors of status indicators and conditions. It is considered an experimental feature. In 3.6.0, it is not compiled in by default (although many servers have it enabled), and it has been improved greatly in the development version of [[3.6.1]].
  
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.
+
== NetHack 3.6.1 ==
 +
First, there is an option called '''statushilites''', which is numeric. It controls the number of turns for which most statuses will be hilighted after a change, after which they will revert to normal. Negating this or setting it to zero disables status hilites completely.
  
== Specification ==
+
OPTIONS=statushilites:10 # will hilite changes in status for 10 turns
 +
OPTIONS=!statushilites  # disables
 +
OPTIONS=statushilites:0  # disables
 +
 
 +
Then, there are a number of options for configuring the hilites themselves. The general format is:
 +
 
 +
OPTIONS=hilite_status:field/trigger/color&attributes
 +
 
 +
The ''field'' is the value you wish to color.
 +
 
 +
The ''trigger'' sets the conditions where the hilite displays.
 +
 
 +
The ''color'' and ''attributes'' control what it displays as when the trigger is active. Note that hilite_status will display colors regardless of whether you have the [[Options#color|color]] option enabled.
 +
 
 +
=== Fields ===
 +
{|class="wikitable"
 +
!Field
 +
!Description
 +
!up / down / changed
 +
!percentage
 +
!absolute value
 +
!text match
 +
!Notes
 +
|-
 +
|title
 +
|Your rank title.
 +
|Yes || || || Yes*
 +
|Comparisons are based on the strings used, not your experience level, so going from an XL 1 "Rambler" to an XL 3 "Sightseer" will count as a decrease.
 +
|-
 +
|strength
 +
|Your strength.
 +
|Yes || || Yes ||
 +
|When specifying absolute values, 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.
 +
|-
 +
|dexterity, constitution, intelligence, wisdom, charisma
 +
|Your other ability scores.
 +
|Yes || || Yes ||
 +
|
 +
|-
 +
|characteristics
 +
|Is an alias for all six ability scores.
 +
|Yes || || Yes ||
 +
|
 +
|-
 +
|alignment
 +
|Your alignment (Lawful, Neutral, or Chaotic).
 +
|Yes || || || Yes
 +
|The ordering is Lawful < Neutral < Chaotic if you want to use up or down rules. Text matches must be either "lawful", "neutral", or "chaotic".
 +
|-
 +
|score
 +
|Your score.
 +
|Yes || || Yes ||
 +
|
 +
|}
 +
 
 +
== NetHack 3.6.0 ==
 +
The information in this section 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:
 
Hilite_status is specified like other options, and takes this form:
  
Line 12: Line 71:
 
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".
 
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 [[Options#color|color]] option enabled.
+
''Up-color'' and ''down-color'' define these colors.  
  
 
Only one threshold, and two colors, are currently allowed. There is not a way to  
 
Only one threshold, and two colors, are currently allowed. There is not a way to  
  
=== Valid fields ===
+
==== 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 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:
 
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.
+
* '''strength''' is, of course, your current strength stat.  
 
* '''experience-level''' is your current character level. '''experience''' is your total XP. The latter isn't displayed at all unless '''showexp''' 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.
 
* '''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.
 
* '''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.
Line 41: Line 100:
 
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.)
 
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 ===
+
==== Thresholds ====
 
{{todo|Many (most?) fields don't work correctly with <tt>downup</tt>. <tt>gold</tt>, for one.}}
 
{{todo|Many (most?) fields don't work correctly with <tt>downup</tt>. <tt>gold</tt>, for one.}}
  
Line 58: Line 117:
  
 
== Compiling ==  
 
== 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 play 3.6.0 with hilite_status enabled, you will probably need to compile it yourself in order to play with it locally. Most distributions of NetHack 3.6.0 likely have it disabled.
 +
 
 +
3.6.1 currently has it enabled by default, but this may change. (And since there aren't any distributions of it yet, you currently have to compile it to play locally anyway.)
  
 
To do this, go into config.h and uncomment the following lines:
 
To do this, go into config.h and uncomment the following lines:

Revision as of 01:26, 25 October 2017

Hilite_status is an option added in NetHack 3.6.0 that allows the player to configure the display colors of status indicators and conditions. It is considered an experimental feature. In 3.6.0, it is not compiled in by default (although many servers have it enabled), and it has been improved greatly in the development version of 3.6.1.

NetHack 3.6.1

First, there is an option called statushilites, which is numeric. It controls the number of turns for which most statuses will be hilighted after a change, after which they will revert to normal. Negating this or setting it to zero disables status hilites completely.

OPTIONS=statushilites:10 # will hilite changes in status for 10 turns
OPTIONS=!statushilites   # disables
OPTIONS=statushilites:0  # disables

Then, there are a number of options for configuring the hilites themselves. The general format is:

OPTIONS=hilite_status:field/trigger/color&attributes

The field is the value you wish to color.

The trigger sets the conditions where the hilite displays.

The color and attributes control what it displays as when the trigger is active. Note that hilite_status will display colors regardless of whether you have the color option enabled.

Fields

Field Description up / down / changed percentage absolute value text match Notes
title Your rank title. Yes Yes* Comparisons are based on the strings used, not your experience level, so going from an XL 1 "Rambler" to an XL 3 "Sightseer" will count as a decrease.
strength Your strength. Yes Yes When specifying absolute values, 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.
dexterity, constitution, intelligence, wisdom, charisma Your other ability scores. Yes Yes
characteristics Is an alias for all six ability scores. Yes Yes
alignment Your alignment (Lawful, Neutral, or Chaotic). Yes Yes The ordering is Lawful < Neutral < Chaotic if you want to use up or down rules. Text matches must be either "lawful", "neutral", or "chaotic".
score Your score. Yes Yes

NetHack 3.6.0

The information in this section 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.

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.
  • 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

To play 3.6.0 with hilite_status enabled, you will probably need to compile it yourself in order to play with it locally. Most distributions of NetHack 3.6.0 likely have it disabled.

3.6.1 currently has it enabled by default, but this may change. (And since there aren't any distributions of it yet, you currently have to compile it to play locally anyway.)

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.