Content Default Object Modification
You can find a JSON Schema for CDOs here. |
You can also use ContentLib to perform (Class Default Object) CDO edits.
To learn more about what a CDO is, see this Unreal Engine documentation page.
This is an advanced feature that can modify pretty much any field on any asset, as long as you know where the asset is and what field to look for. It can also do things like change the parent classes of blueprint assets.
In order to find the names of fields, you probably will need to either have a set up modding project, and/or look at the C++ headers shipped with the game. Experimentation will be required to find out what fields do what.
You can attempt to hot reload CDOs via the button on the Mod Configuration screen,
or the /CLCDOReload
chat command.
Hot reloading is a WIP feature, and could work, have no effect,
or possibly even crash you depending on the fields you are modifying.
There are no restrictions on the names for CDO JSON files.
This feature becomes even more powerful when paired with a mod of your own. For example, you can use CDO edits to change the parent class of other Materials to one you packaged with your mod, changing the appearance of anything using that material.
You can see the field types supported by ContentLib CDOs
by looking at the UCLCDOBPFLib::EditCDO
implementation
here.
Remember that CDOs need to go in the correct Folder. |
Disclaimer
It’s possible to do a lot of cool things with this feature, but also cause crashes. On the flip side, the modifications could have absolutely no effect whatsoever. ContentLib simply provides the tools to allow modifying the CDO - there is no guarantee that the asset you are modifying will still work correctly after the fact.
JSON Examples
Rename an Item
This renames Caterium Ingots to Gold Ingots.
This is an example of a CDO edit that works with hot reloading.
{
"$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_CDO.json",
"Class": "/Game/FactoryGame/Resource/Parts/GoldIngot/Desc_GoldIngot.Desc_GoldIngot_C",
"Edits": [
{
"Property": "mDisplayName",
"Value": "Gold Ingot"
}
]
}
Recipe Ingredients Quantity Change
{
"$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_CDO.json",
"Class": "/Game/FactoryGame/Recipes/Blender/Recipe_FusedModularFrame.Recipe_FusedModularFrame_C",
"Edits": [
{
"Property": "mIngredients",
"Value": [
{
"ItemClass": "/Game/FactoryGame/Resource/Parts/ModularFrameHeavy/Desc_ModularFrameHeavy.Desc_ModularFrameHeavy_C",
"Amount": 643
},
{
"ItemClass": "/Game/FactoryGame/Resource/Parts/AluminumCasing/Desc_AluminumCasing.Desc_AluminumCasing_C",
"Amount": 245
},
{
"ItemClass": "/Game/FactoryGame/Resource/RawResources/NitrogenGas/Desc_NitrogenGas.Desc_NitrogenGas_C",
"Amount": 123
}
]
}
]
}
Change Material Instance Parent Class
Unreal material instances store their parent Material as a field. This field can be changed with CDO edits, although it is rarely a good idea to do so. This point of this example is just to demonstrate editing an arbitrary field on an asset.
{
"$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_CDO.json",
"Class": "/Game/FactoryGame/-Shared/Material/MI_Factory_Base_01.MI_Factory_Base_01",
"Edits": [
{
"Property": "Parent",
"Value": "/AdaptingGenerators/Assets/MM_FactoryCopy.MM_FactoryCopy"
}
]
}