Jump to content

Whats the future of modding?


Recommended Posts

So I've noticed we can add mods in the game now. Just tried a nice glowing plant and a pipe splitter. How wondrous :)

But I didn't like the algae grower and I want to make my own.... But is this like requiring C++ skills or are you gonna make something like this suggestion:

 

It would be awesome with a modding tutorial that is something like.

Draw this drawing, animate it as this type of file to give it motion or grow states or what ever you like.

Use this text file to give it stats and pipe inputs outputs and stuff like that.

And voila now you can push a button in game and build your new wonderfull building.

Anything like this coming? Or what is the state of things?

Link to comment
Share on other sites

1 hour ago, Mjello said:

But is this like requiring C++ skills

You won't benefit fully from C++ skills because like all other games based on the Unity engine, this one is written in C# and so are all the mods.

 

Right now it looks like you have to code all mods in C#. However the current mod support is essentially "just" adding steam workshop support and a menu to enable and disable mods. While this is a big help for players, it doesn't actually help when creating mods. The mods themselves are still pretty much like they were before mod support, meaning it's arguably hacked addons rather than finetuned additions. With no documentations at all yet, it does take a certain amount of skill/knowledge/experience to do anything when modding.

 

Klei has announced they will make guides and tutorials for mod creators. However they won't do so now because how you mod is rapidly changing due to them adding mod support. In other words while they haven't actually said what they do for mod creators, we know they are doing something to make it easier to make mods.

 

However having said that, buildings aren't that difficult to set up right now despite being in C#. Here for instance is the hydrogen powerplant:

Spoiler

public class HydrogenGeneratorConfig : IBuildingConfig
{
	public const string ID = "HydrogenGenerator";

	public override BuildingDef CreateBuildingDef()
	{
		string id = "HydrogenGenerator";
		int width = 4;
		int height = 3;
		string anim = "generatormerc_kanim";
		int hitpoints = 100;
		float construction_time = 120f;
		float[] tIER = BUILDINGS.CONSTRUCTION_MASS_KG.TIER5;
		string[] rAW_METALS = MATERIALS.RAW_METALS;
		float melting_point = 2400f;
		BuildLocationRule build_location_rule = BuildLocationRule.OnFloor;
		EffectorValues tIER2 = NOISE_POLLUTION.NOISY.TIER5;
		BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tIER, rAW_METALS, melting_point, build_location_rule, BUILDINGS.DECOR.PENALTY.TIER2, tIER2, 0.2f);
		buildingDef.GeneratorWattageRating = 800f;
		buildingDef.GeneratorBaseCapacity = 1000f;
		buildingDef.ExhaustKilowattsWhenActive = 2f;
		buildingDef.SelfHeatKilowattsWhenActive = 2f;
		buildingDef.ViewMode = OverlayModes.Power.ID;
		buildingDef.AudioCategory = "Metal";
		buildingDef.UtilityInputOffset = new CellOffset(-1, 0);
		buildingDef.PowerOutputOffset = new CellOffset(1, 0);
		buildingDef.InputConduitType = ConduitType.Gas;
		return buildingDef;
	}

	public override void DoPostConfigurePreview(BuildingDef def, GameObject go)
	{
		GeneratedBuildings.RegisterLogicPorts(go, LogicOperationalController.INPUT_PORTS_N1_0);
	}

	public override void DoPostConfigureUnderConstruction(GameObject go)
	{
		GeneratedBuildings.RegisterLogicPorts(go, LogicOperationalController.INPUT_PORTS_N1_0);
	}

	public override void DoPostConfigureComplete(GameObject go)
	{
		GeneratedBuildings.RegisterLogicPorts(go, LogicOperationalController.INPUT_PORTS_N1_0);
		go.AddOrGet<LogicOperationalController>();
		go.GetComponent<KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery);
		go.AddOrGet<LoopingSounds>();
		go.AddOrGet<Storage>();
		ConduitConsumer conduitConsumer = go.AddOrGet<ConduitConsumer>();
		conduitConsumer.conduitType = ConduitType.Gas;
		conduitConsumer.consumptionRate = 1f;
		conduitConsumer.capacityTag = GameTagExtensions.Create(SimHashes.Hydrogen);
		conduitConsumer.capacityKG = 2f;
		conduitConsumer.forceAlwaysSatisfied = true;
		conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Dump;
		EnergyGenerator energyGenerator = go.AddOrGet<EnergyGenerator>();
		energyGenerator.formula = EnergyGenerator.CreateSimpleFormula(SimHashes.Hydrogen, 0.1f, 2f, SimHashes.Void, 0f, true);
		energyGenerator.powerDistributionOrder = 8;
		energyGenerator.ignoreBatteryRefillPercent = true;
		energyGenerator.meterOffset = Meter.Offset.Behind;
		Tinkerable.MakePowerTinkerable(go);
		go.AddOrGetDef<PoweredActiveController.Def>();
	}
}

 

This should look familiar to anybody playing ONI. Most of the lines are fairly readable, like it's a building made of metal, it produces 800 W, it has a gas intake and so on. Other buildings look similar and most of the lines applies to all. While it's not the easiest system to get started modding, it's not unrealistic to do so, particularly when we get proper guides and tutorials.

Link to comment
Share on other sites

17 hours ago, Mjello said:

Use this text file to give it stats and pipe inputs outputs and stuff like that.

I have a text file for my godtool mapgeneration and trevice has text files to edit propertys.

I think considering this it might be possible BUT If they easy want to add text file adding for buildings they have to REALLY think out of the box this is not common it would need a concentrated effort.

Dont expect to mod without c#

Link to comment
Share on other sites

Thx for the info.

Is there a way to open an existing building from the game? - Without decompiling and hacking and all that?

So I can see how it is constructed. And modify an existing building and perhaps use it as a template for a new variant? And learn about the code structure in the process.

I know Nightinggale provided the hydrogen generator example. And thx :) for that.

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...