Modding:General Best Practices

=Prefixing= Prefix your object and table names with some unique ID.

For instance,. This will prevent namespace conflicts with official content and other mods in the future.

=Merging= Only include your content and the minimum changeset via  in tables and object definitions.

Don't copy the whole contents of the game xml. You only need to include new content.

For objects and encounter tables, if you're editing an existing item you can use  in it's tag and only specify new items. For example, if I wanted my mod to give chain mail a 2DV:

=Random Functions=

To avoid conflicts and to keep consistency between seeds, Stat.Random and Stat.Rnd should not be called. The ideal is to use GetSeededRandomGenerator for your mod's randomness. The next best is calling RandomCosmetic or Rnd2.

=ObjectBlueprint Definitions= In general, unless you're defining a unique object, make sure you add the xml property  to prevent breaking behavior.

Stats
Prefer using  over , unless you're creating a unique creature. When loading ObjectBlueprints, the code loads both  and   into a stat, then if   is set, prefers using that to set a stat over.

Harmony Patches
Harmony Patches are an advanced technique for code injection/modification. It allows modding parts of the game that are not normally accessible via the normal part and event systems exposed to modders. Harmony patching is recommended only for modders with advanced coding experience. For some advice about when and when not to use Harmony, see Harmony Modding.