Modding Help .biome.patch

Discussion in 'Starbound Modding' started by bconlon, Jan 22, 2017.

  1. bconlon

    bconlon Subatomic Cosmonaut

    I am trying to make a new tree I have created (which does work) spawn on lush planets, but they don't show up. Upon further inspection the starbound.log says this:
    Code:
    [10:08:20.342] [Error] Could not apply patch from file /biomes/surface/garden.biome.patch in source: ..\mods\Farmbound.  Caused by: (JsonPatchException) Could not apply patch to base. (JsonPatchException) Could not apply operation to base. (TraversalException) Tried to get key '1' in non-object type in pathApply("/surfacePlaceables/items/1/mode/1")
    Any attempt to remove the /1 just makes the planet not work, and I have tried /- and /0. What do I add to replace it?

    Here is the code for the garden.biome.patch file, in case it is needed:
    Code:
    [
    {"op":"add", "path" : "/surfacePlaceables/items/1/mode/1", "value": "floor" },
    {"op":"add", "path" : "/surfacePlaceables/items/2/priority/1", "value": "2.0" },
    {"op":"add", "path" : "/surfacePlaceables/items/3/variants/1", "value": "1" },
    {"op":"add", "path" : "/surfacePlaceables/items/4/distribution/1", "value": "/biomes/distributions.config:denseMedium" },
    {"op":"add", "path" : "/surfacePlaceables/items/5/type/1", "value": "tree" },
    {"op":"add", "path" : "/surfacePlaceables/items/6/treeFoliageHueShiftMax/1", "value": "0" },
    {"op":"add", "path" : "/surfacePlaceables/items/7/treeStemHueShiftMax/1", "value": "0" },
    {"op":"add", "path" : "/surfacePlaceables/items/8/treeStemList/1", "value": "redapplelog" },
    {"op":"add", "path" : "/surfacePlaceables/items/9/treeFoliageList/1", "value": "redappleleaves" }
    ]
    EDIT: Or how do I format the .biome.patch file in general?

    EDIT 2: Some alternate code I am testing out, it seems to work but I can't find any new trees where they should be. Or am I just having bad luck at finding the trees?
    Code:
    [
    {
    "op" : "add",  "path" : "/mode",
    "value": "floor"
    },
    {
    "op" : "add",  "path" : "/priority",
    "value": "2.0"
    },
    {
    "op" : "add",  "path" : "/variants",
    "value": "1"
    },
    {
    "op" : "add",  "path" : "/distribution",
    "value": "/biomes/distributions.config:denseMedium"
    },
    {
    "op" : "add",  "path" : "/type",
    "value": "tree"
    },
    {
    "op" : "add",  "path" : "/treeFoliageHueShiftMax",
    "value": "0"
    },
    {
    "op" : "add",  "path" : "/treeStemHueShiftMax",
    "value": "0"
    },
    {
    "op" : "add",  "path" : "/treeStemList",
    "value": "redapplelog"
    },
    {
    "op" : "add",  "path" : "/treeFoliageList",
    "value": "redappleleaves"
    }
    ]
     
    Last edited: Jan 22, 2017
  2. Antyrus

    Antyrus Pangalactic Porcupine

    I think the problem lies in how you're patching past "/surfacePlaceables/items". I haven't messed with biomes at all, but It looks like you're attempting to patch different things in multiple objects all throughout the biome, even things that have nothing to do with trees, like chests and microdungeons, because you're misunderstanding how the patch system works. I think you just need to patch "/surfaceplacables/items/8" if you want to replace the given trees, or add your own at the bottom of the list( "/surfacePlaceables/items/-" ).
    I think your patch should look something like
    Code:
    [
    {
    "op":"add", "path" : "/surfacePlaceables/items/-", "value": [
         "mode" : "floor",
         "priority" : 2.0,
         "variants" : 1,
         "distribution" : "/biomes/distributions.config:scatteredLarge",
         "type" : "tree",
         "treeFoliageHueShiftMax" : 40,
         "treeStemHueShiftMax" : 15,
         "treeStemList" : [ "pineytree" ],
         "treeFoliageList" : [ "pinefoliage" ]
         ]
    }
    ]
    but with your values plugged in. This patch should add your tree alongside the trees already there, as opposed to replacing them.
    What you're doing in your second edit is adding random things to the first level of the file, so that while it accepts it as valid data, the game isn't actually doing anything with it because they aren't being read as intended.
    Consider looking at this patching guide if you haven't already
     
  3. bconlon

    bconlon Subatomic Cosmonaut

    Thanks for the advice! I will try this format now and see if the tree generates.
     
  4. bconlon

    bconlon Subatomic Cosmonaut

    It works! Thank you, now I just need to make it so there aren't more apple trees than pine trees, which I should be able to do by myself.
     
  5. bk3k

    bk3k Oxygen Tank

    I suggest you use this handy patch maker.
    Input the original file on the left
    Input an edited version(desired end result) on the right
    And have it build your patches for you.

    I don't really use it for what I do(pretty comfortable hand typing them), but if I was editing a biome or similar file, that's definitely a time and frustration saver.
     
    SilhouetteXD and lazarus78 like this.

Share This Page