The four lists
The vanilla file is short, with four lists:
- categories: tools, containers, clothes, lootdispatch, food, weapons, books and explosives
- tags: floor, shelves and ground, which say where in a building an item can sit
- usageflags: the kind of place, such as Military, Police, Medic, Firefighter, Industrial, Farm, Coast, Town, Village, Hunting, Office, School, Prison, Lunapark, SeasonalEvent, ContaminatedArea and Historical
- valueflags: Tier1 to Tier4 plus Unique, which map to map areas from the coast (Tier1) to the inland military zones (Tier4)
How items and buildings meet
An item spawns somewhere only when the place and the item agree. A building's loot points carry usage flags and categories from mapgroupproto.xml, and the map area carries a tier. An item with usage Military and value Tier3 can spawn in military buildings in Tier3 areas, and nowhere else.
That's why removing all usage flags from an item stops it spawning, and why giving a gun the Town usage puts it in houses. See loot tiers explained.
The user file: your own groups
cfglimitsdefinitionuser.xml lets you name groups of existing flags so types.xml stays readable. Vanilla includes TownVillage (Town plus Village), and tier groups such as Tier12, Tier23, Tier34, Tier123, Tier234 and Tier1234.
In types.xml you can then write one user flag instead of listing each tier. It's a shorthand, not a new place: a user group only matches places that already carry one of its flags.
Make a custom loot zone
A popular use is keeping powerful weapons to one part of the map. Give those weapons only the Military usage and only the Tier4 value, and they'll spawn only at high tier military sites. To make a whole area special, combine this with gas zones, which have their own ContaminatedArea usage.
- Coast-only starter food: usage Coast and Village, value Tier1
- Police-only pistols: usage Police, values Tier1 to Tier3
- End-game rifles: usage Military, value Tier4
Adding brand new flags
You can add new names to these lists, but a new usage only helps if buildings or events use it too, which means editing mapgroupproto.xml or the event's spawn rules. Mods sometimes add their own flags and ship the matching building changes. On a vanilla server, use the existing flags and user groups; they cover nearly every idea.
How tiers are mapped
Tiers aren't drawn by hand in an XML file. Each map has an area map, a picture that marks which tier each part of the map belongs to. On Chernarus, Tier1 covers most of the coast, Tier2 the near inland towns, Tier3 the bigger inland areas and Tier4 the far north-west military zones such as Tisy. Livonia and Sakhal have their own areas.
Because the areas are fixed, the easy way to shape loot is to change the item's flags, not the map. Moving an item from Tier4 to Tier3 widens where it can appear without touching anything else.
Avoid broken flags
A flag in types.xml that isn't defined here is a common cause of items that never spawn, and of warnings in the server log at start up. Check spelling and capitals: Military is not military. If loot vanishes after an edit, look for a mistyped flag first.