Overriding and merging config files in mods. (DEPRECATED)

Discussion in 'Starbound Modding' started by bartwe, Dec 16, 2013.

Thread Status:
Not open for further replies.
  1. Kawa

    Kawa Tiy's Beard

    If by "the last part" you mean "moving stuff from the metalwork station to the wiring station", then I just explained that.
     
  2. Mackinz

    Mackinz The Waste of Time

    I meant this line:

    How would I code this? :)
     
  3. Kawa

    Kawa Tiy's Beard

    I'm thinking... { "__merge" : [ [ "overwrite", "groups" ] ], "groups" : [ "wiringstation", "other", "all" ] } as the sole content in this example. Trick being that just using "__merge" : [ ] would add "wiringstation" to the groups without replacing "metalworkstation".
     
  4. Mackinz

    Mackinz The Waste of Time

    Interesting... How would this be formatted, though?

    I really would like it to remove the "metalworkstation" group, so that would be awesome.

    Edit: Here's a pastebin for my current __merge coding. Can I change it to delete the last seven from Tier 1 and include your __merge suggestion, too?

    http://pastebin.com/TeGS61ev


    {
    "__merge" : [],
    "defaultBlueprints" : {
    "tier3" : [
    { "item" : "spawnerapexchef" },
    { "item" : "spawnerapexsouschef" },
    { "item" : "spawneravianchef" },
    { "item" : "spawneraviansouschef" },
    { "item" : "spawnerfloranchef" },
    { "item" : "spawnerfloransouschef" },
    { "item" : "spawnerglitchchef" },
    { "item" : "spawnerglitchsouschef" },
    { "item" : "spawnerhumanchef" },
    { "item" : "spawnerhumansouschef" },
    { "item" : "spawnerhylotlchef" },
    { "item" : "spawnerhylotlsouschef" },
    { "item" : "spawnerdrinkmerchant" },
    { "item" : "spawnerapex" },
    { "item" : "spawneravian" },
    { "item" : "spawnerfloran" },
    { "item" : "spawnerglitch" },
    { "item" : "spawnerhuman" },
    { "item" : "spawnerhylotl" },
    { "item" : "spawnerguard" }
    ]
    }
    }
     
    Last edited: Jan 11, 2014
  5. Kawa

    Kawa Tiy's Beard

    Oh, you want it formatted to boot? Here, this is the entire .recipe file to move a recipe from anywhere to the wiringstation:
    Code:
    {
      "__merge" : [ [ "overwrite", "groups" ] ],
      "groups" : [ "wiringstation", "other", "all" ]
    }
    You cannot remove specific items from simple lists.
     
  6. Mackinz

    Mackinz The Waste of Time

    I'm sorry. I'm new to this. :<

    I learn like a Floran: reverse-engineering.

    Would this go in player.config, an individual .recipe file, or somewhere else?

    Darn.

    Also, did you check my pastebin of my current coding? If not, here it is again.
     
  7. Kawa

    Kawa Tiy's Beard

    Now, normally I'd make at least some attempt to not look like a total asshole, but you have crossed the line.

    [​IMG]
    To compare yourself to a Floran is insulting to Florans.

    So you linked to a pastebin, put the exact same stuff right below the link, then linked it again? That only makes me less likely to look. But to offset any dickishness earlier in this post, I'll look and tell you that it seems syntactically perfectly correct, but may not do what you intend it to do.
     
  8. Mackinz

    Mackinz The Waste of Time

    Technically, I did not compare myself to a Floran. I just stated that I learn like a Floran does: through reverse engineering.

    I apologize if I offended you or Florans in any way, shape or form.

    I thought you might not have noticed it. I apologize. You seemed to have quoted me before I edited it in, so I thought that you might have missed my edit.

    Okay, thank you.
     
    Kawa likes this.
  9. FiesesAlien

    FiesesAlien Subatomic Cosmonaut

    Uhm... if you add something to the game:

    Code:
    "__merge" : []
    nothing more, nothing less. That adds your content. A mod shouldnt touch vanilla-things yet i think. Nothing was overwritten so far what ive done. If you delete files or let the game treat files as they where deleted you make it nearly impossible for other mods to work together with yours, or am i wrong?


    Stay crunchy.
     
  10. jLnMart

    jLnMart Void-Bound Voyager

    i have a annoying case here ... imagine you want edit a existing dungeon part...
    in asset we have whateverdungeon.dungeon :
    Code:
    {
      "metadata" : {
        "name" : "whatever",
        "species" : "dummy",
        "rules" : [ ],
        "anchor" : [ "anchor1" ],
        "gravity" : 80,
        "maxRadius" : 2000,
        "maxParts" : 100
      },
      "tiles" : [
        [ ... ]
      ],
      "parts" : [
        {
          "name" : "partx",
          "rules" : [
            [ "maxSpawnCount", [2] ],
            [ "doNotConnectToPart", [ "party" ] ]
          ],
          "def" : [ "image", [ "partx.png", "partx-objects.png" ] ]
        },
        [ ... ]
      ]
    }
    
    so i create whateverdungeon.dungeon in my mod directory
    Code:
    {
      "__merge" : [ ],
      "tiles" : [
        {
          "value" : [0, 0, 210, 255],
          "comment" : "my new bruch",
          [ ... ]
        }
      ],
      "parts" : [
        {
          "name" : "partx",
          "rules" : [
            [ "maxSpawnCount", [33] ], // edit here
            [ "doNotConnectToPart", [ "party", "partz" ] ] // edit here too
          ],
          "def" : [ "image", [ "partx.png", "partx-objects.png" ] ] // i don't need to change this a can change "partx.png" in my mod folder and use my new brush in it.
        },
       {
          "name" : "partz",
          [ ... ]
        }
      ]
    }
    
    problem here, you can overwrite "partx" it's dont have index, you dont want overwrite all part either ( mod compatibility issus, update issus and i'am too lazy issus ).
    with a simple "__merge":[] the game will crash after merge because you have 2 entity with the same name value.
    we need the possibility of call this with one of this attributes, or a if someone has a trick. i meaby miss something.
     
  11. Kawa

    Kawa Tiy's Beard

    Yay, a third (or is it fourth already) case of the same problem that was identified a page or so back and had a great fix proposal! This is great, I'm not kidding. It's one more proverbial signature for change.

    Unfortunately you can't do it. Not with the system's capabilities now.
     
  12. jLnMart

    jLnMart Void-Bound Voyager

    oups sorry, it's one page ago and i miss it....
     
  13. isource

    isource Master Chief

    Have same problem here - celestial.config have sectors [ {}, {}, ..., {} ] - and i don't know how to select sectors to merge into them.

    But sectors have an id, is there any way to use that to select item to merge?

    Anyway, i'm surprised developers have offered this kind of syntax - __merge syntax is not clear.

    I think
    Code:
    {
      "__inherit" : [], // we're not overwriting mark
      "__merge" : [
        { "to" : "sectors.sectorx.worldParameters.unlockedBiomes", "what" : _whatewer_ }
        // access with a key or array index or specific id (sectorx for example)
      ],
      "__remove" : [ "sectors.sectorx.worldParameters.unlockedBiomes.tentacles" ]
    }
    would be more distinct
     
  14. Kawa

    Kawa Tiy's Beard

    Holy shit, you guys.
     
  15. isource

    isource Master Chief

    overlap mode? and "match" id... where can i learn about this modes?
     
  16. Kawa

    Kawa Tiy's Beard

    They're not implemented. They might never be. It kinda depends on the devs having better eyesight than you guys.
     
    Shadewarp likes this.
  17. PsudoSage

    PsudoSage Aquatic Astronaut

    Will this update make it possible for characters to learn new recipes and stuff without starting a new character?
     
  18. Kawa

    Kawa Tiy's Beard

    Insufficient data, but it seems unlikely to me.
     
  19. Shadewarp

    Shadewarp Pangalactic Porcupine

    Not sure what you mean? It's possible to force recipes onto existing characters... Either by using the learnonpickup command or by placing the tech on a tier where you can craft the starmap/tech upgrade again - reusing it will learn all recipes not already available - if none of this is what you mean... I don't know :p
     
  20. teihoo

    teihoo Ketchup Robot

    In items/defaultParameters.config we have this:
    Code:
    {
      "damageFactors" : {
        "plantish" : 0.3,
        "blockish" : 0.6,
        "beamish" : 0.6,
        "explosive" : 1.0,
        "fire" : 0.0,
        "tilling" : 0.0
      },
    
      "damageRecovery" : 0.2,
      "dropCollision" : [-4.0, -5.0, 4.0, 5.0],
      "missingIcon" : "/interface/inventory/x.png",
    
      "materialItems" : {
        "cooldown" : 0.05
      },
    
      "blockRadius" : 2,
      "altBlockRadius" : 1,
      "pickupSounds" : [ "/sfx/interface/item_pickup.wav" ],
      "defaultTimeToLive" : 300.0,
      "defaultCriticalItemTimeToLive" : 1000000.0,
      "defaultMaxStack" : 1000
    } 
    So now I want to make simple merge to change defaultMaxStack value (it should be simple, but apparently i bumped somewhere and idk where!)
    Code:
    {
      "__merge" : [],
      "defaultMaxStack" : 9999
    }
    I've also tried with delete and and overwrite options in merge and each time i get a crash on startup ... so what am I doing wrong?

    I'm feeling quite stupid at the moment... and the crash log says:
    Error: Could not instantiate item '[AvianGlide, 1, {}]'. AssetException: Could not read variant value /items/defaultParameters.config:pickupSounds
    caused by: VariantException: No such key in Variant::get("pickupSounds") in query("pickupSounds")

    Is there a way to display what your merge actually did? That would be very useful :)
     
Thread Status:
Not open for further replies.

Share This Page