Jump to content

Recommended Posts

Posted (edited)

Hello there modders,

I've never made a mod for a game in my life and I'd like to make a mod that would turn these sandstone stones: 

Spoiler

image.png.75a74f146b6a58909ec233e64b1d2203.png

 

Into: 

Spoiler

image.png.de40e1f5fe45f9c928c06ce86f752613.png

I would also like to make this for every single block possible so it's not such a pain in the ass, but once I figure out how to do 1 type I could probably do the rest as well.

This would just be a mod for me and my friends but I have absolutely no clue where to start 🤣

Can someone please teach me? 🤣

Edited by IAmZeWolf
Posted (edited)

Dead simple:

{
	"ingredientPattern": "SSS	SSS	SSS",
	"ingredients": {
		"S": { 
			"type": "item", 
			"code": "stone-*", 
			"name": "rock", 
				"allowedVariants": [
									"andesite", "chalk", "chert", "conglomerate", "limestone", "claystone", "granite", "sandstone", "shale", "basalt",
									"peridotite", "phyllite", "slate", "bauxite", "greenmarble", "whitemarble", "redmarble", "obsidian", "suevite"
									]
			}
	},
	"width": 3,
	"height": 3,
	"output": { "type": "block", "code": "rock-{rock}", "quantity": 1 }
}

Will let you craft the source rock of every stone except meteoric iron. 

"ingredientPattern" is the shape you make in the grid, in this case you just fill every slot with one type of stone.  "Ingredients" is the ingredients, obviously and "code" in there is the specific ingredient, in this case "stone-*".  The * is a wildcard, allowing it to use any of the "allowedVariants" listed, and all stones are technically just variations on one core stone item which makes things like this easy, and the same goes for rock blocks. To make a recipe with multiple ingredients you'd add another letter entry, basically making something like the S entry under another letter, with a different item or block.  For example, adding "C" : { "type": "item", "code": "candle" }, then replacing an S or two in the pattern would let you create rock blocks with stones and candles, somehow.

"width" and "height" are the size of the grid-pattern, and go with the "ingredientPattern" above.  As an example, you could change the width and height to 2, then use a pattern like this: "SS  SS" and you'd get a recipe that only uses four stones for the same output.

"output" is what the recipe makes, in this case the output is "rock-{rock}", which means that you get a solid rock block (the "rock" bit) of the type of stone used to make it (the {rock} bit).  You could have it make a specific rock regardless of the stone used by changing it to, for example "rock-basalt" to get nothing but basalt rocks.  "quantity" is technically unnecessary when you just output one thing, 

To make this into an actual mod, assuming you're using windows, you would go to /Users/(yourusername)/AppData/Roaming/VintagestoryData/Mods and create a new folder for your mod, rockmod for example, then inside that folder you'd make some new folders like this: rockmod>assets>game>recipes>grid, then you save the recipe above as a text file named rock.json (the .json is important, make sure that it's just .json and not .json.txt or anything like that. You might need to make file extensions visible in the control panel (again, assuming windows) if you can't see them) Theeen go back to your rockmod folder and make a new text file called modinfo.json and fill it with this:

{
  "type": "content",
  "modid": "rockmod",
  "name": "Rock Mod",
  "author": "",
  "description": "Make solid rock blocks with small stones!",
  "version": "1.0.0",
  "dependency": {}
}

Alternatively, you could just go to the base game folder and drop the recipe file into the assets/survival/recipes/grid folder, then go back out to the base folder, and open ModMaker.exe, which will automagically detect changes and additions to base game assets and turn them into a mod for you.

And then you have a mod! Go into the game's mod manager and check that it's enabled, then you should be able to make rock blocks out of stones.

Edit: Hm. It mangled the formatting of the code up there, a bit.  Should still work fine.

Edited by Writhe
  • Amazing! 1
Posted (edited)
7 hours ago, Writhe said:

Dead simple:



