User Preferences FrogComposband allows you to change various aspects of the game to suit your tastes. You may define keymaps (changing the way your keypresses are mapped to underlying commands), create macros (allowing you to map a single keypress to a series of keypresses), modify the visuals (allowing you to change the appearance of monsters, objects, or terrain features), change the colors (allowing you to make a given color brighter, darker, or even completely different), or set options (turning them off or on). Preference Files There are two types of preference files: system preferences and user preferences. The former represent the default display and input options, while the latter are optional customizations that you may add to override the default settings. System preference files, such as pref.prf, are usually stored in /lib/pref relative to the installation (e.g., on Windows, if you installed in C:\games\FrogComposband then the system pref files may be found in C:\games\FrogComposband\lib\pref). User preference files, on the other hand, are stored in the user directory, which is /lib/user on Windows, relative to the install location, and perhaps (this is customizable) ~/.angband/FrogComposband on Linux. In general, the location of user files is platform-dependent, and can vary depending on how you configure and install the game. During initialization, the system preference file pref.prf is loaded, and this file directs the loading of other preference files, such as pref-key.prf for keyboard mappings and pref-opt.prf for default option settings. Then, system preference files for visuals are loaded starting with font.prf for normal ASCII display and graf.prf for those weird graphics users. Each of these system preference files will redirect to another file depending on which platform you are playing (e.g. font-win.prf on Windows). Finally, once your character has been born or loaded, the game then tries to load the following user preference files: user.prf user-$SYS.prf $RACE.prf $CLASS.prf $PLAYER.prf Here, $SYS is the 3-character system code for your platform, such as win for the Windows port or gcu for the Curses port. $RACE is your current character's race, $CLASS the class name, and $PLAYER the character's actual name, unless it contains illegal characters for your file system (e.g, naming your player Mr. *WONDER* is probably a bad idea). User preference files are loaded last so that you may override system preferences with your own settings. We'll discuss some examples below. Preference files consist of a list of commands which are parsed to configure various options. These are discussed next. Preference Commands There are many commands for setting preferences. The syntax is complicated, but mostly, you can use the user interface commands %, & and @ to do things easily and leave syntax worries to the game itself. I'll give one example of the syntax in the next section, and then we will discuss setting up preferences using the user interface commands which are designed to hide the details of the syntax from you. An Example In this example, fire up the game and load your character. My character is imaginatively named Test, so when I refer to Test.prf later on, you'll know to mentally change that filename to whatever your character happens to be named. For this example, we will be directly entering a single user preference command. To do this, we use the special Enter a user pref command command which is available with the ! key. This requires us to know the exact syntax of the preference command we want, as well as the internal numeric code for various values. It is an advanced command, and normally you will want to use one of the friendlier in-game commands (for visuals, in this case) instead. Suppose you find @ boring to look at. Let's use @ instead! To make this change, type ! then enter R:0:11:@. The R preference command is used to set display values for monster races (which, as you may know, are defined in /lib/edit/r_info.txt). The game uses the special 0th entry in the monster race table as the display options for the player. That we entered R:0 says we wish to override this value. The next field is the attribute to use. We need to enter a value of 0 to 15 for one of the 16 available colors; I picked 11 for yellow. Finally, we keep the @ as the character for this monster race. After entering this command, you'll notice the player is still a plain old @; type ^R to force a redraw, and now you should be proudly displayed as @. If we were to restart the game at this point, our change would be lost. We'll discuss the Interact with Visuals command in just a moment, but for now, just blindly press % followed by 1 to dump the current monster race visuals to a user preference file. I get the file Test.prf listed as the default (remember, my character is actually named Test). You should keep this $NAME.prf suggestion since, as I'm sure you remember, this is one of the files the game tries to automatically load during initialization. Keeping this value ensures our changes get automatically used the next time we play this character! So press ENTER to actually dump your preferences. One final comment: You may edit the Test.prf file you dumped directly, or you may delete it. Since this was an example, you probably just want to delete it, but you should know that the game stores all user preferences for your current character here (by default), and this includes any macros you might have defined. Interacting with Visuals (%) Now, you may have found the need to type in a cryptic instruction like R:0:11:@ rather disgusting. If so, you can relax: there is an easier way. Let us repeat the change from the previous section using the Interact with Visuals user interface. Press % and then choose one of the menu options for changing monster attributes, either 4 for numeric mode or 7 for visual mode. Actually, let's combine the two: press 4 first, and then v to switch to visual mode! (The player, not being a normal monster, can only be accessed in visual mode this way.) Visuals - Monsters Name Idx Sym ============================================================================== Player 01/40 0 @ 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# <dir>, ENTER to accept, 'c' to copy, ESC Now use the arrow keys to select your favorite visual (in this case, the yellow @): Visuals - Monsters Name Idx Sym ============================================================================== Player 0b/40 0 @ 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~# <dir>, ENTER to accept, 'c' to copy, ESC Go ahead and press ENTER to accept the change. This accomplished the same change as ! followed by R:0:11:@ which we did in the last section. It's a bit more work, but you don't need to remember any syntax or ASCII key codes or color numbers. When you want to keep your changes, use option 1 to dump monster visuals, just like before. I'll let you work through the other visual options; you can configure not just monster visuals, but objects and terrain features as well. Be sure to dump your changes so they are remembered for this character. Interacting with Colors (&) This option allows you to configure the basic colors used by the game. This can be a bit of work: while the UI is easy to figure out (use the R, G and B keys to adjust the RGB value), each keypress only increases or decreases the value by 1, so reaching the value you would like can take a while. Here too, remember to dump your changes! Modifying colors may not work on some platforms. Interacting with Options (=) The various game options are documented elsewhere (see [a]). Here, I'll just mention that there exist two preference commands for turning options on and off: you may use Y:option_name to turn an option on, and X:option_name to turn it off (use ! for this). Obviously, replace option_name with the exact name for the option you wish to configure. The list of internal option names is documented in the previous link. Note: You cannot alter cheating options with the user pref commands X or Y. Nor can you configure these options in the pref-opt.prf system preference file. To cheat, you need to enable the allow_debug_opts and then set the option through the user interface. This will mark your character as a cheater, though! Interacting with Macros (@) The "Interact with macros" command allows you to define or remove macros, which are mappings from a single logical keypress to a sequence of keypresses, allowing you to use special keys on the keyboard, such as function keys or keypad keys, possibly in conjunction with modifier keys, to "automate" repetitive multi-keypress commands that you use a lot. Since macros represent keypress sequences, and not all keypresses have a printable representation, macro triggers and actions must often be "encoded" into a human readable form. This is done using several types of encoding, including "\xHH" for character number HH in hexadecimal, "\e" for the "escape" code, "\n" for the "newline" code, "\r" for the "return" code, "\s" for the "space" code, "\\" for backslash, "\^" for caret, and "^X" for the code for any "control" key "ctrl-X". In FrogComposband, a special key used as a macro-trigger will be displayed using its real name, for example the Control-key plus the F1-key is displayed as "\[control-F1]", and the Alt-key plus the G is displayed as "\[Alt-G]". In some other variants these special keys are displayed using key-codes. Note that the "action" of a macro will not be checked against other macro triggers, so you cannot make infinite loops. You may specify extremely long macros, but you are limited in length by the underlying input mechanisms, which in general limit you to about 1024 keys in both triggers and actions. The special "\" command (which must be encoded in macros as "\\") is very useful in macros, since it bypasses all keymaps and allows the next keystroke to be considered a command in the underlying FrogComposband command set. For a list of the FrogComposband command set, see the "command.txt" help file. For example, a macro which maps Shift-KP6 to "\" + "." + "6" will induce the "run east" behavior, regardless of what keyset the user has chosen, and regardless of what keymaps have been defined. Macros can be specified in user pref files as a pair of lines, one of the form "A:<str>", which defines the encoded macro action, and one of the form "P:<str>", which defines the encoded macro trigger. Keymaps The "Interact with macros" command also allows you to define keymaps, which are vaguely related to macros. A keymap maps a single keypress to a series of keypresses, which bypass both other keymaps and any macros. FrogComposband uses keymaps to map the original and the roguelike keysets to the underlying command set, and allows the user to modify or add keymaps of their own. Note that all keymap actions must be specified using underlying commands, not keypresses from the original or roguelike keysets. The original keyset is almost identical to the underlying keyset, except that "numbers" are mapped to ";" plus a direction, "5" is mapped to ",", and a few control-keys are mapped to various things. See "command.txt" for the full set of underlying commands. Some uses for keymaps include the ability to "disable" a command by mapping it to "\x00". Keymaps are safer than macros in that macros should always use a special key as the trigger; using a regular key as a macro trigger will interfere with that key's normal functionality, but using regular keys as keymap triggers is okay as long as the key does not overwrite commands. Keymaps can be specified in user pref files as pairs of lines of the form "A:<str>" "C:<T>:<key>", where <str> is the encoded keymap action, <T> is the keyset (0 for original and 1 for roguelike), <key> is the encoded trigger key. Some Macro and Keymap Examples You may now forget about keymaps and pretend that macros are things that allow you, the user, to bind a sequence of commands to a single keystroke. Here are a few examples: Example #1: Archery Inscribe @f1=g on your primary ammo, then map the sequence f1*5 or *5f1 to your favorite macro key. This will automatically target the nearest opponent and fire the inscribed ammo; and the =g part of the inscription allows you to automatically pick up the ammo once the battle is over. (Use f1*5 if the use_old_target option is off, as it is by default, and *5f1 if you have switched that option on.) Example #2: Resting Add the macro sequence R&\r to a convenient key, say F1. Normally, resting requires 2 keystrokes (R and Enter), which some players find frustrating when their resting gets constantly interrupted. Example #3: Illumination Inscribe your Staff of Illumination with @ug, then map the sequence ug to your favorite key, say F6. When you find a Rod of Illumination, just change the macro action to za and you can keep lighting up rooms with the same key. Example #4: Mass Identify Inscribe @ui on your Staff of Identify (the one with 50+ charges) and then bind ui* to your favorite knowledge key. Use this macro once your pack has filled up with unknown objects. Example #5: Spells Suppose your favorite attack spell is spell e in a book you have inscribed with @mf. Let's use y as our trigger key here; for this trigger key we'll want a keymap rather than a macro, otherwise we'll interfere with the normal functionality of the y key! Create a keymap for y with mfe as the action; mfe*5 or *5mfe if you want to go a step further and automatically target the nearest monster. See [b] for more spell examples. Example #6: Screenshots The screenshot key ) is somewhat limited in that it only works in specific situations and can blank potentially interesting material like messages. The special key x1d (keycode 29) will take a screenshot at any time without such downsides, but many keyboards or platforms offer no way to actually trigger keycode 29. Add the macro sequence \x1d to your favorite key, say F11, and use it to take a screenshot whenever you want! (Note that this must be a macro, not a keymap.) Remember to append your macros and keymaps to a file. Original : Alexander Cutler and Andy Astrand Updated : (2.7.6) by Russ Allbery ([email protected]) Updated : (2.7.9) by Ben Harrison ([email protected]) Updated : Zangband 2.2.0 through 2.2.6c by Robert Ruehlmann Updated : Zangband DevTeam Updated : Hengband 1.7.0 Updated : PosChengband 4.0.0 Updated : FrogComposband 7.1.liquorice