Jump to content

Easier Modding Capabilities


Recommended Posts

Stuff like Building Definitions and Creature Diets could be moved out into their own files, like an xml or json file, right now they are compiled and need compiling to be modified which drastically reduces the easiness of modding.

If we look at the Apothecary's definition file:

public override BuildingDef CreateBuildingDef()
{
	string id = "Apothecary";
	int width = 2;
	int height = 3;
	string anim = "apothecary_kanim";
	int hitpoints = 30;
	float construction_time = 120f;
	float[] tier = BUILDINGS.CONSTRUCTION_MASS_KG.TIER4;
	string[] all_METALS = MATERIALS.ALL_METALS;
	float melting_point = 800f;
	BuildLocationRule build_location_rule = BuildLocationRule.OnFloor;
	EffectorValues none = NOISE_POLLUTION.NONE;
	BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tier, all_METALS, melting_point, build_location_rule, BUILDINGS.DECOR.NONE, none, 0.2f);
	buildingDef.RequiresPowerInput = true;
	buildingDef.EnergyConsumptionWhenActive = 240f;
	buildingDef.ExhaustKilowattsWhenActive = 0.25f;
	buildingDef.SelfHeatKilowattsWhenActive = 0.5f;
	buildingDef.ViewMode = OverlayModes.Power.ID;
	buildingDef.AudioCategory = "Glass";
	buildingDef.AudioSize = "large";
	return buildingDef;
}

We see all these values that could be placed into a xml file and be easily modable.

Putting stuff like this into an external file would make modding significantly easier and would also mean that when the developers are working on the game they don't have to recompile it everytime they make a change to the object definition.

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