Jump to content

Recipe Question


l33tmaan

Recommended Posts

I thought I was getting a hang of modding this game, but I suppose not. I'm trying to make a type of bread you can make with berries and I've managed to get them to show up in-game (although the name looks weird, like 'game:item-dough-berry-spelt-blueberry), but I just can't get the actual recipe to work. I also can't get the dough to actually bake, but maybe I'm just crazy. I would really appreciate if anyone could help me out here, because I thought I sorta knew what I was doing. I even took a look at the Acorns mod to see how they made dough, and it's not dissimilar to this. 

Spoiler


{
	ingredientPattern: "WFB",
	ingredients: {
		"W": { 
			type: "block", 
			code: "game:woodbucket"
		},
		"F": { 
			type: "item", 
			code: "game:flour-*", 
			allowedVariants: ["flax", "rice", "rye", "spelt"],
			name: "type"
		}
		"B": { 
			type: "item", 
			code: "game:fruit-*", 
			allowedVariants: ["blueberry", "cranberry", "redcurrant", "whitecurrant", "blackcurrant"],
			name: "fruit"
		}
	},
	width: 3,
	height: 1,
	attributes: {
		liquidContainerProps: {
			requiresContent: { type: "item", code: "waterportion" },
			requiresQuantity: 1
		}
	},
	name: "dough-berry",
	shapeless: true,
	output: { type: "item", code: "dough-berry-{type}"  }
}

 

I dunno if it'll help, but here's my dough code:

Spoiler

{
	code: "dough-berry",
	maxstacksize: 32,
	attributes: {
		displaycaseable: true,
		shelvable: true
	},
	variantgroups: [
		{ code: "type", states: ["spelt", "rye", "flax", "rice" ] },
		{ code: "fruit", states: ["blueberry", "cranberry", "redcurrant", "whitecurrant", "blackcurrant"] },
	],
	shapebytype: { 
		"dough-berry-flax": { base: "item/food/bread/flaxbread-dough" },
		"dough-berry-rice": { base: "item/food/bread/ricebread-dough" },
		"dough-berry-spelt": { base: "item/food/bread/speltbread-dough" },
		"dough-berry-rye": { base: "item/food/bread/ryebread-dough" },
	},
	textures: {
		"flaxbread-dough": {base: "item/food/grain/flaxbread" },
		"ricebread-dough": {base: "item/food/grain/ricebread" },
		"speltbread-dough": {base: "item/food/grain/speltbread" },
		"ryebread-dough": {base: "item/food/grain/ryebread" },
	},
	creativeinventory: { "general": ["*"], "items": ["*"] },
	materialDensity: 200,
	fpHandTransform: {
		translation: { x: 0, y: -0.1, z: 0 },
		rotation: { x: 180, y: 90, z: 22 }
	},
	combustibleProps: {
		meltingPoint: 250,
		meltingDuration: 15,
		smeltedRatio: 1,
		smeltingType: "bake",
		smeltedStack: { type: "item", code: "bread-berry-{type}" },
		requiresContainer: false
	},
	guiTransform: {
		translation: { x: 2, y: 0, z: 0 },
		rotation: { x: -28, y: 23, z: 180 },
		origin: { x: 0.5, y: 0.07, z: 0.5 },
		scale: 5
	},
	groundTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 0, y: 0, z: 1 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 4
	},
	fpHandTransform: {
		translation: { x: 0, y: 0.22, z: 0.2 },
		rotation: { x: 97, y: 1, z: -17 },
		origin: { x: 0.5, y: 0.1, z: 0.5 },
		scale: 2.5
	},
	tpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 25, y: 106, z: 54 },
		origin: { x: 0.32, y: -0.25, z: -0.06 },
		scale: 0.8
	},
	transitionableProps: [{
		type: "Perish",
		freshHours: { avg: 48 },
		transitionHours: { avg: 24 },
		transitionedStack: { type: "item", code: "rot" },
		transitionRatio: 1
	}]
}

 

 

Edited by l33tmaan
Link to comment
Share on other sites

On 11/22/2020 at 9:00 AM, DArkHekRoMaNT said:

You will not have shapes because you are using the wrong item code. Your whole dough is dough-berry-{type}-{fruit}. Textures will also be broken, they generally use other codes.

Uhhh... weirdly enough, the shapes and textures are the only thing that are working so far.

