Konwert

From NetHackWiki
Revision as of 05:38, 17 July 2008 by Edward C (talk | contribs) (New page: It is possible to configure custom map symbols to arbitrary UTF8 characters using <code>konwert</code>. All that is required is to set each of the BOULDER, DUNGEON, TRAPS, EFFECTS, OBJ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

It is possible to configure custom map symbols to arbitrary UTF8 characters using konwert. All that is required is to set each of the BOULDER, DUNGEON, TRAPS, EFFECTS, OBJECTS, and WARNINGS options to ASCII codes that are definitely not going to be used for any purpose other than drawing the map, then remap those values to the UTF8 characters you want.

Configuring Nethack

Turning on the eight_bit_tty option gives you access to character codes 128-255 which aren't otherwise used, so it's easiest just to set the various symbols to use those character codes, starting at 128:

BOULDER = 128
DUNGEON = 129 130 131...

-- TODO: Finish this.

Configuring konwert

konwert filters are just executable shell scripts, and it will look for them in your ~/.konwert/filters/ directory. The cp437-utf8 filter is a good starting-point, copy it into your personal filters directory from /usr/share/konwert/filters/cp437-UTF8. Edit it and remove the -e argument and the text that follows. Rename it 'nethack'. This filter looks for the character set conversion table ~/.konwert/aux/charsets/nethack - that is where you'll map the hexadecimal values of the character codes to actual UTF8 characters. You'll want to start with something like this:

# BOULDER
\x80 '
# DUNGEON
\x81 \x20
\x82 |

-- TODO: Finish this.

You can then place whatever UTF8 characters you want into the second column (the \x20 is there to represent a space character that wouldn't otherwise be noticed by konwert.

Running Nethack

All that is left to do is run Nethack:

nethack | konwert nethack