Timberborn

Timberborn

[For Modders] Moddable Prefab (U7 Only ✅)
Luke ✞ Jesus Saves ✞  [developer] 14 Jul @ 10:05pm
Specify prefab
You can specify the prefab names that get applied to by using "PrefabNames" property. For example from the snippet:

{ "PrefabModderSpec": { "ComponentType": "Timberborn.Buildings.BuildingSpec", "PrefabNames": [ "Dam.Folktails", "Dam.IronTeeth" ], "ValuePath": "_scienceCost", "NewValue": "1", // It must be a string that is a JSON "AppendArray": true // We will use this later but here it is ignored because the value is not an array } }

The above change will only be applied to "Dam.Folktails" and "Dam.IronTeeth" prefabs.
< >
Showing 1-5 of 5 comments
crashfly 14 Jul @ 10:09pm 
and so i shall move my comment here also. added note, the mod i am referring to is: 1x1x2 Storage
---
what i was trying to figure out was how to specify a prefab from a mod.
it is a storage building that has a set amount of capacity specified by that prefab.
i wanted to modify that capacity amount.
crashfly 14 Jul @ 10:25pm 
what i have determined from examining the assetbundles, is the long reference to the prefab name, the id {if that matters} and the integer variable of "maxCapacity".

irony is that there are 4 prefabs for the races the mod supports {whitepaws, ironteeth, emberpelts and folktails}
Luke ✞ Jesus Saves ✞  [developer] 14 Jul @ 10:45pm 
I am not sure what your question is. If you need to know the prefab name, you need to use AssetRipper to extract it and read it in Notepad or Unity. Alternatively, you can use this mod https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3517034498 to dump the data and search for the PrefabSpec, it has "PrefabName" property in it.
crashfly 14 Jul @ 11:14pm 
i actually used UnityDataTools {compiled it myself}, which essentially does mostly the same thing.
unfortunately, AssetRipper is a bit harder to find what you are looking for {unless i use data collected from UnityDataTools. i seem to get just slightly different information from AssetRipper though.
----
that aside, my question is how to use the "ComponentType" and "PrefabNames" for a mod/this mod.

from AssetRipper i get:
Main Asset - GigargantuanPileFT
GameObject - GigargantuanPileFT
Script - StockpileSpec
Assembly Name - Timberborn.Stockpiles.dll
Namespace - Timberborn.Stockpiles
Class Name - StockpileSpec
----
in UnityDataTools, the one of the prefab names {for folktail} is specified as {all one line}:
assets/mods/1x1x2 storage/assetbundles/resources/buildings/modularstorageprefabs/gigargantuanpileft.prefab
----

now putting that information together, i supposed the "ComponentType" would be specified as "Timberborn.Stockpiles.StockpileSpec"

however, i am unsure how the "PrefabNames" is specified from your example, unless, like yours, it is derived from the type of beaver, or just straight uses the asset name.
Luke ✞ Jesus Saves ✞  [developer] 14 Jul @ 11:38pm 
If you look at the Prefab/GameObject file (I am not sure what UnityDataTools do), you can see beside "StockpileSpec" component, inside the same object there should be "PrefabSpec" component. Look at it, and check for the _prefabName field, that's what you need. As for ComponentType, yes "Timberborn.Stockpiles.StockpileSpec" is a valid type, and it has "_maxCapacity" field you can modify.
< >
Showing 1-5 of 5 comments
Per page: 1530 50