Prototypes, not individual buildings
The file is a list of prototypes, one per building model, such as Land_House_1W01. Every copy of that model on the map uses the same prototype. Where those copies are is a separate file, mapgrouppos.xml, which lists each building instance and its position.
So a change to one prototype changes every building of that type across the map. That's powerful, and it's why careless edits can flood a map with loot.
Usage: what kind of place it is
Each group starts with usage flags, such as Village, Military or Police. These are the same words defined in cfglimitsdefinition.xml and used in types.xml. Only items with a matching usage can spawn in that building. See cfglimitsdefinition.xml explained.
Containers and loot points
Inside a group are containers, such as lootFloor and lootshelves. Each container lists the categories it accepts (tools, food, weapons and so on), a tag saying where the loot sits (floor, shelves or ground), and a set of points. Each point has a position relative to the building, a range and a height, which together make a small area loot can appear in.
lootmax: how much a building holds
The defaults at the top of the file set how many items can spawn at once: 6 per building (group) and 4 per container in vanilla. A group or container can set its own lootmax instead. Raising these is how "more loot per house" servers work, but it multiplies across every building of that type, so small steps go a long way.
More loot points in a building doesn't mean more loot on its own. The economy still only spawns what types.xml allows. If items are scarce, raise nominal first. See how to increase loot.
When editing it makes sense
Most changes are better made elsewhere. Edit mapgroupproto.xml when:
- A modded building has no loot because it has no prototype
- You want a building type to accept a new category, such as weapons in police stations
- You want a building type to hold more or less loot at once
- You're building a custom map area and need its buildings to spawn the right loot
How loot points are made
Hand-placing points is slow, because positions are relative to the building model. Bohemia's DayZ Tools include a way to place points visually and export the prototype, which is how mod and map makers do it. For small changes, such as adding a category or adjusting lootmax, editing the text directly is fine.
Worked example: weapons in police stations
To let police stations spawn more weapons:
- Search for the police station's group name in
mapgroupproto.xml - Check its usage is Police, so only police-flagged items can appear
- Add the weapons category to the containers you want, such as the shelves
- Make sure the weapons you want carry the Police usage in
types.xml - Restart, then judge it over a few hours as loot respawns
Edit it safely
The vanilla Chernarus file is over a megabyte, so use a proper text editor, search for the building's name and change only that group. Keep a copy of the original. After uploading, restart; loot already on the map stays until it despawns, so judge the result after a while or after a loot reset.