On the dough at least, I still can't get the bread to show up at all. I tried that code change last night and it didn't work, but I tried it again now and... it still didn't work. I feel like I'm missing something simple here.

On 11/22/2020 at 8:56 AM, DArkHekRoMaNT said:

And it would be good if you give an archive with your current version of the mod. It's strange that you have dough in the game domain.
P.S. It is also best to call doughberry rather than dough-berry.

Oh yeah, sure, here you go. Like I said, I tried to look at the Acorns mod since it's similar to this one and that's how it had its code written.

Berry Bread.zip

Edited by l33tmaan
Link to comment
Share on other sites

Modinfo also based on Acorns mod? Very strange modinfo.
EDIT: No, Acorns modinfo is normal. 


Modid must be strictly lowercase. Type is specified as content or code. Why do you need TextureSize here at all is not clear.
P.S And why did you even make keys in the first capital?

Spoiler

{
  "Type": 1,
  "TextureSize": 32,
  "Name": "Berry Bread",
  "Version": "0.1",
  "NetworkVersion": null,
  "Description": "Lets you put berries in dough to bake berry bread.",
  "Website": "",
  "ModID": "BerryBread",
  "Authors": [
    ""
  ],
  "Contributors": [],
  "Side": "Universal",
  "RequiredOnClient": true,
  "RequiredOnServer": true,
  "Dependencies": {}
}

 

Your modinfo should look something like this:

Spoiler

{
  "type": "content",
  "modid": "berrybread", 
  "name": "Berry Bread",
  "description": "Lets you put berries in dough to bake berry bread.",
  "version": "0.1",
  "authors": [ "l33tmaan" ],
  "dependencies": {
    "game": "1.13.4"
  }
}

 

Side, contributers, newtworkversion, requiredon are optional. In dependencies, it is desirable to specify the minimum version of the game for the mod.

Edited by DArkHekRoMaNT
Link to comment
Share on other sites

You has mistake, line 28 in breadberry.json:
   "*": { saturation: 300, foodcategory: "Grain" , saturation: 80, foodcategory : "Fruit"}

You can enter the command /errorreporter 1 in your test world and enable debug: Settings -> Developer -> Enable Developer Mode, Error Reporter and (optional) Extended Debug Info.

Edited by DArkHekRoMaNT
Link to comment
Share on other sites

First off, let me tell you how much I appreciate you taking the time to look at this and help me out. I am very much learning as I go here, most of my coding knowledge is limited to baby stuff like HTML and CSS.

2 hours ago, DArkHekRoMaNT said:

Why are they game:? Where do you store your assets? In assets/game/? You can of course store assets there, but this is bad practice, this is the vanilla domain. Your assets should be in assets/<yourmodid>/

Yeah... speaking of bad practices, I usually just create the .json file directly in the /survival folder and edit them there. Then I make the mod and remove it when I'm done. So in this case it should be in assets/berrybread, since berrybread is my ModID? If my modinfo is weird, then that might be because I uh... used ModMaker.exe to make it. Bad practices all around.

1 hour ago, DArkHekRoMaNT said:

You has mistake, line 28 in breadberry.json:
   "*": { saturation: 300, foodcategory: "Grain" , saturation: 80, foodcategory : "Fruit"}

You can enter the command /errorreporter 1 in your test world and enable debug: Settings -> Developer -> Enable Developer Mode, Error Reporter and (optional) Extended Debug Info.

Oh yeah, that. I know that isn't working, I was just experimenting in having food give 2 kinds of nourishment at once. Is there any way to do that for non-meal foods? I'm mostly concerned with getting the recipe to show up at the moment, I think I can fix the visual issues on my own. Hopefully. 

EDIT: I managed to get the bread to show up in-game. I'm not really sure how, since I just cut a line out, tested the game, then pasted the same line back where it was... But would you be able to explain why the names look weird?

Edited by l33tmaan
Link to comment
Share on other sites

31 minutes ago, l33tmaan said:

would you be able to explain why the names look weird?

same. I have the same problem with my mods that I have been experimenting with and my coding is limited to 1 semester of introduction to computer programming 101. introduction to C++ and basically all we did is learned how to do a "hello world" text output and a few other text based code like converting c to f and that sort of thing but never taught us how to make it run outside of the compiler program used to create it.