{
	"ingredientPattern": "SSS	SSS	SSS",
	"ingredients": {
		"S": { 
			"type": "item", 
			"code": "stone-*", 
			"name": "rock", 
				"allowedVariants": [
									"andesite", "chalk", "chert", "conglomerate", "limestone", "claystone", "granite", "sandstone", "shale", "basalt",
									"peridotite", "phyllite", "slate", "bauxite", "greenmarble", "whitemarble", "redmarble", "obsidian", "suevite"
									]
			}
	},
	"width": 3,
	"height": 3,
	"output": { "type": "block", "code": "rock-{rock}", "quantity": 1 }
}

Will let you craft the source rock of every stone except meteoric iron. 

"ingredientPattern" is the shape you make in the grid, in this case you just fill every slot with one type of stone.  "Ingredients" is the ingredients, obviously and "code" in there is the specific ingredient, in this case "stone-*".  The * is a wildcard, allowing it to use any of the "allowedVariants" listed, and all stones are technically just variations on one core stone item which makes things like this easy, and the same goes for rock blocks. To make a recipe with multiple ingredients you'd add another letter entry, basically making something like the S entry under another letter, with a different item or block.  For example, adding "C" : { "type": "item", "code": "candle" }, then replacing an S or two in the pattern would let you create rock blocks with stones and candles, somehow.

"width" and "height" are the size of the grid-pattern, and go with the "ingredientPattern" above.  As an example, you could change the width and height to 2, then use a pattern like this: "SS  SS" and you'd get a recipe that only uses four stones for the same output.

"output" is what the recipe makes, in this case the output is "rock-{rock}", which means that you get a solid rock block (the "rock" bit) of the type of stone used to make it (the {rock} bit).  You could have it make a specific rock regardless of the stone used by changing it to, for example "rock-basalt" to get nothing but basalt rocks.  "quantity" is technically unnecessary when you just output one thing, 

To make this into an actual mod, assuming you're using windows, you would go to /Users/(yourusername)/AppData/Roaming/VintagestoryData/Mods and create a new folder for your mod, rockmod for example, then inside that folder you'd make some new folders like this: rockmod>assets>game>recipes>grid, then you save the recipe above as a text file named rock.json (the .json is important, make sure that it's just .json and not .json.txt or anything like that. You might need to make file extensions visible in the control panel (again, assuming windows) if you can't see them) Theeen go back to your rockmod folder and make a new text file called modinfo.json and fill it with this:



{
  "type": "content",
  "modid": "rockmod",
  "name": "Rock Mod",
  "author": "",
  "description": "Make solid rock blocks with small stones!",
  "version": "1.0.0",
  "dependency": {}
}

Alternatively, you could just go to the base game folder and drop the recipe file into the assets/survival/recipes/grid folder, then go back out to the base folder, and open ModMaker.exe, which will automagically detect changes and additions to base game assets and turn them into a mod for you.

And then you have a mod! Go into the game's mod manager and check that it's enabled, then you should be able to make rock blocks out of stones.

Edit: Hm. It mangled the formatting of the code up there, a bit.  Should still work fine.

Thank you very much for the detailed explanation. I will give it a go and let you know if I managed to make it work ;)
I highly appreciate it man, also if I manage to get it to work I will give you full credits man. Once again thank you so much.

 

Edit:

I followed the steps and actually managed to get it to work 😮
I've added you as the author seeing as all I had to do was jack shit. Even though it's only going to be used for private use I will still let anyone that plays on my server know that you made it man thank you so so much!

Edited by IAmZeWolf
  • 2 weeks later...
Posted (edited)

I was wanting to do something similar but harder. I was wanting to make the furnace in the creative menu craftable to work like a fire but wouldn't go out in the rain.

making the furnace from creative into a craftable item in survival was easy.

making it have an interface and having it have special recipes only available in the furnace in addition to the standard recipes available in the campfire.

