Modding Help Can't mod ship locker's loot. [Resolved.]

Discussion in 'Starbound Modding' started by Nujuju299, May 13, 2016.

  1. Nujuju299

    Nujuju299 Big Damn Hero

    I picked up modding just earlier, again, and specifically for Starbound. I've read tutorials and started making items, objects and all that and it's working so far, so, yay! However I'm trying to get a patch to add loot to ship lockers to include some seeds.

    Thanks to Kawa's tool to check patches, it doesn't look like it's quite working right, I think it's because I need to target arrays after first array dimension in an array or something stupidly complicated like that. Obviously, the "basic" patch tutorial can't help me here, unfortunately.

    So.... I may have missed something, being a 26-ish adept modder, but I don't know where I went wrong or how to work .json files. With that said and done, let me display what I have so far and what's being displayed. (I haven't actually tested this in game yet, I've stopped when Kawa's tool showed I had it wrong and can't fix it.)

    Patch:
    Code:
    [
        {
          "op" : "add",
          "path" : "/starterTreasure/-",
          "value" : {"item" : ["NCW_crystalseed", 10]}
        }
    ]
    
    Original:
    Code:
    {
      "starterTreasure" : [
        [0, {
          "fill" : [
            {"item" : "flashlight"},
            {"item" : [ "torch", 10 ]}
          ]
        }]
      ]
    }
    output:
    Code:
    {
      "starterTreasure": [
        [
          0,
          {
            "fill": [
              {
                "item": "flashlight"
              },
              {
                "item": [
                  "torch",
                  10
                ]
              }
            ]
          }
        ],
        {
          "item": [
            "NCW_crystalseed",
            10
          ]
        }
      ]
    }
    
     
  2. Mackinz

    Mackinz The Waste of Time

    Use this patch instead:

    Code:
    [
        {
          "op" : "add",
          "path" : "/starterTreasure/0/1/fill/-",
          "value" : {"item" : ["NCW_crystalseed", 10]}
        }
    ]
    
    Result:

    Code:
    {
      "starterTreasure" : [ [ 0, {
        "fill" : [
            {
                "item" : "flashlight"
            }, 
            {
                "item" : [ "torch", 10 ]
            },
            {
                "item" : [ "NCW_crystalseed", 10 ]
            }
        ]
      } ] ]
    }
    
     
  3. Nujuju299

    Nujuju299 Big Damn Hero

    Thanks. :)
     

Share This Page