Modding Help Custom Ore Entry Help

Discussion in 'Starbound Modding' started by Reika, Aug 25, 2016.

  1. Reika

    Reika Scruffy Nerf-Herder

    I am trying to make a mod that enriches the deeper levels of moons - that is, the ore density rises for deeper layers.

    I have gone about doing that by patching terrestrial_worlds.config to change the normally monotone "moonunderground" value for all depth layers to "moonmiddle, "moondeep" for depth layers #2 and #3 respectively.

    I added the corresponding biome files, and gave them custom "ores" tags "moonmiddle" and "moondeep". I also patch mooncorelayer.biome to give it ores "mooncore".

    All of this seems to work, but the actual ore distribution patching is breaking the game badly. Like 50K lines of this badly.

    Some testing has narrowed down the error to coming from the insertion of the three new ore fields in my oredistributions.config.patch:

    Code:
      {
      "op": "add",
      "path": "/moonmiddle",
      "value": [0.5, [ [ "erchius", 1.2 ] ] ]
      },
      {
      "op": "add",
      "path": "/moondeep",
      "value": [0.5, [ [ "erchius", 1.75 ] ] ]
      },
      {
      "op": "add",
      "path": "/mooncore",
      "value": [0.5, [ [ "erchius", 2.5 ] ] ]
      }
    
    Is it not possible to add custom top-level entries to the file? What I want is something that looks like this.

    I will also say that all my patches are being tested against the JSON patching tool and it indicates everything should work.
     
  2. Reika

    Reika Scruffy Nerf-Herder

    I have just tested; it is not the act of patching that is causing the issue, as outright replacing oredistributions.configfunctions with a premodified version triggers the same log spam and crash.

    Also, since I forgot to upload them last night, here are my files:

    terrestrial_worlds.config.patch
    Code:
    [
      {
      "op": "replace",
      "path": "/planetTypes/moon/layers/underground1/primaryRegion/0",
      "value": "moonmiddledepth"
      },
      {
      "op": "replace",
      "path": "/planetTypes/moon/layers/underground2/primaryRegion/0",
      "value": "moonmiddledepth"
      },
      {
      "op": "replace",
      "path": "/planetTypes/moon/layers/underground3/primaryRegion/0",
      "value": "moondeep"
      },
      {
      "op": "add",
      "path": "/regionTypes/moonmiddledepth",
       "value":
        {
      "fgCaveSelector" : [ "moonCaves" ],
      "fgOreSelector" : ["richVeins"],
      "bgOreSelector" : ["richVeins"],
      "caveLiquid" : [ "fuel" ],
      "caveLiquidSeedDensityRange" : [3.5, 3.5],
      "biome" : [
      [0, [ "moonmiddledepth"]]
      ]
      }
      },
      {
      "op": "add",
      "path": "/regionTypes/moondeep",
       "value":
        {
      "fgCaveSelector" : [ "moonCaves" ],
      "fgOreSelector" : ["richVeins"],
      "bgOreSelector" : ["richVeins"],
      "caveLiquid" : [ "fuel" ],
      "caveLiquidSeedDensityRange" : [3.5, 3.5],
      "biome" : [
      [0, [ "moondeep"]]
      ]
      }
      }
    ]
    


    moonmiddledepth.biome
    Code:
    {
      "name" : "moonmiddledepth",
      "friendlyName" : "moonmiddledepth",
    
      "parallax" : "/parallax/underground/moonunderground.parallax",
    
      "mainBlock" : "moondust",
      "subBlocks" : [ "moonstone", "moonrock" ],
      "ores" : "moonmiddle",
    
      "ambientNoises" : {
      "day" : {
      "tracks" : [ "/sfx/environmental/moon_underground.ogg" ]
      },
      "night" : {
      "tracks" : [ "/sfx/environmental/moon_underground.ogg" ]
      }
      },
    
      "musicTrack" : {
      "day" : {
      "tracks" : []
      },
      "night" : {
      "tracks" : []
      }
      },
    
      "undergroundPlaceables" : {
      "items" : [
      {
      "mode" : "floor",
      "priority" : 1.0,
      "variants" : 1,
      "distribution" : "/biomes/distributions.config:hazardUndergroundLower",
    
      "type" : "object",
      "objectSets" : [
      {
      "pool" : [ [0.30, "groundspike1" ], [0.30, "groundspike2" ], [0.30, "groundspike3" ], [0.30, "groundspike4" ] ]
      }
      ]
      },
      {
      "mode" : "ceiling",
      "priority" : 1.0,
      "variants" : 1,
      "distribution" : "/biomes/distributions.config:hazardUndergroundCeilingLower",
    
      "type" : "object",
      "objectSets" : [
      {
      "pool" : [ [0.30, "ceilingspike1" ], [0.30, "ceilingspike2" ], [0.30, "ceilingspike3" ], [0.30, "ceilingspike4" ] ]
      }
      ]
      }
      ]
      },
    
      "hueShiftOptions" : [0]
    }
    
    


    moondeep.biome
    Code:
    {
      "name" : "moondeep",
      "friendlyName" : "moondeep",
    
      "parallax" : "/parallax/underground/moonunderground.parallax",
    
      "mainBlock" : "moondust",
      "subBlocks" : [ "moonstone", "moonrock" ],
      "ores" : "moondeep",
    
      "ambientNoises" : {
      "day" : {
      "tracks" : [ "/sfx/environmental/moon_underground.ogg" ]
      },
      "night" : {
      "tracks" : [ "/sfx/environmental/moon_underground.ogg" ]
      }
      },
    
      "musicTrack" : {
      "day" : {
      "tracks" : []
      },
      "night" : {
      "tracks" : []
      }
      },
    
      "undergroundPlaceables" : {
      "items" : [
      {
      "mode" : "floor",
      "priority" : 1.0,
      "variants" : 1,
      "distribution" : "/biomes/distributions.config:hazardUndergroundLower",
    
      "type" : "object",
      "objectSets" : [
      {
      "pool" : [ [0.40, "groundspike1" ], [0.40, "groundspike2" ], [0.40, "groundspike3" ], [0.40, "groundspike4" ] ]
      }
      ]
      },
      {
      "mode" : "ceiling",
      "priority" : 1.0,
      "variants" : 1,
      "distribution" : "/biomes/distributions.config:hazardUndergroundCeilingLower",
    
      "type" : "object",
      "objectSets" : [
      {
      "pool" : [ [0.40, "ceilingspike1" ], [0.40, "ceilingspike2" ], [0.40, "ceilingspike3" ], [0.40, "ceilingspike4" ] ]
      }
      ]
      }
      ]
      },
    
      "hueShiftOptions" : [0]
    }
    
    


    mooncorelayer.biome.patch
    Code:
    [
      {
      "op": "replace",
      "path": "/ores",
      "value": "mooncore"
      },
      {
      "op": "replace",
      "path": "/undergroundPlaceables/items",
      "value":
       [
      {
      "mode" : "floor",
      "priority" : 1.0,
      "variants" : 1,
      "distribution" : "/biomes/distributions.config:hazardUndergroundLower",
    
      "type" : "object",
      "objectSets" : [
      {
      "pool" : [ [0.50, "groundspike1" ], [0.50, "groundspike2" ], [0.50, "groundspike3" ], [0.50, "groundspike4" ] ]
      }
      ]
      },
      {
      "mode" : "ceiling",
      "priority" : 1.0,
      "variants" : 1,
      "distribution" : "/biomes/distributions.config:hazardUndergroundCeilingLower",
    
      "type" : "object",
      "objectSets" : [
      {
      "pool" : [ [0.50, "ceilingspike1" ], [0.50, "ceilingspike2" ], [0.50, "ceilingspike3" ], [0.50, "ceilingspike4" ] ]
      }
      ]
      }
      ]
      }
    ]
    
     
  3. Mackinz

    Mackinz The Waste of Time

    Post your log for us, please, on Pastebin.
     

Share This Page