Code: Select all
======================================================================== DYNAMIC LINK LIBRARY : teamFlagControl Project Overview ======================================================================== The teamFlagControl plugin can be used to control the team flags that show up in Capture-The-Flag (CTF) mode. This initial version only supports moving the team flag(s) to a specific location when the first team member joins and when the flag is captured. While this is also possible by creating a safety zone, this plugin still allows a flag to be "passed" to the center of the map (or to a real safe zone) by dropping the team flag over an unsafe area, such as over a pyramid. ===================== License ===================== The teamFlagControl plugin is licensed under the GNU LGPL 2.1. This plugin uses code and ideas from the flagStay plugin (available in the official BZFlag source repository) which is also licensed the same. ===================== Project History ===================== Version 0.1 - December 5, 2009 * Initial release * Contains a simple 'teamflagspawnzone' object for controlling where a team flag will spawn initially and after a capture. ===================== Todo List ===================== * Support multiple teamflagspawnzone objects per team. Currently the team flag will be moved to the last zone for that team if more than one exist. * Support a general area (box or cylinder) for the teamflagspawnzone area. This would make it act more like the safety zones. In this version, it only supports moving the flag to an exact position. * Anti-flag run logic. I want to prevent a team member from moving their own flag outside of a designed area or areas. If this occurs, the team flag would be dropped and moved back to where it was grabbed. ===================== Usage ===================== The plugin does not take any command line options, so you can simply load it. The plugin only been tested by loading straight from the command line (via the -loadplugin option) and NOT from in-game (via the /loadplugin command). Therefore, it is recommended that you load it from the command line. Just loading the plugin won't do anything though. You also need to modify your world file, as the plugin uses an additional map object. Here is a simple example map that demonstrates the teamflagspawnzone object: #--SNIP-- base position 50 0 0 size 10 10 0 color 1 end base position 0 0 0 size 10 10 0 color 2 end teamflagspawnzone position 25 -5 0 team 1 end teamflagspawnzone position 25 5 0 team 2 end #--SNIP--
IMPORTANT: This plugin will NOT work for a any of the officially released 2.0.x servers. A bug in bzfs prevented team flags from being moved via the plugin API. I did commit the change (8 days ago) to the official BZFlag SVN repository under the v2_0branch. So you have two options. You can either build the latest v2_0branch code (get v2_0branch, not trunk). Or you can manually patch your code base. Because of the changes required, it will not be possible for someone to compile this for 2.0.12, 2.0.10, 2.0.8, or anything older.