one of the new recipes that you could do in the furnace you can't do in the campfire was going to be taking cobblestone you craft using 8 rocks like he had in his 3x3 crafting grid and a clay in the center the recipe for making the cobblestone is the normal recipe for making it but I was going to have you put the cobblestone in the furnace with fuel to cook it into the stone he showed that he wanted to get from crafting the 9 stones together.

much like the minecraft recipe for cooking cobblestone to make stone.

Edited by Sukotto82
Posted (edited)

I'm afraid I haven't a clue on how to give something a new interface, but the actual cobblestone -> rock bit should be easy; just add this to cobblestone.json:

	"combustiblePropsByType": {
		"cobblestone-*": {
			"meltingPoint": 650,
			"meltingDuration": 45,
			"smeltedRatio": 1,
			"smeltingType": "bake",
			"smeltedStack": { "type": "block", "code": "rock-{rock}" },
			"requiresContainer": false
		}
	}

The file should look like this when done:

Spoiler



{
	"code": "cobblestone",
	"variantgroups": [
		{ "loadFromProperties": "block/rock" }
	],
	attributes: {
		handbook: {
			groupBy: ["cobblestone-*"]	
		}
	},
	creativeinventory: { "general": ["*"], "construction": ["*"] },
	shape: { base: "block/basic/cube" },
	drawtype: "cube",
	blockmaterial: "Stone",
	"textures": {
		"all": {  base: "block/stone/cobblestone/{rock}*" }
	},
	"replaceable": 140,
	"fertility": 0,
	resistance: 2,
	sounds: {
		"walk": "walk/stone",
		byTool: {
			"Pickaxe": { hit: "block/rock-hit-pickaxe", break: "block/rock-break-pickaxe" }
		}
	},
	heldTpIdleAnimation: "holdbothhandslarge", heldTpUseAnimation: "twohandplaceblock",
	tpHandTransform: {
		translation: { x: -1.2, y: -1.1, z: -0.8 },
		rotation: { x: -2, y: 25, z: -78 },
		scale: 0.37
	},
	"combustiblePropsByType": {
		"cobblestone-*": {
			"meltingPoint": 650,
			"meltingDuration": 45,
			"smeltedRatio": 1,
			"smeltingType": "bake",
			"smeltedStack": { "type": "block", "code": "rock-{rock}" },
			"requiresContainer": false
		}
	}
}

 

Melting point is the temperature required to melt in celsius, and duration is how long it takes in seconds.  smeltedRatio is how much cobble takes to get one rock, so a value of 2 would require two cobblestone for one rock.

It'd let you make rock in firepits, at least.  I don't know how you might restrict it to the furnace.

If you want specific cobblestone types to have unique melting points/durations/ratios then you'd do this:

Spoiler



	"combustiblePropsByType": {
		"cobblestone-*": {
			"meltingPoint": 650,
			"meltingDuration": 45,
			"smeltedRatio": 1,
			"smeltingType": "bake",
			"smeltedStack": { "type": "block", "code": "rock-{rock}" },
			"requiresContainer": false
		},
		"cobblestone-basalt": {
			"meltingPoint": 250,
			"meltingDuration": 45,
			"smeltedRatio": 3,
			"smeltingType": "bake",
			"smeltedStack": { "type": "block", "code": "rock-basalt" },
			"requiresContainer": false
		},
		"cobblestone-chalk": {
			"meltingPoint": 580,
			"meltingDuration": 82,
			"smeltedRatio": 2,
			"smeltingType": "bake",
			"smeltedStack": { "type": "block", "code": "rock-chalk" },
			"requiresContainer": false
		}
	}

 

Repeat for as many types as desired.  Any types not listed will use the "cobblestone-*" one.

As for the interface bit, maybe ask Rhonen?  Their Workbench expansion has a new crafting interface.

Edited by Writhe
Posted (edited)

Awesome, thank you. I'll check this out and see if I can talk to Rhonen.

much appreciated.

 

this won't just help with cobblestone but I could make a whole bunch of new blocks this way. thank you.

Edited by Sukotto82
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.