Today I’m going to start a set “BZTips” postings. These will focus on some of the lesser known features of BZFlag. For this first posting, I will cover Client Side Chat Filtering.
Many servers have a chat filter set up to block profanity. But there are still quite a few that do not have such a filter. If you want to censor out profanity on those servers, there is a way built into the client to do this.
The method to accomplish this varies depending on the operating system, but it all involves passing -badwords to the BZFlag executable along with a path to the badwords file. Full directions provided in this article.
First of all, you need to get a list of swear words. I’d recommend getting the simpleSwearList.txt (Right click and save the file unless you want to learn new words…) from our SVN. For Windows users, I recommend you save this straight into the install directory for BZFlag (ex: C:\Program Files\BZFlag2.0.10\), and for OSX and Linux users, save it into your user or home directory, respectively. I typically delete everything except the English language words, since I don’t care about seeing profanity in languages I don’t know.
Now that you have the file saved, the general idea is to pass the following to the BZFlag executable:
Now for Windows, this is quite easy. Because you saved the file into the install directory, you don’t have to provide the path, since the ‘working directory’ is the installation path. So, right click on the shortcut you use to launch BZFlag, and then click on Properties. Go to the end of the Target line and add this:
Make sure to include a space before the hyphen. Here is what it will look like:
For OSX, I’m not sure of an easy method, nor can I verify if this works. But you should be able to start the Terminal application, then drag your BZFlag icon into the terminal. This should automatically type out the path to your BZFlag .app file. After that, you can then try typing the same text that was used for Windows just above here:
If that doesn’t work, then try typing the following, where “YourUsernameHere” is your username:
Advanced users could do something like an AppleScript or a shell script to do this automatically, but that goes beyond the scope of this article.
And for Linux, you can also do it via the Terminal, or you can edit the launcher for BZFlag. I will use Ubuntu 8.10 with Gnome as an example.
This assumes BZFlag was installed using the package manager. Go to System > Preferences > Main Menu.
From there, click on “Games” on the left, click on BZFlag, and then hit the Properties button. Edit the Command to look like it does in the screenshot (click for full sized image):
After that, click Close, and then Close again.
With all of that done, your client should filter out profanity, including text from private and team chat. The most common reason for this not working would be specifying the wrong path to your bad words file. Make sure you have it in the correct location, and worse case, use a full path to the file.