海狸浮生记 Timberborn

海狸浮生记 Timberborn

Moddable Prefab (U7 ✅)
Luke ✞ Jesus Saves ✞  [开发者] 7 月 14 日 下午 10:05
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.
< >
正在显示第 1 - 5 条,共 5 条留言
crashfly 7 月 14 日 下午 10:09 
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 7 月 14 日 下午 10:25 
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 ✞  [开发者] 7 月 14 日 下午 10:45 
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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3517034498 to dump the data and search for the PrefabSpec, it has "PrefabName" property in it.
crashfly 7 月 14 日 下午 11:14 
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 ✞  [开发者] 7 月 14 日 下午 11:38 
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.
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50