Matching - Exit-9B/InventoryInjector GitHub Wiki

Each rule has a match section that determines which objects should be manipulated by the rule.

SKSE provides many data fields which can be matched. They fit broadly into these types:

  • Enumeration - A value from a predetermined set, specific to each field.
  • FormID - The numerical ID assigned to each form. See the formId section below for details on how to match this type.
  • String - A text value.
  • Number - A numerical value.
  • Boolean - A true or false value.
  • Array - A list of multiple sub-values. For these properties, configurations can provide a single value or array of values that the array must contain. See the keywords section for an example.

Data can be matched in the following ways:

  • Exact value - The field must match the exact value provided, or if it is an array, it must contain the value.
  • Multiple values - The field can match any of multiple values, specified by an object with the "anyOf" property. (See formId for an example).
  • Numerical range - For numerical fields, it can match a range of values, specified by an object with the "min" and/or "max" properties.

Common Data

The following fields are available on every object type.

formType

Specifies the type of form this rule applies to. It is recommended to always supply this value, as it can dictate how other data is handled, such as subType assignment.

Type: Enumeration

Values:

  • Ammo
  • Armor
  • Book
  • Enchantment
  • Ingredient
  • Key
  • Light
  • MiscItem
  • Potion
  • Scroll
  • Spell
  • SoulGem
  • Weapon

Example:

"match": {
  "formType": "MiscItem"
}

formId

The FormID of the object.

Type: FormID

FormIDs are specified by the filename of the plugin and the relative FormID, separated by a vertical bar (|).

Example:

"match": {
  "formType": "MiscItem",
  "formId": "Dragonborn.esm|247F9"
}

You may also want to specify multiple FormIDs, in which case you can create an object with the "anyOf" property to specify them in an array.

Example:

"match": {
  "formType": "Book",
  "formId": {
    "anyOf": [
      "Skyrim.esm|DDEFB",
      "Skyrim.esm|EF07A",
      "Skyrim.esm|F33CD",
      "Skyrim.esm|F33CE",
      "Skyrim.esm|F33CF",
      "Skyrim.esm|F33D0",
      "Skyrim.esm|F33D1",
      "Skyrim.esm|F33D2",
      "Skyrim.esm|F33D3",
      "Skyrim.esm|F33D4",
      "Skyrim.esm|F33D5",
      "Skyrim.esm|F33E0"
    ]
  }
}

keywords

Keywords assigned to an object.

Type: Array of String

Example:

"match": {
  "formType": "Weapon",
  "keywords": "WeapTypeSpear"
}

Armor Data

The following fields are available for Armor forms.

parts

All biped object slots used by the Armor.

Type: Array of Number

Example:

"match": {
  "formType": "Armor",
  "parts": [ 31, 32 ]
}

mainPart

The main biped object slot used by the Armor.

Type: Number

Each armor slot is a number between 30 and 61. When an armor has multiple slots, the main part is determined by earliest slot that it occupies from the following precedence list:

  • 32 - Body
  • 31 - Hair
  • 33 - Hands
  • 34 - Forearms
  • 37 - Feet
  • 38 - Calves
  • 39 - Shield
  • 35 - Amulet
  • 36 - Ring
  • 41 - Long Hair
  • 43 - Ears
  • 30 - Head
  • 42 - Circlet
  • 40 - Tail
  • 44 - Unnamed
  • 45 - Unnamed
  • 46 - Unnamed
  • 47 - Unnamed
  • 48 - Unnamed
  • 49 - Unnamed
  • 50 - Decapitate Head
  • 51 - Decapitate
  • 52 - Unnamed
  • 53 - Unnamed
  • 54 - Unnamed
  • 55 - Unnamed
  • 56 - Unnamed
  • 57 - Unnamed
  • 58 - Unnamed
  • 59 - Unnamed
  • 60 - Unnamed
  • 61 - FX01

Example:

"match": {
  "formType": "Armor",
  "mainPart": 46
}

weightClass

The weight class of the Armor. Non-armor items are classified as Clothing or Jewelry based on their keywords.

Type: Enumeration

Values:

  • Light
  • Heavy
  • None
  • Clothing (VendorItemClothing keyword)
  • Jewelry (VendorItemJewelry keyword)

Example:

"match": {
  "formType": "Armor",
  "weightClass": "Heavy"
}

armor

Type: Number

isEnchanted

Type: Boolean

Ammo Data

The following fields are available for Ammo forms.

flags

Type: Array of Enumeration

Values:

  • IgnoresNormalWeaponResistance
  • NonPlayable
  • NonBolt

damage

Type: Number