Link to comment
Share on other sites

I know I made the same bad practice choices of changing game instead of making a seperate mod folder. I don't know much about vintage story and every game I've modded has been different. 

Skyrim, Kenshi, 7 days to die and vintage story are all very different from each other when it comes to modding them. what works for one doesn't work for another so I didn't know what to do in vintage story as I'm totally new to it.

the purple inventory bags you see in this screenshot are also things I added. I also added compressed coal and a coal mix that burns hotter and longer than normal charcoal the compressed coal was mainly for allowing you to mine more and take up less inventory space. all the items I've added work to some degree.

all the items and recipes I've added work except the knapping recipes and clay forming recipes I can't get to work.

I added a new berry bush called purrberry and it's mostly a copy of blueberry bush but I changed the texture and the fruit and name and well everything about it just used blueberry bush as a base to work off of and it works but I can't find it in my world. I have to spawn it in via /gamemode2 (creative) but once I place it down it grows and works perfectly fine. it as well as a few counter crops I made as an experiment work but don't spawn in the world naturally so the only way to get them is creative at the moment. I would like to fix this but don't know how yet.

I don't know why name is like that tho.

all I did is add the purr berry to the existing small bush where blueberries and cranberries are.

 

{
    code: "smallberrybush",
    class: "BlockBerryBush",
    attributes: {
        butterflyFeedByType: {
            "*-flowering": true
        },
        beeFeedByType: {
            "*-flowering": true
        },
        resetBelowTemperature: -1,
        stopBelowTemperature: 4,
        revertBlockBelowTemperature: -4
    },
    entityclass: "BerryBush",
    behaviorsByType: {
        "*-ripe": [ {name: "Harvestable", properties: { 
            harvestTime: 0.6, 
            harvestedStack: { type: "item", code: "fruit-{type}", quantity: { avg: 2.2 }  },
            harvestedBlockCode: "smallberrybush-{type}-empty"
        }} ],
    },
    variantgroups: [
        { code: "type", states: ["blueberry", "purrberry", "cranberry"] },
        { code: "state", states: ["empty", "flowering", "ripe"] },
    ],
    creativeinventory: { "general": ["*"], "flora": ["*"] },
    renderpass: "OpaqueNoCull",
    renderAlphaTest: 0.4,
    shape: { base: "block/plant/smallberrybush_{state}" },
    blockmaterial: "Plant",
    texturesByType: {
        "*-empty": {
            leaves: { base: "block/plant/berrybush/leaves/{type}*" },
            branches: { base: "block/plant/berrybush/branches/default" }
        },
        "*-flowering": {
            leaves: { base: "block/plant/berrybush/leaves/{type}*" },
            branches: { base: "block/plant/berrybush/branches/default" },
            berries: { base: "block/plant/berrybush/flowering/{type}*" },
            berriesup: { base: "block/plant/berrybush/flowering/{type}*" },
        },
        "*-blueberry-ripe": {
            leaves: { base: "block/plant/berrybush/leaves/{type}_ripe*" },
            branches: { base: "block/plant/berrybush/branches/default" },
            berries: { base: "block/plant/berrybush/ripe/{type}*" },
            berriesup: { base: "block/plant/berrybush/ripe/{type}*" },
        },
        "*-purrberry-ripe": {
            leaves: { base: "block/plant/berrybush/leaves/{type}_ripe*" },
            branches: { base: "block/plant/berrybush/branches/default" },
            berries: { base: "block/plant/berrybush/ripe/{type}*" },
            berriesup: { base: "block/plant/berrybush/ripe/{type}*" },
        },
        "*-ripe": {
            leaves: { base: "block/plant/berrybush/leaves/{type}*" },
            branches: { base: "block/plant/berrybush/branches/default" },
            berries: { base: "block/plant/berrybush/ripe/{type}*" },
            berriesup: { base: "block/plant/berrybush/ripe/{type}*" },
        },
        
    },
    sideopaque: {
        all: false
    },
    sidesolid: {
        all: false
    },
    replaceable: 3000,
    lightAbsorption: 0,
    resistance: 0.5,
    collisionbox: null,
    sounds: {
        place: "block/plant",
        break: "block/plant",
        hit: "block/plant",
    },
    rainPermeable: false,
    dropsByType: {
        "*-ripe": [
            { type: "block", code: "smallberrybush-{type}-empty", quantity: { avg: 1 }  },
            { type: "item", code: "fruit-{type}", quantity: { avg: 2.2 }  },
        ],
        "*": [
            { type: "block", code: "smallberrybush-{type}-empty", quantity: { avg: 1 }  }
        ]
    },
    materialDensity: 200,
    vertexFlags: {
        zOffset: 2
    },
    frostable: true,
    combustibleProps: {
        burnTemperature: 600,
        burnDuration: 10,
    }
}

 

