Docs/JSON
Item presets
Define reusable item configurations for loadouts and loot in presets.json.
How a freshly built item slot is filled in: condition, stack amount, and for
weapons the magazine, chambered round and attachments. Live: /scenario reload
applies it to everything built afterwards.
{
"apply_in": ["world", "corpse", "airdrop", "npc"],
"classes": {
"*": {
"amount": "1..default"
},
"Weapon": {
"condition": [25, 100]
},
"Light": {
"condition": [25, 100]
},
"NVG": {
"condition": [25, 100]
}
},
"items": {
"AKM": {
"condition": [40, 90],
"magazine": {
"item": "AKM_Magazine",
"rounds": "full"
},
"chambered": true,
"attachments": [
{
"one_of": ["PSO-1", "Red_Dot"],
"chance_pct": 5
}
]
}
}
}
(The shipped default has an empty items; the AKM entry above is an example.)
Contexts#
Everything that creates an item calls the same builder with a context:
| Context | Used for |
|---|---|
world | Containers and ground loot rolls, rule add/replace, crash crates |
corpse | The gear of a dead AI |
airdrop | Airdrop crate contents |
npc | The weapon an AI is equipped with |
kit | Loadout entries that ask for a preset (starting kits) |
apply_in lists the contexts that use presets. A context that is not listed
gets the item's plain template (full condition, template amount). kit always
applies, and only the items presets, never the classes. Items given by an
admin (/give, player:give) are never preset: they are exactly what was asked.
Resolution#
For each item, each field is taken from the first of these that sets it:
items.<name>, then classes.<Subtype>, then classes.<Type>, then
classes["*"]. Class keys are the exported item subtype and type (for example
Weapon, Light, NVG, Ammo); "*" matches every item. A layer can change
one field of an inherited entry without repeating the others, and null for a
whole class or item entry deletes it.
Fields#
| Field | Value | Meaning |
|---|---|---|
condition | [lo, hi], 0 to 100 | Condition in percent, uniform and inclusive. Absent: the template's (100). |
amount | "1..default", "default" or [lo, hi] (1 to 10000) | "1..default" is a random stack from 1 to the item's default amount (only for items that have one); "default" the full default amount. |
frozen_chance_pct | 0 to 100, or null | Replaces loot.json frozen.base_chance_pct for this item. null clears a value set by a class. |
magazine | { "item", "rounds" } | Items only. The magazine item must be one of the weapon's compatible items and a magazine. rounds is "full" (the magazine's default amount) or [lo, hi] not above it. Sets the weapon's loaded rounds. |
chambered | bool | Items only. Whether a round starts in the chamber. |
attachments | list | Items only. Each entry is { "item": X } or { "one_of": [X, Y] } plus chance_pct (0 to 100, default 100). Every item must be compatible with the weapon (otherwise the load fails with <item> is not compatible with <weapon>). |
A weapon with a magazine or attachments gets them as its nested items. For
AI weapons (npc context), an item preset with a magazine or attachments
replaces the random 5 % attachment and the magazine pick of the AI's equipment
roll; the AI's own random condition rule is ignored when its variant is
FullCondition.
storage and cargo (items inside backpacks) are reserved for later and
rejected with a clear error: the server cannot place nested storage yet.
Validation#
Unknown keys, ranges outside the limits, unknown or ambiguous item names and
incompatible magazines or attachments are reported with the file, the key path
and the reason; they stop startup, or keep the running scenario on
/scenario reload.
Found a mistake or missing detail? Tell us in the Discord.
rtv-mp