Config File

From BZFlagWiki
Revision as of 06:33, 3 May 2012 by Allejo (Talk | contribs) (Typo: Aplication -> Application)

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.

Windows BZFlag 2.0

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

(You will need to replace [user] with whichever Windows user name you are currently logged in as.)

Windows BZFlag 2.4

XP: C:\Documents and Settings\[user]\Local Settings\Application Data\BZFlag\2.4\config.cfg
Vista / 7: C:\Users\[user]\AppData\Local\BZFlag\2.4\config.cfg

An easy way to get to the BZFlag config folder is to do windows key + r then copy/paste %LOCALAPPDATA%\BZFlag into the box and hit enter.

(You will need to replace [user] with whichever Windows user name you are currently logged in as.)

Mac OS X

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

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

Linux and unix platforms



Note: "~" is expanded to your home directory

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 <event> <press> <action>

The event is the key or button that was pressed (or a combination of keys) such as F or "Shift+Page Up". The double quotes are necessary if there are spaces. The press will be one of up, down, or both. If it is set to up, for example, if will only trigger when they key or button is released. And finally, the action is what will be triggered.

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 cannot be altered with this method.

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 implied 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"

You can also bind one key with two funtions:

bind E down fire
bind E up identify

This will make it so you can fire and lock-on with GM with the same button.

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

See Also