Config File

From BZFlagWiki
Revision as of 23:25, 18 June 2009 by Me1 (Talk | contribs) (Binding Custom Keys)

Jump to: navigation, search

BZFlag uses an ASCII configuration file to store user settings. The file is called "config.cfg."


The location of the config file depends on your operating system.


XP: C:\Documents and Settings\[user]\My Documents\My BZFlag Files\2.0\config.cfg
Vista: C:\Users\[user]\Documents\My BZFlag Files\2.0\config.cfg

(Of course, replace [user] with your username)

Mac OS X

~/Library/Application Support/BZFlag/2.0/config.cfg

Linux and unix platforms


Editing the Config File

As the config file is a text file, it is possible to directly edit it via text-editor instead of through the built-in GUI. Most things can be edited through the in-game GUI, however, there are some things that you can only add via text-editor. Settings that can only be set by editing the config file directly will be discussed here. (Note: these can also be set in-game with the /localset or /bind commands).

Localset Options

 set highlightPattern "laser"
 set highlightPattern "laser|genocide"
 set highlightPattern "(Team Flag|Team's Flag|Genocide)"

highlightPattern highlights lines with the selected words when they appear in the console(chat box).

  • When highlighting one word, just type the word in quotes, such as "laser."
  • If one wants to highlight two or more words, the words must be separated with a '|', such as "laser|genocide" (highlights lines with laser OR genocide).
  • If any of the words have spaces, all the words must be surrounded in parentheses, such as "(Team Flag|Team's Flag|Genocide)" (highlights lines with "Team Flag," "Team's Flag," OR "Genocide").

 set linedradarshots 10
 set linedradarshots 65

linedradarshots sets how long shots are on the radar. While this option is set-able through the in-game GUI, you can only set this setting up to 10 via the GUI. You can hand-edit your config to give you longer shot lengths.

 set latitude 45
 set longitude 71

latitude and longitude set the latitude and longitude for BZFlag's sky rendering system.

Hint: To always have a black sky set latitude 90 (north pole) or -90 (south pole) for winter/summer respectively.

Binding Custom Keys

One can bind custom keys outside of those given in the in-game GUI.

The standard format for binding a key is as follows:

 bind <key> <keypresstype> <event>

For example, the following binding sets displayRadarRange, or how far the radar is zoomed, to 0.12, when the key '`' is pressed.

 bind ` down "set displayRadarRange 0.12"

One can use this template to set any of the options in the config file. However, some of the options, like radarsize need an additional function call that is only called via the options menu, and as such will do nothing if you bind them.

One can also use the toggle keyword instead of set to have a key toggle two options:

 bind F down "toggle linedradarshots 65"
 bind F down "toggle linedradarshots 65 10"

The first line toggles the length of shots on the radar between 65 and an understood 0. The second line toggles linedradarshots between 65 and 10. This is much easier than having two keys to switch between two options.

(Don't do this.)

 bind F down "set linedradarshots 65"
 bind G down "set linedradarshots 10"

To un-bind a key, just place a hash(#) at the front of the line, or remove the line completely. For example, to if one is tired of unintentionally hitting F12, he or she can simply disable it.

 #bind F12 down quit