Jump to content

Recommended Posts

Posted

Working on my Catmint some more and I want to increase the nutrition when cooked in a meal. I'm trying to base off bushmeat but so far code is not working:

item:

{
	code: "rawcatmint",
	maxstacksize: 64,
	variantgroups: [
		{ code: "type", states: ["cut", "dried" ] },
	],
	attributes: {		
                onDisplayTransform: {
			        origin: { x: 0.5, y: 0, z: 0.5 },
			        scale: 0.58
		},
		displaycaseable: true,
		shelvable: true,
	},
    shape: { base: "game:item/resource/haybundle" },
	texturesByType: {
	 	"*cut":{"bundle": { base: "block/rawcatmint/cut" }},
        "*dried": {"bundle":{ base: "block/rawcatmint/dried" }}
	},
	creativeinventory: { "general": ["*"], "items": ["*"] },
	nutritionPropsByType: {
	 	"*cut": { satiety: 20, health: 0, foodcategory: "Vegetable" },
	 	"*dried": { satiety: 10, health: 0, foodcategory: "Vegetable" }
	},
	nutritionPropsWhenInMeal: { satiety: 100, foodcategory: "game:Vegetable" },
	transitionablePropsByType: {
		"*cut": [{
			type: "Perish",
			freshHours: { avg: 66 },
			transitionHours: { avg: 18 },
			transitionedStack: { type: "item", code: "rot" },
			transitionRatio: 4
		},	{
				type: "Dry",
				freshHours: { avg: 0 },
				transitionHours: { avg: 48 },
				transitionedStack: { type: "item", code: "catmint-dried" },
				transitionRatio: 1
			}
		],
		"*dried": [{
			type: "Perish",
			freshHours: { avg: 1000 },
			transitionHours: { avg: 48 },
			transitionedStack: { type: "item", code: "rot" },
			transitionRatio: 4
		}],
	},
	guiTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 120, y: 41, z: 7 },
		origin: { x: 0.5, y: 0.11, z: 0.47 },
		scale: 2.15
	},
	fpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 40, y: 91, z: 15 },
		origin: { x: 0.8, y: 0.4, z: 0 },
		scale: 1.47
	},
	groundTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 180, y: 33, z: -180 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 2.5
	},
	tpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 5, y: 41, z: -31 },
		origin: { x: 0.16, y: 0.05, z: 0.08 },
		scale: 0.44
	}
}

I've also made a coup/meal recipe that is working but only gives 10 nutrition currently. 

 

{
	code: "catmintsoup",
	perishableProps: {
		freshHours: { avg: 144 },
		transitionHours: { avg: 36 },
		transitionRatio: 1,
		transitionedStack: { type: "item", code: "rot" }
	},
	shape: { base: "game:block/food/meal/soup" },
	ingredients: [
		{ 
			code: "game:stock", 
			validStacks: [ 
				{ 
					type: "item", code: "game:waterportion", shapeElement: "game:bowl/water"
				}
			],
			minQuantity: 1,
			maxQuantity: 10,
			portionSizeLitres: 1,
			typeName: "game:stock"
		},
		{
			code: "game:vegetable-base", 
			validStacks: [ 
				{ type: "item", code: "rawcatmint-dried",  shapeElement: "game:bowl/vegetable base 1/*" }
			],
			minQuantity: 1,
			maxQuantity: 10,
			typeName: "vegetable"
		}
	]
}

I've tried using this attribute in both code objects with no success

	nutritionPropsWhenInMeal: { satiety: 100, foodcategory: "game:Vegetable" },

I assume i'm using the line of code or not placing it correctly? 

Posted

Sorry this was easier than i thought to figure out. Here is the working code sample:

{
	code: "rawcatmint",
	maxstacksize: 64,
	variantgroups: [
		{ code: "type", states: ["cut", "dried" ] },
	],
	attributes: {		
                onDisplayTransform: {
			        origin: { x: 0.5, y: 0, z: 0.5 },
			        scale: 0.58
		},
		displaycaseable: true,
		shelvable: true,
	    nutritionPropsWhenInMeal: { satiety: 100, foodcategory: "Vegetable" },
	},
    shape: { base: "game:item/resource/haybundle" },
	texturesByType: {
	 	"*cut":{"bundle": { base: "block/rawcatmint/cut" }},
        "*dried": {"bundle":{ base: "block/rawcatmint/dried" }}
	},
	creativeinventory: { "general": ["*"], "items": ["*"] },
	nutritionPropsByType: {
	 	"*cut": { satiety: 20, health: 0, foodcategory: "Vegetable" }
	},

	transitionablePropsByType: {
		"*cut": [{
			type: "Perish",
			freshHours: { avg: 66 },
			transitionHours: { avg: 18 },
			transitionedStack: { type: "item", code: "rot" },
			transitionRatio: 4
		},	{
				type: "Dry",
				freshHours: { avg: 0 },
				transitionHours: { avg: 48 },
				transitionedStack: { type: "item", code: "catmint-dried" },
				transitionRatio: 1
			}
		],
		"*dried": [{
			type: "Perish",
			freshHours: { avg: 1000 },
			transitionHours: { avg: 48 },
			transitionedStack: { type: "item", code: "rot" },
			transitionRatio: 4
		}],
	},
	guiTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 120, y: 41, z: 7 },
		origin: { x: 0.5, y: 0.11, z: 0.47 },
		scale: 2.15
	},
	fpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 40, y: 91, z: 15 },
		origin: { x: 0.8, y: 0.4, z: 0 },
		scale: 1.47
	},
	groundTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 180, y: 33, z: -180 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 2.5
	},
	tpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 5, y: 41, z: -31 },
		origin: { x: 0.16, y: 0.05, z: 0.08 },
		scale: 0.44
	}
}

Adjustment 1

nutritionPropsByType: {
	 	"*cut": { satiety: 20, health: 0, foodcategory: "Vegetable" }
	},

I dont know if this would of had an effect or not but I removed nutrition for "dried" because I wanted to force people to use it as an ingredient for cooking. 

 

adjustment 2:

attributes: {		
                onDisplayTransform: {
			        origin: { x: 0.5, y: 0, z: 0.5 },
			        scale: 0.58
		},
		displaycaseable: true,
		shelvable: true,
	    nutritionPropsWhenInMeal: { satiety: 100, foodcategory: "Vegetable" },
	},

Fruit had a good example of how to use it in the attributes. 

 

Adjustment 3

	    nutritionPropsWhenInMeal: { satiety: 100, foodcategory: "Vegetable" },

I wanted to share this correction as well. Originally I had "foodcategory: "game:Vegetable" ". this caused a crash. So I removed "game:" and it fixed my crash issue. 

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