it all works except not finding purrberrybush in wild

the blueberry bush and cranberry bush don't show up with weird names but purrberry does for some reason despite being in the same code.

name help.png

Link to comment
Share on other sites

@l33tmaan@Sukotto82 A strange name is just really the name of the object, its code. For normal naming, you need to create a language file.

Quote
  • Use the /expclang command to generate a neatly pre-formatted list of language entries destined for your en.json, it's placed in a file named collectiblelang.json in the same folder where VintageStory.exe is. It creates language entries for any block or item that currently has no translation. Can save you a ton of time by not needing to handwrite your en.json file.

 

Link to comment
Share on other sites

Thanks for that. I ran the error reporter this time and I got something useful:

23.11.2020 16:32:33 [Error] Syntax error in json file 'game:recipes/grid/doughberry.json': Failed deserializing doughberry.json: After parsing a value an unexpected character was encountered: ". Path 'ingredients.F', line 14, position 2.

Line 14 of my recipe is where I started putting in the berry info, but it looks the same as the other code? What's the problem here?

EDIT: OH MY GOD I FORGOT TO PUT A COMMA! 
Wow, I feel really dumb now. Anyway, is it possible for for this bread to count as a grain and a fruit?

Edited by l33tmaan
Link to comment
Share on other sites

@DArkHekRoMaNT So you know how you said that most of my textures would be broken? Well, I'm trying to actually make the bread look like it has berries in it now, and I am indeed breaking my textures. I thought the best way to do that would be to have a texture of each berry type and apply it as an overlay to the bread. But no matter what I do, I can't get it to actually show up. All the various breads just look like their normal variants. Am I misunderstanding what overlays are used for?

textures: {
		"all": {base: "game:item/food/grain/{type}bread",
			overlays: [ "item/food/fruit/blackcurrant" ],
},

 

BerryBread.zip

Link to comment
Share on other sites

I've never used an overlay I usually just make a different texture for it but when making multiple items it would be nice to be able to just add overlay so you don't need to make a different texture for each and every item like I'm doing now.

17 hours ago, l33tmaan said:

is it possible for for this bread to count as a grain and a fruit?

would this work?

nutritionPropsByType: {
        "*-flax": { saturation: 160, foodcategory: "Grain" },
        "*-rice": { saturation: 330, foodcategory: "Grain" },
        "*": { saturation: 300, foodcategory: "Grain" }
    },

instead of that could maybe something like this work

nutritionPropsByType: {
        "*-flax": { saturation: 160, foodcategory: "Grain" },
        "*-rice": { saturation: 330, foodcategory: ["Grain", "fruit"] },
        "*": { saturation: 300, foodcategory: "Grain" }
    },

looking specifically at the rice.

or maybe something like this if you want different values?

 "*-rice": { [saturation: 330, foodcategory: "Grain"},  {saturation: 240, foodcategory: "fruit"} ] },

or simply adding 2 lines instead of the one maybe like this?

nutritionPropsByType: {
        "*-rice": { saturation: 240, foodcategory: "fruit" },
        "*-rice": { saturation: 330, foodcategory: "Grain" },
        "*": { saturation: 300, foodcategory: "Grain" }
    },

or would this override the fruit with the grain since it comes after the fruit in the lines of code?

I'm asking I don't know this isn't a suggestion. I don't know how it works just wondering if this would work.

Edited by Sukotto82
Link to comment
Share on other sites

15 hours ago, l33tmaan said:

@DArkHekRoMaNT So you know how you said that most of my textures would be broken? Well, I'm trying to actually make the bread look like it has berries in it now, and I am indeed breaking my textures. I thought the best way to do that would be to have a texture of each berry type and apply it as an overlay to the bread. But no matter what I do, I can't get it to actually show up. All the various breads just look like their normal variants. Am I misunderstanding what overlays are used for?


