VisualKits

You can find a JSON Schema for Visual Kits here.

All Visual Kit JSON files must start with the prefix Kit_.

ContentLib introduces the concept of Visual Kits to prevent having to deal with long, verbose blueprint paths in Item and Schematic definitions.

Visual Kits are automatically generated at Runtime for every pre-existing Item (including those from other mods) and can be accessed by using the ClassName of the item.

You can also define your own Visual Kits using JSON files. In custom visual kits, you can re-use base game content, refer to content from other mods, or (in the case of icons only) use Icons that have been loaded by ContentLib.

If you want to refer to the kit of an existing item, use its descriptor name, with the _C suffix, For example, Desc_OreGold_C resolves to the Caterium Ore kit, but Desc_OreGold resolves to the DefaultItemMesh (default)

For example, a custom kit file named Kit_CustomWater.json can be used in Item definitions via the name "Kit_CustomWater".

Visual Kits are also used to specify the icons used by Schematics.

Remember that custom Visual Kits need to go in the correct Folder.

All Fields are optional.

VisualKit Exporting

Nog previously wrote a chat command for exporting the VisualKits of all loaded items to text files. This functionality still appears to be working, but it may have some bugs.

You can attempt to use it via /CLDumpVisualKits, and it should output files to FactoryGame/Mods/ContentLib/Configs/ItemVisualKits/DumpOutput/<KitName>.json if it worked.

Schematic Visual Kit Example

Here is an example Visual Kit that is used in RePan to reference custom Icons for use in a Schematic

It requires that a file AcidRefinery.png be included in an Icons folder.

{
  "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_VisualKit.json",
  "BigIcon": "AcidRefinery",
  "SmallIcon": "AcidRefinery"
}

Item Visual Kit Example

Below is an example Visual Kit that reuses properties of the base-game Water resource.

Note that if a Solid is given fluid/gas color properties, they will have no noticeable effect.

{
  "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_VisualKit.json",
  "Mesh": "/Game/FactoryGame/Resource/Parts/PackagedWater/SM_PackedWater_01.SM_PackedWater_01",
  "BigIcon": "/Game/FactoryGame/Resource/RawResources/Water/UI/LiquidWater_Pipe_512.LiquidWater_Pipe_512",
  "SmallIcon": "/Game/FactoryGame/Resource/RawResources/Water/UI/LiquidWater_Pipe_256.LiquidWater_Pipe_256",
  "FluidColor":
  {
    "r": 122,
    "g": 176,
    "b": 212,
    "a": 255
  },
  "GasColor":
  {
    "r": 122,
    "g": 176,
    "b": 212,
    "a": 255
  }
}

Visual Kit overriding

As of April 4th 2023, this feature is not fully working correctly. The override will apply for ContentLib-defined items that try to use the kit you overwrite, but if you try to override a vanilla/modded item, the changes will not be visibly applied to that item.

If you want to override an existing item’s kit, create a custom kit as normal, but also create an Item Patch for the item you want to change that specifies your new kit via the VisualKit field.

If a Visual Kit shares the name of an existing definition, the last visual kit to load will overwrite the existing kit(s), including base-game ones!

This means that you can replace the icons/meshes/fluid colors etc. of any mod’s item or schematic by writing a Visual Kit that shares its exact name.

The below example will replace the icon for the Caterium Ore base game item.

The file should be named exactly Desc_OreGold_C.json, otherwise it will not successfully override the existing Caterium Ore, and will instead create a separate visual kit.

It requires that a file MyIconName.png be included in an Icons folder, for example, \YourModReference\ContentLib\Icons\MyIconName.png

{
    "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_VisualKit.json",
    "BigIcon": "MyIconName",
    "SmallIcon": "MyIconName"
}