Skip to content
k-mods.com

A Complete Building

The full reference chain for a dynamically created building (buildable class, building descriptor, build recipe, production recipes, schematic, and sinkpoints), in dependency order, in one pack.

This page walks the full reference chain for dynamically created content, in dependency order, with copy-pasteable YAML. Everything lives in one pack:

pack.yml
ref: MyFactory
name: My Factory Pack
version: 1.0.0

Every step references the previous one by generated class path. The id: of each entry is the contract that makes those paths deterministic, in the form /KDataForge/Gen/MyFactory.Gen_MyFactory_<Id> (see YAML Schema → generated class identity).

You never need include: between these files. Stages run in a fixed order. The whole Items stage, which generates buildables via class, descriptors via building, and items via item, finishes before Recipes starts. Recipes in turn finishes before Schematics starts.

Within Items, the generation types are priority-ordered. So every file below can reference every class generated in an earlier step by its /KDataForge/Gen/... path, regardless of file names or scan order.

Does type: building create the building actor? No, type: building generates the descriptor, which is the build-menu entry.

The buildable actor, the Build_X_C class placed in the world, generally comes from an existing buildable parent. You define a type: class entry with parent: set to an existing /Game/....Build_*_C, effectively reparenting an existing buildable.

There are no custom meshes, since the policy is 2D-only, and no new components. You get the parent’s mesh, connections, and production logic, with your own CDO overrides.

1-buildable.class.yml
type: class
classes:
- id: Build_MyMachine
parent: /Game/FactoryGame/Buildable/Factory/SmelterMk1/Build_SmelterMk1.Build_SmelterMk1_C
properties:
- path: mDisplayName
value:
key: Build_MyMachine_Name
ns: MyFactory
source: Compact Smelter
- path: mPowerConsumption
value: 12.0

This generates /KDataForge/Gen/MyFactory.Gen_MyFactory_Build_MyMachine, a real AFGBuildableManufacturer subclass via the smelter parent.

Step 2: the building descriptor (type: building)

Section titled “Step 2: the building descriptor (type: building)”

The FGBuildingDescriptor subclass whose mBuildableClass points at the buildable from step 1:

2-descriptor.building.yml
type: building
buildings:
- id: Desc_MyMachine
properties:
- path: mDisplayName
value:
key: Desc_MyMachine_Name
ns: MyFactory
source: Compact Smelter
- path: mBuildableClass
value: /KDataForge/Gen/MyFactory.Gen_MyFactory_Build_MyMachine

See Buildings for the descriptor-vs-buildable split in general.

Construction recipes are ordinary FGRecipes whose product is the building descriptor. Their mProducedIn includes the build gun, which is how the game knows a recipe belongs in the build menu:

3-build-recipe.recipe.yml
type: recipe
recipes:
- id: Recipe_Build_MyMachine
properties:
- path: mDisplayName
value: Compact Smelter
- path: mIngredients
value:
- ItemClass: /Game/FactoryGame/Resource/Parts/IronPlateReinforced/Desc_IronPlateReinforced.Desc_IronPlateReinforced_C
Amount: 4
- ItemClass: /Game/FactoryGame/Resource/Parts/Rotor/Desc_Rotor.Desc_Rotor_C
Amount: 2
- path: mProduct
value:
- ItemClass: /KDataForge/Gen/MyFactory.Gen_MyFactory_Desc_MyMachine
Amount: 1
- path: mProducedIn
value:
- /Script/FactoryGame.FGBuildGun

Step 4: production recipes for the machine (type: recipe)

Section titled “Step 4: production recipes for the machine (type: recipe)”

This step defines what the machine can produce: recipes whose mProducedIn is the generated buildable class from step 1. Adding a new item for it to produce shows the item side of the chain too:

4a-output-item.item.yml
type: item
items:
- id: Desc_CompactIngot
parent: /Game/FactoryGame/Resource/Parts/IronIngot/Desc_IronIngot.Desc_IronIngot_C
properties:
- path: mDisplayName
value:
key: Desc_CompactIngot_Name
ns: MyFactory
source: Compact Ingot
- path: mStackSize
value: SS_HUGE
4b-production-recipe.recipe.yml
type: recipe
recipes:
- id: Recipe_CompactIngot
properties:
- path: mDisplayName
value: Compact Ingot
- path: mIngredients
value:
- ItemClass: /Game/FactoryGame/Resource/RawResources/OreIron/Desc_OreIron.Desc_OreIron_C
Amount: 2
- path: mProduct
value:
- ItemClass: /KDataForge/Gen/MyFactory.Gen_MyFactory_Desc_CompactIngot
Amount: 1
- path: mManufactoringDuration
value: 3.0
- path: mProducedIn
value:
- /KDataForge/Gen/MyFactory.Gen_MyFactory_Build_MyMachine # the step-1 buildable

Unlocks both recipes via an instanced FGUnlockRecipe:

5-schematic.schematic.yml
type: schematic
schematics:
- id: Schematic_MyMachine
properties:
- path: mDisplayName
value: Compact Smelting
- path: mType
value: EST_Milestone
- path: mTechTier
value: 2
- path: mCost
value:
- ItemClass: /Game/FactoryGame/Resource/Parts/IronPlate/Desc_IronPlate.Desc_IronPlate_C
Amount: 100
unlocks:
- class: /Game/FactoryGame/Unlocks/BP_UnlockRecipe.BP_UnlockRecipe_C
properties:
- path: mRecipes
value:
- /KDataForge/Gen/MyFactory.Gen_MyFactory_Recipe_Build_MyMachine
- /KDataForge/Gen/MyFactory.Gen_MyFactory_Recipe_CompactIngot

Registering the schematic auto-propagates: its recipes register, and the recipes’ items register in turn. The schematic is therefore the only piece you strictly need register: for (see Recipes → auto-propagation).

Step 6: sinkpoints for the new items (type: sinkpoints)

Section titled “Step 6: sinkpoints for the new items (type: sinkpoints)”

New items have no AWESOME Sink value until you give them one:

6-sinkpoints.sinkpoints.yml
type: sinkpoints
track: Default
entries:
- item: /KDataForge/Gen/MyFactory.Gen_MyFactory_Desc_CompactIngot
points: 8

Six files, six generation steps, each one consuming the class path the previous one produced. The table below is a quick lookup for which file generates what and what it points back at, once you have read the walkthrough above:

#FileGeneratesReferences
11-buildable.class.ymlbuildable actor classexisting Build_SmelterMk1_C parent
22-descriptor.building.ymlbuilding descriptorstep 1 via mBuildableClass
33-build-recipe.recipe.ymlbuild recipestep 2 as mProduct, FGBuildGun in mProducedIn
44a/4boutput item + production recipestep 1 in mProducedIn, item in mProduct
55-schematic.schematic.ymlschematicsteps 3+4 via FGUnlockRecipe
6: Session restartDid you restart after editing YAML?KDataForge reads every document type once during session initialization

Ids are the contract. You can rename any file freely, but renaming an id needs a redirects: entry in pack.yml (see Conditions & Packs).

Custom Classes explains the generic generation escape hatch used in step 1. The Buildings, Recipes, Schematics, and Sink Points pages cover each later capability. Use the content-creation schema for exact fields. End-to-End Pack is the item-centric counterpart to this building walkthrough.