Wiki menu
cfgspawnabletypes.xml in DayZ: attachments, cargo and damage
How DayZ cfgspawnabletypes.xml spawns items with attachments, cargo and damage: chances, presets from cfgrandompresets.xml, hoarder and a real entry.
types.xml decides how many copies of an item spawn. cfgspawnabletypes.xml decides what each copy spawns with: the stock and sight on a rifle, the wheels on a car, food inside a backpack, and how worn it is.
Where the file is
It sits in the root of the mission folder, next to the db folder: mpmissions/dayzOffline.chernarusplus/cfgspawnabletypes.xml. Named lists that entries can reuse live in cfgrandompresets.xml in the same place. Like types.xml, both are read when the server starts.
A real entry: M4-A1 on Chernarus
<type name="M4A1">
<damage min="0.45" max="0.85"/>
<attachments chance="1">
<item name="M4_OEBttstck" chance="1"/>
</attachments>
<attachments chance="1">
<item name="M4_PlasticHndgrd" chance="1"/>
</attachments>
<attachments chance="1">
<item name="BUISOptic" chance="0.5"/>
<item name="M4_CarryHandleOptic" chance="1"/>
</attachments>
<attachments chance="0.1">
<item name="Mag_CMAG_40Rnd" chance="0.15"/>
<item name="Mag_CMAG_10Rnd" chance="0.5"/>
<item name="Mag_CMAG_20Rnd" chance="0.7"/>
<item name="Mag_CMAG_30Rnd" chance="1"/>
</attachments>
</type>In the current game version the rifle spawns 45 to 85% worn, always with a buttstock, a handguard and one of the listed sights, and in about one spawn out of ten with a magazine. Every <attachments> block is a separate roll.
Every tag
| Tag | What it does |
|---|---|
type name | The item this entry is for, by classname. |
damage min max | Wear at spawn, from 0 (pristine) to 1 (ruined), picked between min and max. |
attachments chance | One slot. The block chance decides whether the slot gets anything at all; the item chances inside decide which of the listed items it is. |
cargo chance | Something placed inside the item, for example food in a backpack. Works the same way as attachments. |
preset | Instead of listing items, a block can refer to a named list from cfgrandompresets.xml: <cargo preset="myFood"/>. |
hoarder | Marks a storage container such as a tent, barrel or crate. Items inside such containers are counted by count_in_hoarder in types.xml. |
How chances work
Chances are numbers from 0 to 1, not percentages: 1.0 always, 0.25 in a quarter of spawns. Blocks do not depend on each other, so a rifle with three optional blocks can get all three, one or none.
An attachment that does not fit a slot of the item is not attached. Check classnames and compatibility on the item pages before adding one.
Common changes
- Guns that always come with a magazine: raise the chance of the magazine block to 1.0.
- Cars with every part: set chance 1.0 on the wheel, door, battery and plug blocks of the car entry.
- Loot in better condition: lower the damage range, for example
<damage min="0.0" max="0.3"/>. - Backpacks with supplies: add a
<cargo>block with items or a preset.
Mistakes
- Chances written as percents (25 instead of 0.25).
- A typo in a classname: the item silently never appears.
- Expecting this file to change how many items exist. Counts are in types.xml in DayZ: every field explained; an item with nominal 0 does not spawn, whatever its cfgspawnabletypes entry says.
Entries for every item
Item pages in the item database show the vanilla cfgspawnabletypes block for each map, and attachments and car parts also list which items they spawn on: for example Attachments and Vehicle parts. Cars themselves come from events.xml in DayZ: vehicles, crashes and animals.
