Wiki menu
events.xml in DayZ: vehicles, crashes and animals
How DayZ events.xml spawns cars, helicopter crashes, animals and infected: nominal, min, max, radii, flags, positions and children, with a real entry.
Cars, helicopter crashes, police wrecks, animals and groups of infected do not come from types.xml. They are dynamic events: events.xml says how many of each run at once, and cfgeventspawns.xml says where they may appear.
Where the files are
The events are in db/events.xml of the mission folder, their positions in cfgeventspawns.xml in the mission root. A car still needs its own entry in types.xml in DayZ: every field explained, and its parts come from cfgspawnabletypes.xml in DayZ: attachments, cargo and damage.
A real entry: Ada 4x4 on Chernarus
<event name="VehicleOffroadHatchback">
<nominal>8</nominal>
<min>5</min>
<max>11</max>
<lifetime>300</lifetime>
<restock>0</restock>
<saferadius>500</saferadius>
<distanceradius>500</distanceradius>
<cleanupradius>200</cleanupradius>
<flags deletable="0" init_random="0" remove_damaged="1"/>
<position>fixed</position>
<limit>mixed</limit>
<active>1</active>
<children>
<child lootmax="0" lootmin="0" max="5" min="3" type="OffroadHatchback"/>
</children>
</event>The economy keeps 8 instances of this event on Chernarus, between 5 and 11, never closer than 500 m to a player or to each other, and removes ruined cars so new ones can spawn. In the game file the event has one child per color of the car; the block above shows the child for this classname.
Every field
| Field | What it does |
|---|---|
name | Event name. Vehicle events start with Vehicle, animals with Animal, infected with Infected, crashes and wrecks with Static. |
nominal | How many instances the economy keeps running. |
min, max | Lower and upper limit for the number of instances. |
lifetime | Timer of the event itself, in seconds. A spawned car is a normal object afterwards: how long it persists is set by its entry in types.xml. |
restock | Seconds to wait before a new instance can spawn. |
saferadius | No spawn closer than this to a player, in meters. |
distanceradius | Minimum distance between two instances of the event, in meters. |
cleanupradius | An instance is not cleaned up while a player is closer than this, in meters. |
flags | deletable: the economy may delete instances; init_random: randomise the first spawns; remove_damaged: remove ruined instances so new ones can appear. |
position | fixed: positions from cfgeventspawns.xml; player: around players; uniform: random places on the map. |
limit | How min and max apply to the children: child counts each child separately, mixed counts them together, custom uses the min and max of each child. |
active | 1 runs the event, 0 switches it off. |
children | What the event spawns: a classname with its own min and max, and lootmin, lootmax for loot around it. |
Positions
A fixed event can only spawn where cfgeventspawns.xml lists positions for it: <event name="VehicleOffroadHatchback"><pos x="..." z="..." a="..."/></event>, where x and z are map coordinates and a is the rotation. If nominal is higher than the number of free positions, the extra instances never appear.
Common changes
- More cars: raise nominal and max of the event and max of its children, and make sure there are enough positions.
- No helicopter crashes: set active to 0 in the crash event.
- A car from a mod: a new event with its children, positions in cfgeventspawns.xml, an entry in types.xml and the parts in cfgspawnabletypes.xml.
Why cars do not spawn
- No positions for the event in cfgeventspawns.xml, or fewer than nominal.
- The limit is already reached: old cars still exist somewhere on the map.
- saferadius or distanceradius is so large that most positions are blocked.
- A typo in the child classname.
- Cars spawn but without wheels or a battery: the part chances in cfgspawnabletypes.xml are below 1.
Vehicles in the database
Vehicle pages in the item database list every event that spawns them on each map, with nominal, min, max and lifetime: Vehicles. Their parts are in Vehicle parts.