textures: {
		"all": {base: "game:item/food/grain/{type}bread",
			overlays: [ "item/food/fruit/blackcurrant" ],
},

 

BerryBread.zip 16.63 kB · 2 downloads

just thought about this check the berrybush files and look at the flowering process, pherhaps you could do something similar to the flower overlay on bushes but for your bread texture instead. I didn't see an overlay tag in the bush textures or the blocktype for the bush either but maybe if you look at the bushes and see how they add flowering to the bush and even changing a bush from flowering to ripe maybe that would help you with your textures for your bread.

  • Like 1
Link to comment
Share on other sites

5 hours ago, Sukotto82 said:

I've never used an overlay I usually just make a different texture for it but when making multiple items it would be nice to be able to just add overlay so you don't need to make a different texture for each and every item like I'm doing now.

would this work?

nutritionPropsByType: {
        "*-flax": { saturation: 160, foodcategory: "Grain" },
        "*-rice": { saturation: 330, foodcategory: "Grain" },
        "*": { saturation: 300, foodcategory: "Grain" }
    },

instead of that could maybe something like this work

nutritionPropsByType: {
        "*-flax": { saturation: 160, foodcategory: "Grain" },
        "*-rice": { saturation: 330, foodcategory: ["Grain", "fruit"] },
        "*": { saturation: 300, foodcategory: "Grain" }
    },

looking specifically at the rice.

or maybe something like this if you want different values?

 "*-rice": { [saturation: 330, foodcategory: "Grain"},  {saturation: 240, foodcategory: "fruit"} ] },

or simply adding 2 lines instead of the one maybe like this?

nutritionPropsByType: {
        "*-rice": { saturation: 240, foodcategory: "fruit" },
        "*-rice": { saturation: 330, foodcategory: "Grain" },
        "*": { saturation: 300, foodcategory: "Grain" }
    },

or would this override the fruit with the grain since it comes after the fruit in the lines of code?

I'm asking I don't know this isn't a suggestion. I don't know how it works just wondering if this would work.

No.  For different categories, you need to create a code mod.  For an example implementation, you can see BlockMeal class (used by bowls)

Edited by DArkHekRoMaNT
  • Like 1
Link to comment
Share on other sites

5 minutes ago, l33tmaan said:

That seems like it might be a little out of my depth, but I'll look into trying that anyway, thank you.
Any tips on getting the textures to show up right? I've sort of been flailing around trying to get anything new to appear.

I haven't looked yet because of what the problem might be.  At first glance, everything is fine

Link to comment
Share on other sites

Lol. Now your texture should overwrite the vanilla texture of the black currant berry.  What does this berry look like in the game?)

P.S. This is one of the reasons why you shouldn't use the game domain for your mod.  Although in 1.13.4 overlays are a bit broken anyway and can only work with game textures (fixed in 1.14). You need rename it. For example, assets/game/textures/<yourmodid>/item/food/fruit/blackberry 

Link to comment
Share on other sites

You mean changing the file path to something like assets/breadberry/itemtypes or lang or textures or whatever? I just tried that and this happened.

So uh... I guess that's progress, actually? Let me mess around a bit and see if I can get things looking right. Here's the updated file, if it helps.

2020-11-24_16-30-29.png

BerryBread.zip

Edited by l33tmaan
Link to comment
Share on other sites

@Sukotto82 so that the bush can be generated in the world you must do worldgen) Create simular this in the worldgen folder:

[
			comment: "Patches of blueberries",
			blockCodes: ["smallberrybush-blueberry-empty", "smallberrybush-blueberry-flowering", "smallberrybush-blueberry-ripe", "smallberrybush-blueberry-ripe"],
			minTemp: -2,
			maxTemp: 18,
			minRain: 0.3,
			maxRain: 0.7,
			maxFertility: 0.5,
			chance: 0.1,
			minForest: 0.5,
			maxY: 0.85,
			offsetX: { dist: "gaussian", avg: 0, var: 15 },
			offsetZ: { dist: "gaussian", avg: 0, var: 15 },
			quantity: { avg: 5, var: 12 },
		}
]

Worldgen of the vanilla bush is in survival/worldgen/blockpatches.json

Edited by DArkHekRoMaNT
Link to comment
Share on other sites

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