Pages

Add a guarded profile

Write a root mod-mappings.toml profile, guard it on the mod's content, and order it against other profiles.

A mod adds its own profiles in a root mod-mappings.toml. Guard one on the mod's content when it should apply only where that content is mounted.

The worked example

Put this file at the mod's mounted root:

version = 1

[[profile]]
id = "my-contact-family"
revision = 1
priority = 1
matcher = "legacy-stomp-v1"
ability = "stomp"
weapons = ["ASPID_STOMP"]
requires_weapons = ["ASPID_STOMP", "MY_MOD_LASER"]
evidence = "Observed contact weapon structure; native stomp behavior validated in this mod."

Selectors and guards

weapons restricts the profile to those case-insensitive weapon definition IDs. Omit it or use [] to consider every structurally matching weapon. A selector cannot force a weapon that fails the matcher to acquire an ability; use an explicit native binding for that.

Every requires_weapons entry must exist in the mounted weapon set before the profile applies. Missing guards make the profile inapplicable, without an error. Omit the array or use [] for an unguarded profile. Guards test content presence; they do not test a mod's display name or installation path.

Priority

Profiles are evaluated by descending integer priority, then increasing profile ID, independent of file or table order. Priority defaults to 0, which is also the bundled profile's priority. The first applicable profile claims each still-unbound matching weapon. Other profiles can handle the remaining weapons. An overlapping profile that selects the same native ability does not create a second application. The example's priority 1 takes precedence over generic coverage, so its profile revision identifies the effective selection.

Other domains

For feature profiles, use matcher = "legacy-nonblocking-heap-v1", obstruction = "pass-through", features and requires_features in place of the weapon fields. Selectors and guards have the same meaning within the mounted feature catalog. A profile cannot mix weapon and feature fields. Script-reference profiles instead require script_policy and mod. Their supported action is "owner-quarantine". They reject weapon and feature selector/action fields. Weapon-claim profiles require weapon_claims and mod and reject every other domain's fields. Rules profiles require rules and mod, and rules is valid for no other matcher. Projectile-rule profiles require mod and at least one non-stock rule among ballistic_expiry, fire_handler_precedence, endsmoke_explosion and explosion_ground_smoke, and reject every other domain's fields. All entrypoints validate every profile domain before applying their own domain.

Required fields

id, matcher and evidence are required nonempty strings; the matcher determines whether ability, obstruction or script_policy is required. revision is a positive 32-bit integer; update it when the profile's effective compatibility decision changes. Profile IDs must be unique across the bundled and mod libraries. Both optional selector fields must be arrays of nonempty strings; duplicate names ignoring ASCII case are errors. Unknown fields, wrong types, unsupported matchers, abilities or versions, duplicate IDs and malformed TOML reject loading with diagnostics. Version 1 mod libraries may contain only version = 1 when they add no profiles.

What goes wrong

A profile whose guards are absent is skipped, at debug level only:

mod compatibility: profile my-contact-family@1 skipped: required weapon set is absent

A profile that applies logs each weapon it maps:

mod compatibility: profile my-contact-family@1 mapped ASPID_STOMP to native stomp (structural compatibility heuristic)

Errors reject loading and name the file, the profile's index and the field:

mod compatibility: mod-mappings.toml: profile[0].matcher: unsupported matcher 'legacy-stomp-v2'
mod compatibility: mod-mappings.toml: profile[0].id: duplicate profile 'legacy-stomp-family-v1'
mod compatibility: mod-mappings.toml: profile[0].revision: required positive 32-bit integer
mod compatibility: mod-mappings.toml: profile[0].weapons: duplicate weapon 'ASPID_STOMP'
mod compatibility: mod-mappings.toml: profile[0].colour: unknown field

Next