Main
Vintage Story Mods

Adding blowing recipe

Example on github.

To add a new blowing recipe, you need to create a recipe json file in the assets/MODID/recipes/glassblowing/ folder and write there:


{
	"code": "RECIPECODE",
	"output": {
		"type": "ITEMTYPE",
		"code": "ITEMCODE"
	},
	"steps": []
}

Blowing consists of several steps, each step describes the tool or action used in the process, as well as the shape that will be obtained as a result of this step.

As an example, a step with glass intake from a smeltery:


"steps": [
	{
		"tool": "glassintake",
		"shape": {
			"segments": 13,
			"outer": [
				{
					"segments": 6,
					"vertices": [
						[-3, 0],
						[1, 6],
						[6, 6],
						[7, 5]
					]
				},
				{
					"segments": 7,
					"vertices": [
						[7, 5],
						[9, 6],
						[14, 6],
						[14, 0]
					]
				}
			],
			"inner": [
				[-3, 0],
				[1, 4],
				[7, 4],
				[7, 0]
			]
		},
		"attributes": {
			"code": "game:plain",
			"amount": 128
		}
	}
]

The tool field contains the name of the tool or action.

The attributes field contains additional data that the tool uses.

The optional shape field contains information about the shape of the workpiece that it will take as a result of this step:

A curve can consist of several parts, for a simple bezier curve it is enough to use an array of points (as done in inner). If you need a more complex shape, you can use the example from outer, where segments indicates the number of segments used by this part of the curve. The sum of the segments of all parts must be equal to the number of segments of the entire curve.

Using the bezier curve you can specify any shape of the workpiece, but in cross section they will always have the shape of a circle.

Each tool or action can have progress, and depending on this progress the shape will be interpolated from the previous step to the current one.

Recipe shape visualizer

A simple glass shape visualizer at various recipe steps. Put json of the recipe in the input field to visualize (only strict json is supported).