Skip to content
These docs reflect Contracts v0.6.0, the latest release. Older servers may differ.

Presets

A preset is a named, reusable list of Rust item or entity shortnames. Define a list once (say, every scientist type) and reference it as @presetName from any objective or condition field that takes an item or entity list, instead of repeating the whole list in every contract.

Presets are stored in the preset_data.json data file and authored with the web editor.

A preset is simply a list of one or more shortnames, stored under a name you choose:

{
"presets": {
"scientists": ["scientist2", "scientist2.heavy", "scientistnpc_oilrig", "scientistnpc_patrol"],
"ballista": ["ballista.static", "ballista.mounted"]
},
"version": { "Major": 0, "Minor": 0, "Patch": 0 }
}

The name is the key; the value is the list. The plugin ships with a ready-made @scientists preset (every scientist NPC type) plus a handful of others.

Anywhere a field takes an item or entity list (entities, items, item, fish, bait, weapon lists, and so on), you can write @presetName in place of a literal shortname. At load time the plugin expands the reference into that preset’s list:

{
"type": "Kill",
"title": "Hunt scientists",
"amountRequired": 10,
"conditions": {},
"entities": ["@scientists"]
}

You can mix preset references and literal shortnames in the same list, for example ["@scientists", "scarecrow"].

A preset can reference other presets, so you can compose larger lists from smaller ones:

{
"presets": {
"weak_npcs": ["scarecrow", "murderer"],
"all_npcs": ["@scientists", "@weak_npcs"]
}
}

References are expanded recursively at runtime.

See the Objectives overview for more on shortnames and how item and entity lists are matched.