Jump to content

attempting create new mod


Recommended Posts

Greeting,
I'm trying to create a mod that introduce a new gas filter by temperature.
it's like the vanila gas filter, but filter by temperature.

i got few code samples from other modders to startup, primary based on Cairath FlowSpitter.

i managed to get good build, however i get error, found in the log:
[07:55:56.811] [1] [INFO]     Kelmen.ONI.Mods.TemperatureFilterPipe
[07:55:58.017] [2] [INFO] [Account] Got login for user KU_1_XnbnrT
[07:55:58.272] [1] [WARNING] Invalid hash name
NullReferenceException: Object reference not set to an instance of an object
at KAnimControllerBase.set_AnimFiles (KAnimFile[]) <0x0004b>
at BuildingLoader.Add2DComponents (BuildingDef,UnityEngine.GameObject,string,bool,int) <0x001b0>
at BuildingLoader.CreateBuildingComplete (UnityEngine.GameObject,BuildingDef) <0x003e7>
at BuildingConfigManager.RegisterBuilding (IBuildingConfig) <0x0026f>
at (wrapper dynamic-method) GeneratedBuildings.LoadGeneratedBuildings_Patch3 (System.Collections.Generic.List`1<System.Type>) <0x002e7>
at LegacyModMain.LoadBuildings (System.Collections.Generic.List`1<System.Type>) <0x000c4>
at LegacyModMain.Load () <0x0013a>
at Assets.CreatePrefabs () <0x00018>
at Assets.OnPrefabInit () <0x00d51>
at KMonoBehaviour.InitializeComponent () <0x00195>

i believe this is due to me passing null to the anim parameter at BuildingTemplates.CreateBuildingDef
            var buildingDef = BuildingTemplates.CreateBuildingDef(
...
                anim: null,
...

since i'm trying out this as 1st attempt, do i really need to have a anim file? is there a way i can test without animation?

the mod will expect 2 manual input as config/setting from user:

- 1st is the condition operator: basically stating to compare less than or up to greater than ( <, <=, =, >=, >) the next value to be enter
- 2nd temperature value. i look at the code sample, is the float data being present at the player selected temperature measurement, or in 1 fixed measurement (like Kelvin) ?

if there is other mod with similar entry design, please tell, so i can try study their codes if avail.

tq

Link to comment
Share on other sites

1 hour ago, kelmen said:

since i'm trying out this as 1st attempt, do i really need to have a anim file? is there a way i can test without animation?

As far as I understand, anim file contains all the images of the building, so you need one. You can just use the one that's already in game, like orifinal gas filter anim. Look in the decompiled game code to find the Config class of the original one and use the line from there.

Link to comment
Share on other sites

On 8/17/2019 at 8:27 PM, Zoom12 said:

Blindfolds mod Temperature filter

i can't find Blindfolds through the search, also not seeing any mod or similar of such.

does he released that code as mod somewhere, or just code helper?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...