Injection

Injection refers to a method of script modding that involves editing tuning at runtime, removing the need for overriding tuning files. It makes mods less likely to break with patches or conflict with other mods, and also makes them more flexible (e.g. adding an interaction to computers via an override will not work with CC, but injecting the interactions will).

Writing an injection script is not recommended for those inexperienced with script modding, as it can cause game-breaking issues when done incorrectly. For those with little script experience, using XML Injector by Scumbumbo and Triplis is recommended.

Uses
Injection can be used to modify just about any aspect of a tuning file, such as adding interactions or tags to objects, tests to test lists, loots to loot actions files, filter terms to sim filters, and much more. It is recommended that injection be done while the game is loading, which can be achieved by using the  method of the appropriate   (e.g. affordance manager for interactions, snippet manager for test sets, etc.).

This section is incomplete and needs further contribution.

Limitations
Injection can only be used on files processed by the Python codebase, meaning it cannot be used with SimData files or their associated tunings (e.g. the display name of a buff). This is because SimDatas are processed by the C++ codebase and are therefore inaccessible by Python. Attempting to inject to the tunings associated with SimDatas would result in a mismatch between the games logic (Python) and its UI (C++).

Injection may also be limited by the game's caching mechanisms. As the game loads tuning, it caches resources that are shared between files to optimize memory usage (e.g. if two loots have the same tests, the game will only create that test list once and use it for both loots, and editing the list for one loot would edit the list for the other as well). There are methods to get around the caching issue, such as creating a new object for your injection rather than mutating the existing one, however the overuse of this could affect the game's memory usage and cause it to lag, so it should be used sparingly.