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

    Xuhybrid Scruffy Nerf-Herder

    I don't know why i didn't mention this already because i meant to.
    Code:
    "__merge" : [],
    "__overwrite" : [ "tier2" ],
    "__delete" : [ "stoneaxe" ]
    This would be a more preferable way to format this syntax.
     
  2. simplex

    simplex Astral Cartographer

    How is having to split a mod in two, having to carefully take care of loading order and possibly having to do a manual merge of files simpler/more maintainable than incorporating asset Lua hooks in the API and doing a for loop? :p
     
  3. Westeller

    Westeller Space Penguin Leader

    I can't imagine it'd be necessary to use two mods to do something as routine as removing a few items from a list and then adding a few new ones. Do I know the syntax to delete specific items and add more for the same list without splitting the mod? Nope. Of course not. I could guess, but the only syntax anyone knows is what was posted in the beginning, and the rest is pure speculation. Ask again when we can play with it.

    I don't see why it would be, but even if it is impossible to do without two separate player.config files, I can't see this as a bad mark on the merge functionality, which can be expanded later or something. The important thing here is that we're getting the initial ability to edit files without completely replacing them. Even if our control over the process isn't as fleshed out as we'd like it to be, this is a great step forward.



    ---------------------------------------------------------


    Let me get this straight. Your final goal is to remove a few items from the tier1 list, and then add a few more.
    You're going to do this with two mods. One will overwrite Tier1 with a custom list - to remove the recipes you don't want.
    Then a new one is going to add the new recipes to the list?

    You could have added them to your custom list for the first overwrite, yea? One mod.

    This wouldn't be particularly compatible with other mods, though, because you're overwriting the entire list instead of removing specific items from it. Though mods that remove or change existing content are generally far less compatible than those that simply add new, it would be a bit better if you specifically remove the recipes that you don't want, and then add the new. The person you quoted, who originally posed the question, said that.

    Your solution of using two mods is sound, though, if the first simply deletes specific recipes instead of overwriting the entire list. Having that separate from adding new items to the list would also make the mod more modular - increasing overall mod compatibility by allowing users to easily disable that portion of the mod.
     
    Last edited: Dec 20, 2013
  4. Westeller

    Westeller Space Penguin Leader

    I think you're a bit confused. This functionality isn't currently available.
     
    Kawa likes this.
  5. VIcariousViking

    VIcariousViking Void-Bound Voyager

    I was. You are correct.
     
  6. Shoehead

    Shoehead Turbonerd of Scaremonies

    So what do you do for duplicate lists? For example there are two lists called "shirts" in the .species file, one for each gender.

    I have:
    Code:
    {
    {
    "__merge" : [],
      "genders" : {
      "shirt" : [ "unichest"],
      
      }
    }
    
     
    Last edited: Dec 23, 2013
  7. sirylcat

    sirylcat Scruffy Nerf-Herder

    Is this included in this update? I didn't see anything particular like this in the update list....
     
  8. Tyty

    Tyty Scruffy Nerf-Herder

    Damn, races still use indices.

    Still, this is way better. No more making a folder named zzzzzzzzzzzzzzz that contains a player.config.
     
    Karull likes this.
  9. madtulip

    madtulip Phantasmal Quasar

    working code sample for "universe.config:
    Code:
    {
        "__merge" : [],
        "speciesShips" : {
            "__merge" : [
            [ "overwrite", "apex" ],
            [ "overwrite", "avian" ],
            [ "overwrite", "floran" ],
            [ "overwrite", "human" ],
            [ "overwrite", "hylotl" ],
            [ "overwrite", "glitch" ]
        ],
        "apex" : "/ships/apex/madtulip_dropship.structure",
        "avian" : "/ships/avian/madtulip_dropship.structure",
        "floran" : "/ships/floran/madtulip_dropship.structure",
        "human" : "/ships/human/madtulip_dropship.structure",
        "hylotl" : "/ships/hylotl/madtulip_dropship.structure",
        "glitch" : "/ships/glitch/madtulip_dropship.structure"
      }
    }
    i mean syntax is correct if you have the dependencies.

    example for player.config to give yourself default items:
    Code:
    {
      "__merge" : [],
      "defaultItems" : [
          {"item" : "<My_Stuff>","count" : 100},
          {"item" : "<My_other_Stuff>","count" : 100}
      ]
    }
     
    Last edited: Dec 23, 2013
    Annuschka and Karull like this.
  10. Karull

    Karull Big Damn Hero

    This is awesome, just updated my player.config file for my race mod and it works!

    code I used for player.config:
    Code:
    {
      "__merge" : [],
      "species" : [ "yourcustomrace" ]
    }
    now to go through all other files and see what I can fix up.
     
  11. gibbed

    gibbed Orbital Explorer

    You don't need to explicitly specify overwrite for strings.

    Code:
    {
      "__merge" : [],
      "speciesShips" : {
        "apex"   : "/ships/apex/madtulip_dropship.structure",
        "avian"  : "/ships/avian/madtulip_dropship.structure",
        "floran" : "/ships/floran/madtulip_dropship.structure",
        "human"  : "/ships/human/madtulip_dropship.structure",
        "hylotl" : "/ships/hylotl/madtulip_dropship.structure",
        "glitch" : "/ships/glitch/madtulip_dropship.structure"
      }
    }
     
  12. omegadrace

    omegadrace Cosmic Narwhal

    Code:
    Error: Could not load /treasure/default.treasurepools asset, attempting to use default.
    AssetException: Could not read variant asset /treasure/default.treasurepools
    caused by: JsonParsingException: Cannot parse json file: /treasure/default.treasurepools
    caused by: JsonParsingException: Error parsing json: bad string, should be '"' at 17:1
      00996318
      007E1312
      004E9223
      004E959C
      004E1E0F
      004E1ECD
      004ECD4B
      004ED4BC
      004EE101
      0096564C
      7C80B729
    
    Warn: Slow asset 0.34 : /treasure/default.treasurepools
    Error: Exception caught in Thread Async root loader: VariantException: Variant type not Map in VariantMapIterator constructor
      007DC417
      007DC498
      00613104
      004DB4C7
      004016D8
      0096564C
      7C80B729

    Code:
    {
      "__merge" : [],
      "newraceStarterTreasure" : [
        [0, {
            "fill" : [
              "beamaxe",
              "flashlight",
              [ "torch", 10],
              [ "bonebooseed", 3],
              [ "wheatseed", 3],
              [ "newracestarter", 1]
            ],
            "levelVariance" : [0, 0],
            "allowDuplication" : false
          } ]
        ],
    }
    

    What am I doing wrong?
     
  13. Karull

    Karull Big Damn Hero

    Looks like you have an unnecessary comma after the last square bracket in the code.
     
    Last edited: Dec 23, 2013
  14. omegadrace

    omegadrace Cosmic Narwhal

    Yeah, I just realised that shortly after posting. Thank you anyway.
     
  15. Tyty

    Tyty Scruffy Nerf-Herder

    i am a butt who is a liar.

    This is great. It makes adding races way easier.
     
  16. Karull

    Karull Big Damn Hero

    elaborate? I haven't kept up much with all the changes
     
  17. Tyty

    Tyty Scruffy Nerf-Herder

    The game dynamically assigns IDs to races with the "playerSpecies" : true, tag in their .species file. charcreation.config will dynamically number buttons with no ID.

    It makes adding buttons manually for new races as the end-user a snap, and with a race extender you can literally just drag and drop races in.
     
  18. Karull

    Karull Big Damn Hero

    :O

    how would you properly set things up to work that way in the files?

    edit: nvm I figured it out
     
    Last edited: Dec 23, 2013
  19. omegadrace

    omegadrace Cosmic Narwhal

    Mind explaining how? I added new buttons with no ids, set playerspecies to true on the race, and nothing shows up.
     
  20. RockyTV

    RockyTV Big Damn Hero

    I don't get it. We make a new file like player.config but add the code to merge it with a new one?
     
Thread Status:
Not open for further replies.

Share This Page