Core Impact Framework - API Usage
Table of Contents
- Introduction
- Prerequisites
- Location of JSON Files
- Impact Mapping
- Hit Mapping
- Filters
- Modifiers
- Biped Mapping
- Testing in the Game
π Introduction
The Core Impact Framework (CIF) is an advanced and modular overhaul of Skyrim's impact system, designed to offer fine-grained customization of interactions between weapons, projectiles, and actors in the game. This framework allows for the adjustment, modification, and enrichment of impact effects in a wide variety of situations, making combat more immersive and dynamic. With a flexible system of filters and modifiers, it gives mod creators precise control over how impacts are managed based on context.
For example, CIF can adapt effects based on the armor worn by the target, differentiating impacts on heavy armor, light armor, or simple clothing. However, it goes beyond that: the impact calculation is done based on each piece of armor and the position of the impact. This means that the system evaluates the specific piece of armor the impact hits and applies effects accordingly.
In addition to this, the target's state, equipment, type of weapon used, the nature of the attack, and many other parameters can influence the result. Numerous filters and options allow for fine-tuning every detail, and everything is fully documented in this presentation.
πΉ Available Filters
Filters allow for further refinement of impact management based on several criteria:
- Global factors: Global variables, custom conditions, race, actor, material type, keywords.
- Equipment: Armor type (heavy, light, clothing) and specific skins.
- Biped slot: Specific body slots the equipment affects.
- Weapons & projectiles: Generic types (sword, axe, bow, magicβ¦) or specific weapons and projectiles.
- Type of attack: Normal hit, power attack, bash. Sneak or critical strike.
- Blocking: Heavy shield, light shield, parry with weapon, or unblockable hit.
- Target state: Alive, dying, in killmove, dead.
- Thresholds: Maximum health and minimum required damage.
Thanks to this approach, CIF allows for deep customization, providing a more realistic, varied, and impactful combat experience.
πΉ Advanced Modifiers
The CIF modifiers offer in-depth customization of impacts with a multitude of options. You can not only adjust visual, sound, and dynamic effects but also influence elements such as blood splatter, objects appearing after a hit, or specific sounds associated with each impact.
Here are some examples of possible modifiers:
- Dynamic blood splatter effects.
- Modifications of impact data (visual and physical effects).
- Preservation, replacement, or removal of sounds and decals.
- Adding additional or custom sounds.
- Applying spells on impact.
- Placing objects after the impact.
- Enabling a bounce effect on impacts (especially for arrows).
These modifiers offer maximum flexibility to make impacts even more immersive and varied.
π Prerequisites
Before starting this tutorial, and to save time, make sure you have the following skills:
- Basic knowledge of Creation Kit: You should understand the basics of Creation Kit, including creating and modifying elements within this environment.
- Basic knowledge of JSON: An understanding of JSON files and their structure is essential for correctly creating and modifying the files needed for the Core Impact Framework (CIF).
- Understanding of impacts in Skyrim: While not essential, a general knowledge of impact systems in Skyrim will help you better understand how the CIF interacts with the game.
If you're not comfortable with any of these skills or tools, it is recommended to acquire them before following this tutorial.
Great, now that we're all set up, let's dive into using the Core Impact Framework API.
π Location of JSON Files
The JSON files should be placed in Data/SKSE/CoreImpactFramework
. The exact organization of these files doesn't matter as long as they remain in this directory.
You are free to organize them in subfolders as you see fit.
Similarly, there are no specific rules for naming the files: you are completely free to name them however you like.
In summary: as long as they are in this folder, everything is fine. The rest is up to you! β
π Impact Mapping - Structure and Functioning
{
"ImpactMapping": [
{
"Comment": "Replaces the head impact (biped slot 30) with sparks for heavy armor when struck by arrows.",
"Priority": 10,
"Filters": {
"Materials": ["Skyrim.esm:0x12F3F"],
"BipedSlot": [31],
"ArmorClasses": ["Heavy"],
"WeaponsType": ["Ranged"],
"Blocked": ["No"]
},
"Modifiers": {
"ImpactData": "Skyrim.esm:0xF69C4"
}
}
]
}
ImpactMapping
is an array in your JSON file that allows you to define rules for customizing impacts.
Each object in this array contains:
- Filters (conditions): to check if the rule should apply.
- Modifiers (actions): defines the effect applied if the conditions are met.
- Priority (optional): defines the evaluation order when multiple rules are valid.
This system allows you to adapt impacts based on a multitude of in-game situations.
β οΈ Important: ImpactMapping
is strictly intended to replace visual and sound elements related to impacts. It is crucial to adhere to this rule, as once overrides are processed, only a single compiled ImpactMapping will be retained. Misusing this system to apply third-party, non-visual effects may interfere with other mods attempting to display impact visuals, leading to missing or incorrect effects.
For any functionality you wish to implement that does not directly affect visuals or sounds (such as using a spell to launch a script or apply damage, for example), please use Hit Mapping instead. HitMapping
is more permissive and supports stacking, allowing multiple entries to be executed together without overwriting each other.
πΉ Priority - Rule Priority
The Priority
field defines the order in which rules in the ImpactMapping
are processed.
A rule with a higher priority will be applied first and can override those with lower priority.
This system allows for the addition of exceptions and specific behaviors based on the importance of the rules.
πΉ Filters - Conditions to Validate
When an impact occurs, the Filters
are evaluated. All conditions must be met for the Modifiers
to be applied.
π Important Notes:
- An empty filter group is always valid.
- Filters are inclusive: all conditions must be met to be validated.
- In a filter array (
array
), the values work in OR. Example:- A ranged weapon with 3 different projectiles means that only a ranged weapon will be considered,
- But it must use at least one of the 3 listed projectiles.
- β οΈ The only exception:
Global
andConditions
work in AND, all must be validated.
πΉ Modifiers - Actions to Perform
The Modifiers
are the actions that will be executed once the Filters
have been validated.
These actions allow you to replace or enhance the impact effects, adding sound effects, visual effects, or modifying the behavior of the impacts in the game.
The specific details of each Modifier
element will be covered in a later step. For now, just remember that these are the actions that will truly customize the impact once the filters are validated.
πΉ Other parameters
Override : When this parameter is enabled (true
), the framework continues to process objects even if the filters are valid.
The Modifiers
of the highest-priority objects will be kept and will override those of subsequent objects. This allows for the merging of multiple rule sets for the same impact event, where the highest-priority Modifiers
take precedence.
For example, one set of rules might replace the sound effect, while another sets a new decal to be displayed, all within a single impact event. You can use this parameter as many times as necessary to create layered and varied effects.
OverrideMerge : This parameter, used in conjunction with Override
, is less commonly used but allows merging array-type elements (such as ExtraImpactData
) with those of lower-level objects.
When OverrideMerge
is enabled, the array elements will be added to those already present in the subsequent objects, rather than completely replacing them. This allows you to enrich effects without removing existing data, offering more flexibility in customizing impacts.
π Hit Mapping - Structure and Functioning
{
"HitMapping": [
{
"Comment": "Plays a sound and a slight magical effect upon impact.",
"Priority": 10,
"Class": "MyCustomEffects",
"Filters": {
"Materials": ["Skyrim.esm:0x12F3F"],
"Blocked": ["No"]
},
"Modifiers": {
"ExtraImpactData": ["Skyrim.esm:0x7331F"],
"ExtraSound": ["Skyrim.esm:0x51939"]
}
},
{
"Comment": "When a hit is made to the head, in addition to the previous sound effect, the magical effect is replaced by a new, more dazzling one.",
"Priority": 20,
"Class": "MyCustomEffects",
"Override": true,
"Filters": {
"Materials": ["Skyrim.esm:0x12F3F"],
"BipedSlot": [31],
"Blocked": ["No"]
},
"Modifiers": {
"ExtraImpactData": ["Skyrim.esm:0x105F36"]
}
}
]
}
HitMapping
is an array in your JSON file that defines additional rules for handling impacts, similar in structure to ImpactMapping
but intended for different use cases.
While ImpactMapping
is strictly reserved for replacing visual and sound effects related to impacts, HitMapping
is specifically designed for gameplay-related modifications that do not directly affect visuals or sounds. It supports stacking, allowing multiple entries to coexist and be executed together without overwriting each other.
The elements of HitMapping
are:
- Priority: sets the evaluation order of rules.
- Class: π₯ Only for
HitMapping
. See the explanation below. - Override: Replaces or adds modifiers from lower-priority objects if they are not present, keeping other properties intact.
- OverrideMerge: A less commonly used parameter that works with
Override
to merge array-type elements from lower-priority objects. - Filters: to determine if the rule applies.
- Modifiers: defines the effects applied if the conditions are met.
πΉ Class - Grouping and Overriding Objects
The Class
parameter is a new addition that enables the use of the override system across multiple objects sharing the same class name. When you define a Class
for an entry, it allows all objects with the same class name to either override or merge their modifiers depending on the Override
setting. This provides greater control and flexibility when you want to apply specific behaviors or effects to a group of similar objects without needing to manually manage each individual entry.
For the override system to function correctly, it is mandatory to define a Class
. If no Class
is provided, the override mechanism will not be applied, and the object will remain independent. The Class
parameter should be a string value, preferably concise and clear, to ensure ease of use and avoid conflicts with other class names.
πΉ Filters - Conditions to Validate
Filters in HitMapping
are identical to those used in ImpactMapping
.
Please refer to that section for a detailed explanation of how filters work.
πΉ Modifiers - Actions to Perform
β οΈ Only specific modifiers are available for HitMapping
. Modifiers that directly alter the primary visual or audio effects of an impact are reserved for ImpactMapping
and cannot be used globally through HitMapping
.
The following modifiers are available for use in HitMapping
to customize the impact effects:
- BloodSpray: Casts a gore spell toward the impact direction with physics adjustments.
- ExtraImpactData: Adds extra visual impact effects without sounds or decals.
- ExtraSound: Plays additional sound effects on impact.
- Spells: Instantly casts spells on the hit target.
- PlacedObjects: Places objects at the exact point of impact.
π Filters
Each filter is a condition that must be met for the modifiers to be applied. It's not necessary to declare all filters, only the ones you wish to use should be defined.
Filters are inclusive, meaning all conditions within the same group must be fulfilled to be valid. However, within the arrays of each filter, the values work in OR:
for example, if a weapon (WeaponsType
) is filtered by the "Ranged" type and you have declared 3 specific projectile IDs (Projectiles[...]
), it will mean that only ranged weapons will be compatible,
but one of the three listed projectiles must be used by the weapon for the condition to be validated.
The only exception to this OR system is for Global Variables and Conditions, which must all be validated for the filter to be considered fulfilled. In other words, if multiple Globals or Conditions are defined, they function in AND, and each condition must be satisfied for the modifiers to apply.
π Before moving on to the filter list, here are a few clarifications on the use of FormID and EditorID in the JSON:
FormID
: Any FormID must be formatted as follows:"Skyrim.esm:0x123456"
. This format is valid for all filters where a game element is required. If a FormID is incorrect or cannot be found, an error will be logged in theCoreImpactFramework.log
file.EditorID
: This is the name of the element as it appears in the Creation Kit. Unlike FormID, the EditorID does not require the plugin name where the element is located. However, its use is limited to certain types of variables, notably Global Variables and Races. If you are unsure of an EditorID's compatibility for a given filter, it is recommended to use a FormID to avoid any issues.
Complete List of Filters
Parameter | Description and Possible Values |
---|---|
Globales |
Description: Defines conditions based on global game variables. Each entry consists of three elements: the global variable (EditorID or FormID), a comparison operator, and a value (integer or float). This is useful for triggering effects only when specific global game states are met. Possible Values: Array of 3 elements:
Example:
|
Conditions |
Description: Array of perk FormIDs to check against. When using a perk for this purpose, it is unnecessary to fill in entry points because only the conditions linked to the perk will be evaluated. Important: In these conditions, Possible Values: Example:
|
Races |
Description: Restricts effects to specific array of actor races. Can use Possible Values: Example:
|
Keywords |
Description: Matches any of the listed keywords against the relevant actor. Keywords are a great way to group specific races or actors under a common label, making it easy to target them. Possible Values: Example:
|
Skins |
Description: Checks if the actor has one of the listed skin armors equipped. Only Possible Values: Example:
|
Materials |
Description: Checks if the actor race has one of the listed material type. Only In most cases, it is the ID associated with the Possible Values: Example:
|
FormID |
Description: Filters based on the FormID of the target actor, either the placed reference or its base object. Useful for applying specific effects to particular actors or creatures. Possible Values: Example:
|
BipedSlot |
Description: Filters based on the affected body slot(s). Accepts β οΈ In order for the BipedSlot filter to work, make sure the targeted actors have a proper Biped Mapping associated with them (see the chapter below). If you're dealing with vanilla creatures, they should already be covered by the mod, so you don't need to worry about it. Possible Values: Example:
|
ArmorClasses |
Description: Restricts conditions to certain armor types. Use this to apply different effects based on how heavily armored a character is. Possible Values: Example:
|
WeaponsType |
Description: Filters by weapon type. Covers all major categories: swords, axes, maces, daggers, ranged weapons, magic, hand-to-hand, and even creature-based attacks. Essential for differentiating combat behavior and effects between melee, ranged, or magical combat styles. Possible Values: Example:
|
Weapons |
Description: Checks if the weapon used matches any in the provided list of Possible Values: Example:
|
Projectiles |
Description: Applies conditions based on the projectile used (arrows, bolts, magical missiles, etc.). Useful for tailoring effects to specific ammo types or magical attacks. Possible Values: Example:
|
Attacks |
Description: Restricts to specific attack types. This allows for fine-tuned control, such as triggering effects only on heavy attacks or bash. Possible Values: Example:
|
Blocked |
Description: Determines whether the attack was blocked, and how. Great for creating mechanics that respond differently depending on the method of defense. Possible Values: Example:
|
States |
Description: Filters based on the target's state. Useful to prevent effects from triggering on already-dead actors, or to add specific death animations or final blows. Possible Values: Example:
|
CriticalAttack |
Description: Filters based on whether the hit was a critical attack. Useful to apply special effects only during critical strikes. Possible Values: Example:
|
SneakAttack |
Description: Filters based on whether the hit was delivered while sneaking. Ideal for triggering specific effects for stealth attacks. Possible Values: Example:
|
Percentage |
Description: This value represents the chance for the condition to be valid. A random number between 0 and 100 is rolled when the impact happens. If this number is lower than the specified value, the condition is valid. For example, setting it to 80 means the filter has an 80% chance to be valid. Possible Values: Example:
|
MaxHealth |
Description: This value represents a percentage of the character's maximum health. As long as the current health is below the specified value, the condition will be valid. Possible Values: Example:
|
MinDamage |
Description: This value represents the minimum percentage of health that must be removed by the attack. As long as the damage dealt meets or exceeds the specified value, the condition will be valid. Possible Values: Example:
|
π Modifiers
Once the filters are validated, the following modifiers may be applied.
Parameter | Description and Possible Values |
---|---|
ImpactData |
Description: The primary impact effect applied upon hit, replacing the game's original effect. Possible Values: Example:
β οΈ This modifier is only available for |
BloodSpray |
Description: This spell is cast toward the direction of the blood spray and is used to generate visual gore effects upon impact. Each Magic Effect in the spell must have a projectile assigned, as each one triggers an individual blood spray. The first effect is launched at full velocity, while subsequent ones use reduced speed to simulate realistic blood physics. The framework automatically adjusts the velocity, so there's no need to modify the projectiles properties yourself. You can also use the CK Conditions menu to control whether the spell should be cast, offering flexibility in its application based on the context of the hit. Possible Values: Example:
|
ExtraImpactData |
Description: An array of additional impact effects applied upon hit. Each effect in the array will be played individually, but no sound or decal will be applied. Possible Values: Example:
|
ExtraSound |
Description: An array of additional sounds played upon hit. Possible Values: Example:
|
PreserveOriginalSound |
Description: Whether to keep the original impact sound in addition to the overridden one. This is only relevant if Possible Values: Example:
β οΈ This modifier is only available for |
PreserveOriginalDecal |
Description: Whether to keep the original impact decal in addition to the overridden one. This is only relevant if Possible Values: Example:
β οΈ This modifier is only available for |
SoundOverride |
Description: Sound effect that overrides the default impact sound, taking precedence over Possible Values: Example:
β οΈ This modifier is only available for |
DecalOverride |
Description: Decal effect that overrides the default impact decal. Possible Values: Example:
β οΈ This modifier is only available for |
RemoveDecal |
Description: Whether to remove the impact decal entirely. This takes precedence over all other settings related to decals. Possible Values: Example:
β οΈ This modifier is only available for |
RemoveBloodSplatter |
Description: Determines whether to force the game to disable default blood splatter generation on impact. π Note: This does not affect dynamic blood sprays. Possible Values: Example:
β οΈ This modifier is only available for |
ImpactBounce |
Description: Whether to allow physical projectiles, such as arrows, to bounce upon impact. Possible Values: Example:
β οΈ This modifier is only available for |
Spells |
Description: Array of spells cast when the modifier is triggered. The spells will be applied immediately, with the target being the actor hit and the subject being the one responsible for the hit. Possible Values: Example:
|
PlacedObjects |
Description: Array of objects placed in the world upon hit. These can be any visible object in the world. Most often, you will want to use explosions. The object will be placed precisely at the impact point. Possible Values: Example:
|
π Biped Mapping (For new races/creature only)
This section explains how to define the nodes associated with biped slots. These definitions enable the use of certain filters and features. In most cases, only the biped slots of NPCs capable of wearing armor will be used, but nothing prevents you from creating your own mapping for specific custom creatures.
Example: The following configuration shows how to define the mapping for Draugr.
{
"BipedMapping": [
{
"Priority": 20,
"Filters": {
"Races": ["DraugrRace", "DraugrMagicRace", "DLC2HulkingDraugrRace"]
},
"BipedBones": {
"31": ["NPC Head [Head]", "NPC Neck [Neck]"],
"32": ["NPC Spine [Spn0]", "NPC Spine1 [Spn1]", "NPC Spine2 [Spn2]", "NPC COM [COM ]", "NPC L Thigh [LThg]", "NPC R Thigh [RThg]", "NPC L UpperArm [LUar]", "NPC R UpperArm [RUar]"],
"33": ["NPC L Forearm [LLar]", "NPC R Forearm [RLar]", "NPC L Hand [LHnd]", "NPC R Hand [RHnd]"],
"37": ["NPC L Calf [LClf]", "NPC R Calf [RClf]", "NPC L Foot [LLft ]", "NPC R Foot [Rft ]"]
}
}
]
}
The table below shows the properties related to Biped Mapping. The priority system works the same way as for Impact Mapping, and the filters, though basic, also function in a similar manner.
Priority |
Description: The priority of the biped mapping. Higher values will be applied first. Negative values can also be used. Possible Values: Example:
|
Filters |
Description: Filters that define the characters this biped mapping will apply to. Fields within Filters:
Example:
|
BipedBones |
Description: The key (30, 31, etc.) represents the biped slot to which the nodes will be associated. Biped slots are listed in the Creation Kit when creating a piece of armor, so feel free to refer to it in order to choose the slot best suited to your needs. The linked array contains the list of node names associated with the biped slot. These nodes are represented by short character strings. You will find them in "skeleton.nif" files associated with the targeted races. You can open and analyze these files using NifSkope. Example:
|
π Testing in the Game
After configuring your JSON files, it is crucial to test your changes in the game to ensure they work as intended. If you encounter a crash when launching the game, it likely means that the structure of one of your JSON files is malformed (possibly an extra comma). Feel free to use tools like JSON Formatter to validate your JSON files or find potential errors.
Once the game is running, be sure to check the CoreImpactFramework.log
file (located in Documents\My Games\Skyrim Special Edition\SKSE
) for any errors or issues with your JSON files. Regularly check this file during your testing to identify and quickly correct errors. This will help you refine your configuration and ensure smooth integration into the game.