isEnchanted

Type: Boolean

Weapon Data

The following fields are available for Weapon forms.

weaponType

The animation type of the Weapon.

Type: Enumeration

Values:

  • HandToHandMelee
  • OneHandSword
  • OneHandDagger
  • OneHandAxe
  • OneHandMace
  • TwoHandSword
  • TwoHandAxe
  • Bow
  • Staff
  • Crossbow
"match": {
  "formType": "Weapon",
  "weaponType": "TwoHandSword"
}

speed

Type: Number

reach

Type: Number

stagger

Type: Number

critDamage

Type: Number

minRange

Type: Number

maxRange

Type: Number

baseDamage

Type: Number

equipSlot

Type: FormID

damage

Type: Number

isEnchanted

Type: Boolean

isPoisoned

Type: Boolean

Soul Gem Data

The following fields are available for Soul Gem forms.

gemSize

The capacity of the Soul Gem.

Type: Enumeration

Values:

  • None
  • Petty
  • Lesser
  • Common
  • Greater
  • Grand

Example:

"match": {
  "formType": "SoulGem",
  "gemSize": "Greater"
}

soulSize

The size of the soul in the Soul Gem.

Type: Enumeration

Values:

  • None
  • Petty
  • Lesser
  • Common
  • Greater
  • Grand

Example:

"match": {
  "formType": "SoulGem",
  "soulSize": "Common"
}

status

Indicates how full the Soul Gem is.

Type: Enumeration

Values:

  • Empty
  • Partial
  • Full

Example:

"match": {
  "formType": "SoulGem",
  "status": "Partial"
}

Book Data

The following fields are available for Book forms.

flags

Type: Array of Enumeration

Values:

  • TeachesSpell
  • TeachesSkill
  • Read
"match": {
  "formType": "Book",
  "flags": "Read"
}

bookType

Distinguishes between Books and Notes. This data is not normally available in Skyrim SE, but I4 automatically sets the type to Note for any Book that has "Note" in its 3D model filename.

Type: Enumeration

Values:

  • Book
  • Note

Example:

"match": {
  "formType": "Book",
  "bookType": "Note"
}

teachesSkill

Type: Enumeration

Values:

  • OneHanded
  • TwoHanded
  • Marksman
  • Block
  • Smithing
  • HeavyArmor
  • LightArmor
  • Pickpocket
  • Lockpicking
  • Sneak
  • Alchemy
  • Speechcraft
  • Alteration
  • Conjuration
  • Destruction
  • Illusion
  • Restoration
  • Enchanting

teachesSpell

Type: FormID

Common Magic Data

The following fields are available for Spell, Scroll, Ingredient, Potion, and Enchantment forms.

spellName

Type: String

magnitude

Type: Number

duration

Type: Number

area

Type: Number

effectName

Type: String

effectFlags

Type: Array of Enumeration

Values:

  • Hostile
  • Recover
  • Detrimental
  • SnapToNavMesh
  • NoHitEvent
  • DispelWithKeywords
  • NoDuration
  • NoArea
  • FXPersist
  • GoryVisuals
  • HideInUI
  • NoRecast
  • PowerAffectsMagnitude
  • PowerAffectsDuration
  • Painless
  • NoHitEffect
  • NoDeathDispel

school

Type: Enumeration

Values:

  • Alteration
  • Conjuration
  • Destruction
  • Illusion
  • Restoration

skillLevel

Type: Number

archetype

Type: Enumeration

Values: Effect Archetypes (remove spaces)

deliveryType

Type: Enumeration

Values:

  • Self
  • Touch
  • Aimed
  • TargetActor
  • TargetLocation

castType

Type: Enumeration

Values:

  • ConstantEffect
  • FireAndForget
  • Concentration
  • Scroll

primaryValue

Type: Enumeration

Values: Actor Values

resistance

Type: Enumeration

Values:

  • DamageResist
  • PoisonResist
  • FireResist
  • ElectricResist
  • FrostResist
  • MagicResist
  • DiseaseResist

Spell Data

The following fields are available for Spell and Scroll forms.

spellType

Type: Enumeration

Values:

  • Spell
  • Disease
  • Power
  • LesserPower
  • Ability
  • Poison
  • Enchantment
  • Potion
  • WortCraft
  • LeveledSpell
  • Addiction
  • VoicePower
  • StaffEnchantment
  • Scroll

trueCost

Type: Number

equipSlot

Type: FormID

Potion Data

The following fields are available for Potion forms.

flags

Type: Array of Enumeration

Values:

  • ManualCalc
  • Food
  • Medicine
  • Poison