Zone Object
Work In Progress
We are working on updating and improving this documentation. Some information may be missing or inaccurate.
Description
Zones are rectangular areas that can be used to control flag spawns, player spawns, and team flag safety zones.
Both the flag and zoneflag attributes cause flags of specific types to spawn within them. The difference is that the flag attribute only applies to flags added using the server options -f or -s/+s. The zoneflag attribute will add the specified quantity of flags to the world and spawn them within that specific zone.
The team attribute will control where tanks of a given team are allowed to spawn. This can be very useful for worlds with team base structures to force players to spawn inside their respective base.
When a team flag is dropped in an unsafe location, such as over a pyramid or other angled surface, it will fly to the nearest safety zone. By default, without any safety zones explicitly defined in the world, a safety zone at 0, 0, 0 is created for each team. If all safety zones are covered by solid obstacles, the team flag will instead fly back to the team base.
Attributes
| Syntax | Description |
|---|---|
| name <name> |
Sets the name of this object. In many cases, this does not have any purpose and may just be useful for documenting what the object is for. In some case, like for teleporters, this can be used to reference the object from other objects. |
| position <x> <y> <z> |
This controls the absolute position of the object, lined up with the bottom center of the object. The center of the world, at ground level, is 0 0 0. |
| size <x> <y> <z> |
This controls the size of the object. It accepts three floating point numbers for the X, Y, and Z size of the object. Z is up. |
|
rot <angle> rotation <angle> |
Objects can be rotated on the Z axis, with the angle being specified in degrees. Extremely old worlds may use radians and will need to be converted, since BZFlag 1.7e0 used radians, and this was changed to use degrees in BZFlag 1.7e4. |
|
flag good flag bad flag <flag_abbreviation> |
Normally, flags added explicitly using the server option +f or randomly using the server options -s and +s will spawn randomly in the world, or in the case of team flags, on the matching team base. This option instructs the server to only spawn flags of the specified type inside of this zone. This is repeatable, so multiple flag attributes can be specified in a single zone to include multiple flag types. If multiple zones exist with the same flag type, the flags will be randomly distributed across the zones. Flags added to the world using the "zoneflag" attribute of another zone will not be forced to spawn inside of a zone that has a matching "flag" attribute. |
|
zoneflag good <quantity> zoneflag bad <quantity> zoneflag <flag_abbreviation> <quantity> |
Unlike the "flag" attribute, the zoneflag attribute actually adds additional flags to the world and places them inside of this specific zone. This is repeatable to add multiple types of flags to a zone. Using the "good" or "bad" shortcuts will add every single flag of a given category at the quantity specified, so "zoneflag good 5" would add 5 of every good flag. |
| team <team_index> |
Normally, player tanks can spawn anywhere in the world. The team attribute creates a spawn zone for a given team that causes spawns to only occur inside of the zone. Multiple zones can be created and spawns would be randomly distributed between them. |
| safety <team_index> |
Syntax Examples
# Add some Guided Missile and ShockWave flags, and 10 other random good flags (except for Stealth)
options
+f GM{5}
+f SW{5}
-s 10
+s 10
-f ST
-f bad
end
# Tell good flags to spawn here
zone
position 50 0 0
size 10 10 0
flag good
end
# Add and spawn some Stealth flags here
zone
position -100 0 0
size 0 0 0
zoneflag ST 10
end
This content is maintained on GitHub. We welcome any feedback and improvements!