-
Notifications
You must be signed in to change notification settings - Fork 5
Timber Commons
TimberCommons provides reusable irrigation tower components for building blueprints. A mod can use these components to create custom buildings that irrigate nearby terrain and optionally apply effects to growables or contamination in the active range.
Most blueprint authors only need the sections below. The lower-level C# extension points are described at the end of the page.
There are two ready-to-use tower components:
-
GoodConsumingIrrigationTowerfor a simple tower powered by one consumed good, usually water. -
ManufactoryIrrigationTowerfor a recipe-based tower that consumes ingredients through the regular manufactory logic.
Both tower types irrigate tiles around the building while the building is active. The configured consumption or recipe duration should describe full coverage; TimberCommons scales runtime consumption by the actual covered area.
Both tower specs use these fields:
-
IrrigationRange- maximum irrigation distance from the building foundation. -
IrrigateFromGroundTilesOnly- optional, defaults totrue. When enabled, the tower starts its range search only from foundation blocks marked as ground-only.
Useful range details for blueprint authors:
- Range is measured from the building foundation, not from a single center tile.
- Affected tiles must be connected to the tower and on the tower's ground level.
- Terrain obstacles and full-moisture barriers can block the range.
- Building efficiency can reduce the active range.
Use GoodConsumingIrrigationTower when the building should consume exactly one good.
Required components:
GoodConsumingBuilding-
GoodConsumingBuildingSpecwith exactly oneConsumedGoodSpec GoodConsumingIrrigationTowerSpec
GoodConsumingIrrigationTowerSpec fields:
IrrigationRangeIrrigateFromGroundTilesOnly
The tower consumes goods only while it has reachable tiles. If the building also has range-effect components, all of them are active whenever the tower irrigates.
For a complete blueprint-shaped JSON document, see
ExampleIrrigationTower.Folktails.blueprint.json.
The full example targets Timberborn 1.1 and is valid for TimberCommons 1.16.0 and 1.16.1 (TBD). Replace the template name, localization keys, icon, model path, costs, tool group, and numbers with your own values, then validate the blueprint in the target game version.
The TimberCommons-specific part is small:
{
"GoodConsumingBuildingSpec": {
"FullInventoryWorkHours": 24,
"ConsumedGoods": [
{
"GoodId": "Water",
"GoodPerHour": 1.0
}
]
},
"GoodConsumingIrrigationTowerSpec": {
"IrrigationRange": 8,
"IrrigateFromGroundTilesOnly": true
}
}-
GoodConsumingBuildingSpectells the game which good the building consumes. -
GoodConsumingIrrigationTowerSpecturns the building into an irrigation tower and defines its range.
The rest of the full blueprint is ordinary Timberborn building structure: placement, block shape, label, driveway, access point, visual model, and colliders.
For Timberborn 1.1, DrivewayModelsSpec is the root blueprint spec for driveway models, and individual driveway entries
go into its Driveways array. Do not use DrivewayModelSpec as a root spec in Timberborn 1.1 blueprints.
For Timberborn 1.0, validate the same idea against Timberborn 1.0 game assets before publishing. Blueprint root specs can differ between game versions, and a key that is valid in one version may fail in another.
Use ManufactoryIrrigationTower when the building should consume different ingredient sets through recipes.
Required components:
ManufactoryManufactorySpecManufactoryIrrigationTowerSpec
Do not configure another production executor, such as a workplace or production increaser. The tower itself drives the manufactory production.
ManufactoryIrrigationTowerSpec fields:
IrrigationRangeIrrigateFromGroundTilesOnly-
Effects- optional recipe-to-effect mappings in the<recipe id>=<effect group>format.
Example:
Water=NormalIrrigation
Fertilizer=GrowthBoost
The tower irrigates while the manufactory is unblocked and ready to produce. If Effects are configured, only range
effects matching the current recipe's effect group are active.
Range effects are optional components that can be added to irrigation tower prefabs.
ModifyGrowableGrowthRangeEffect
changes the growth rate of growables in the active range.
ModifyGrowableGrowthRangeEffectSpec fields:
-
EffectGroup- group name used byManufactoryIrrigationTower. It is ignored byGoodConsumingIrrigationTower. -
GrowthRateModifier- relative percent modifier. For example,15.5means +15.5%, and-8.5means -8.5%. -
ComponentsFilter- optional full component type names. If set, a growable matches when it has any listed component. -
TemplateNamesFilter- optional exact template names from the growable'sTemplateSpec.TemplateName.
PrefabNamesFilter is deprecated in TimberCommons 1.16.1 (TBD). It is still present only for temporary compatibility
with older blueprints and should not be used in new specs.
When multiple growth effects overlap, modifiers do not stack by simple addition. The effective result uses the best positive booster and the worst negative moderator.
BlockContaminationRangeEffect
blocks contamination on the active range.
BlockContaminationRangeEffectSpec fields:
-
EffectGroup- group name used byManufactoryIrrigationTower. It is ignored byGoodConsumingIrrigationTower.
Overlapping contamination-blocking ranges are tracked independently, so removing one effect does not remove protection provided by another active effect.
For a new tower blueprint:
- Choose
GoodConsumingIrrigationTowerfor one consumed good, orManufactoryIrrigationTowerfor recipes. - Add the matching Timberborn building component and spec.
- Set
IrrigationRange. - Configure consumption or recipes for full coverage.
- Add built-in range effects if the tower should do more than irrigate.
- For recipe-based towers, map recipe ids to effect groups with
Effects.
Mods that need custom range behavior can implement
IRangeEffect.
public interface IRangeEffect {
public string EffectGroup { get; }
public void ApplyEffect(HashSet<Vector3Int> tiles);
public void ResetEffect();
}ApplyEffect receives the currently reachable tiles. ResetEffect must undo everything the last ApplyEffect call
did. Tower components may call these methods again when coverage, recipe, terrain, barriers, or building state changes.
For deeper integrations, inherit from IrrigationTower only if the ready-to-use tower components do not fit the
building model.
