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. Shamyi

    Shamyi Big Damn Hero

    next patch, people are just speculating as to how exactly it
    will work. or maybe they know lua really well? either way ya, next patch
     
  2. Leosky

    Leosky Void-Bound Voyager

    yeah to come
     
  3. Madosuki

    Madosuki Pangalactic Porcupine

    Okay, I was confused for awhile when I tried doing a merge and it wasn't working. Good to know that I didn't do anything wrong with how it works and that it's just not implimented.

    Another plus to this will be for those people who are confused as to how modding even works at all. They'll be able to use mods without having to have someone hold their hand through the process.
     
  4. Shamyi

    Shamyi Big Damn Hero

    another benefit of this system would be that mods would be
    forever up to date from a compatability standpoint provided they
    do away with the need for version information in the .modinfo file
     
  5. Kawa

    Kawa Tiy's Beard

    So I just spent a couple minutes adapting the felins mod to this new system. I hope I got what I've done right, as there's just one last thing that needs addressing.

    The character creator. Indices, buttons... throw all the "add more button space" mods at the wall as you want. I had sent a proposal to bartwe and Tiy about making this more dynamic-like and maybe throwing away the indices entirely. I suppose that half of the proposal is still valid now.
     
  6. Med

    Med Phantasmal Quasar

    Speculation: How to delete some pickaxe recipes, move them to another tier, and add new beamaxe recipes:

    player.config

    {
    "__merge" : [],
    "defaultBlueprints" : {

    // Delete Platinum & Diamond picks from tier 1.
    // See correct deletion syntax

    "__merge" : [ ["delete", "tier1" ] ],
    "tier1" : [
    { "item" : "platinumpickaxe" },
    { "item" : "diamondpickaxe" }
    ],

    // Add new beamaxe recipes, and pickaxe recipes to later tiers.
    "__merge" : [],
    "tier1" : [
    { "item" : "beamaxe_copper" },
    { "item" : "beamaxe_silver" },
    { "item" : "beamaxe_gold" }
    ]
    "tier2" : [
    { "item" : "beamaxe_platinum" },
    { "item" : "platinumpickaxe" }
    ]
    "tier3" : [
    { "item" : "beamaxe_diamond" },
    { "item" : "diamondpickaxe" }
    ]
    }
    }

    Think I've got it right?
     
  7. Kawa

    Kawa Tiy's Beard

    Unlikely. You have three __merge keys in there. Keys, I believe, must be unique.
     
  8. Med

    Med Phantasmal Quasar

    The first two are copied directly from the original post, they are definitely correct. The third is the one I question as it is in-line with the second. :D Also below is the merge sample, two merges but not in-line.

    mod.gib.me
    Before
    Code:
    {
      "sample" : {
        "array" : ["foo", "bar", "baz", "bax"]
      }
    }
    Merge
    Code:
    {
      "__merge" : [],
      "sample" : {
        "__merge" : [
          [ "delete", "array" ]
        ],
        "array" : [ "bar", "bax" ]
      }
    }
    After
    Code:
    {
      "sample" : {
        "array" : ["foo", "baz"]
      }
    }
     
  9. Kawa

    Kawa Tiy's Beard

    You're right, but two keys with the same name in the same block is still a no-no.
     
  10. Med

    Med Phantasmal Quasar

    I think you're right. But there must be some way to both delete recipes from tier1, and add recipes to tier1 in the same file.
     
  11. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Incorrect. The way he described the system was not the most clear but being a programmer myself, i understand what is required.
    Code:
    {
      "__merge" : [],
      "defaultBlueprints" : {
        "__merge" : [],
        "tier1" : [
          { "item" : "new_item" },
          { "item" : "new_item2" },
          { "item" : "new_item3" }
        ]
      }
    }
    You don't provide any parameters to __merge if you want the array to be merged. He calls them maps and lists but in programming terms, they are objects and arrays. You only need to provide a parameter for __merge if you want to delete or overwrite something.
     
    Last edited: Dec 16, 2013
    michealv likes this.
  12. Kawa

    Kawa Tiy's Beard

    I call them dictionaries and lists. Can you guess my preferred language?
     
  13. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Unfortunately not :rofl: mine is primarily focused around web-based and Java languages.
     
  14. Shamyi

    Shamyi Big Damn Hero

    I'll have you know I passed an intro to c++ course in college :p

    I realize now that my code was meh.. that was only
    my guess, not being very familiar with lua
    but then I guess that's what I get being the first to take a guess at it
    while not really knowing much lua xD
     
    Last edited: Dec 17, 2013
  15. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    The only language i see is jSON. A language used to store data..

    aka "JavaScript Object Notation"
     
  16. Shamyi

    Shamyi Big Damn Hero

    <.< ah I see.. there's that ignorance of programming showing again xD
    good to know, I'll take the word of someone who's obviously worked with the stuff more
     
  17. Zion Fox

    Zion Fox Void-Bound Voyager

    The documentation for this is quite poor, nothing is specified on what file this should exist in (I know it's player.config, within a mod's folder), and the layout itself is quite confusing.

    I'm attempting to add a recipe to the list of recipes using the following code:
    Code:
    {
        "__merge" : [],
        "defaultBlueprints" : {
            "__merge" : [],
            "level36" : [ { "item" : "additionalitem" } ]
        }
    }
    which is placed within a player.config file inside a folder. (../mods/NewMod), sitting alongside the .modinfo file.

    Using the server to debug it, I'm running into syntax errors (and very bad exception handling) saying that "humanoidTiming" is missing. Anyone have any idea as to why?
     
  18. Med

    Med Phantasmal Quasar

    NEXT version of Starbound, not this version.

    That said, your syntax looks correct to me.
     
    Madosuki likes this.
  19. The | Suit

    The | Suit Agent S. Forum Moderator

    I think he should change the word "Next" to a more defined version.
    either with a proper name or number.

    Next is arbitrary value which never arrives. As there will always be a "next"
     
  20. Heliostorm

    Heliostorm Phantasmal Quasar

    Will there be a way to automatically assign indexes to races? Because otherwise race mods will always conflict with each other.
     
Thread Status:
Not open for further replies.

Share This Page