Jump to content

Recommended Posts

Posted (edited)

I am trying to change the recipes involving the large chromium tanned hide to use 2 chromium sulfate and 2 wax instead of 3.

I also have some normal recipes in the mod which are working, so the basic mod structure is all there and working.

These are the relevant files I created in my mod:

\assets\cutthehides\recipes\patches\recipes-cooking-hide-chromium.json

[
  {
    "op": "replace",
    "path": "/server/chromium tanned large hide/chromium sulfate/0/ingredients/0/minQuantity",
    "value": 2
    "file": "game:recipes/cooking/hide-chromium.json"
  },
  {
    "op": "replace",
    "path": "/server/chromium tanned large hide/chromium sulfate/0/ingredients/0/maxQuantity",
    "value": 2
    "file": "game:recipes/cooking/hide-chromium.json"
  }
]

\assets\cutthehides\recipes\patches\recipes-cooking-leather.json

[
  {
    "op": "replace",
    "path": "/server/leather-sturdy-plain/wax/0/ingredients/0/minQuantity",
    "value": 2
    "file": "game:recipes/cooking/leather.json"
  },
  {
    "op": "replace",
    "path": "/server/leather-sturdy-plain/wax/0/ingredients/0/maxQuantity",
    "value": 2
    "file": "game:recipes/cooking/leather.json"
  }
]

It doesn't error, but it doesn't work.

Edited by Krougal
Posted (edited)

Your paths are wrong.

"server" doesn't exist in any recipe I know of. Both recipe files are arrays (square brackets). The way you navigate through arrays is with array indices. Note: Array counts start at 0 not 1. You just have to take the most direct path to the keys you want to change, no need for detours.

Spoiler

Exemplary path visualisation:

image.thumb.png.31cd7c8d9cec4bc23a3cf83f92ba84a2.png

[
  {
    "op": "replace",
    "path": "/0/ingredients/0/minQuantity",
    "value": 2
    "file": "game:recipes/cooking/hide-chromium.json",
    "side": "Server"
  },
  {
    "op": "replace",
    "path": "/0/ingredients/0/maxQuantity",
    "value": 2
    "file": "game:recipes/cooking/hide-chromium.json",
    "side": "Server"
  }
]

and

[
  {
    "op": "replace",
    "path": "/0/ingredients/0/minQuantity",
    "value": 2
    "file": "game:recipes/cooking/leather.json",
    "side": "Server"
  },
  {
    "op": "replace",
    "path": "/0/ingredients/0/maxQuantity",
    "value": 2
    "file": "game:recipes/cooking/leather.json",
    "side": "Server"
  }
]
 

should do the trick.

I can highly recommend https://mods.vintagestory.at/show/mod/513 when working with patches. It is a great debugging tool showing you exactly what your patches are doing.

Edited by Brady_The
Posted

Nope on either account. I tried a few variations as well.

Tried adding , after the value too.

I am not getting anything in the debug log either, and I followed the directions.

 

Posted (edited)
20 minutes ago, Krougal said:

Nope on either account. I tried a few variations as well.

Tried adding , after the value too.

I am not getting anything in the debug log either, and I followed the directions.

 

It seems to be working for me.

Spoiler

2784_2vSK1fCuPkSapv2YrjO3.png.5ce7c311d8dded529010a53ef9d86c20.png 2783_23Ioxl10cT7dEhcpl4ms.png.7a96003301b29b8bcc1322afc976e147.png

Edited by Brady_The
Posted (edited)
4 minutes ago, Krougal said:

My file paths are ok?

I don't know what you mean with that. Have you looked into the spoiler in my first comment and changed your patches accordingly?

Edit: Yeah, the file paths are okay.

Edited by Brady_The
Posted
2 minutes ago, Brady_The said:

I don't know what you mean with that. Have you looked into the spoiler in my first comment and changed your patches accordingly?

Yes.

I'm talking about the physical folder paths

\mod.zip\assets\domain\recipes\patches\patch.json

 

Posted (edited)
5 minutes ago, Krougal said:

Yes.

I'm talking about the physical folder paths

\mod.zip\assets\domain\recipes\patches\patch.json

 

Ah, you are talking about the path of the actual patch file. This is the wrong place for patches. They belong in "\mod.zip\assets\domain\patches", no matter what file you are patching. The navigation to the changed file (and thus the form of asset (blocktypes, recipes, shapes, etc)) happens in the patch file itself with the property of the "file" key.

Edited by Brady_The
  • Thanks 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.