User Tools

Site Tools


workplaces

Workplaces

A workplace is a building containing a BUILDING_FUNCTION_WORKPLACE.

Example of declaring a workplace building function

-- Register the mithril factory extension B part
mod:register({
	DataType = "BUILDING_PART",
	Id = "MITHRIL_FACTORY_EXTENSION_B_ROOT_PART",
	-- [...]
	BuildingFunction = { 
		DataType = "BUILDING_FUNCTION_WORKPLACE",
		WorkerCapacity = 1,
		RelatedJob = { Job = "MITHRIL_ARTISAN", Behavior = "WORK_BEHAVIOR" },
		InputInventoryCapacity = {{ Resource = "MITHRIL_ORE", Quantity = 30 }},
		ResourceListNeeded = {{ Resource = "MITHRIL_ORE", Quantity = 5 }},
		ResourceProduced = {{ Resource = "MITHRIL_NECKLACE", Quantity = 1 }}
	},
	-- [...]
})

This example assume the mod already declared a MITHRIL_ARTISAN job, a MITHRIL_ORE and a MITHRIL_NECKLACE resources.

See mod Example 02 for complete examples.

More info on buildings here.

workplaces.txt · Last modified: 2019/09/26 17:08 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki