Tutorial [TUTORIAL] MERGE FILE TEMPLATE EXAMPLES

Discussion in 'Starbound Modding' started by The | Suit, Feb 26, 2014.

  1. The | Suit

    The | Suit Agent S. Forum Moderator

    These are a collection of Merge File examples to allow compatibility .
    ==========

    ADD NEW ITEM TO TREASURE POOL
    ==
    Code:
    {
      "__merge" : [],
      "basicMonsterTreasure" : [
        [1, {
            "pool" : [
           
              [ 0.99, [ "databit12375", 3] ]
              ]
              }
            ]
          ]
    }
    Because of the nature of the treasure pool - eszpecally of the monster treasure pool. Keep in mind monster drops are based on 6 different pool files. So if you want to make sure your item drops you will have to do this for all 6 files and all 10 levels. This is a sample of a single level for a single file.
    ==========

    MERGING MAIN QUEST - ADDING NEW PARALLEL STORY LINE
    ==
    Code:
    {
      "__merge" : [],
      "initialquests" : {
        "__merge" : [],
        "human" : [ "questname.gearup" ],
        "glitch" : [ "questname.gearup" ],
        "avian" : [ "questname.gearup" ],
        "apex" : [ "questname.gearup" ],
        "floran" : [ "questname.gearup" ],
        "hylotl" : [ "questname.gearup" ]
        }
      }
    This code will allow a PARALLEL QUEST to the main quest. Hence will make your quest compatible with every other mod that adds quests.
    ==========

    ADDING NEW TIER RECIPE + EDITING ROOT VALUE
    ==
    Code:
    {
      "__merge" : [],
      "defaultBlueprints" : {
        "__merge" : [],
        "tier1" : [
          { "item" : "rockscanner" } ,
          { "item" : "testgun" } ,
          { "item" : "prototype" }
          ]
      },
        "energyReplenishmentRate" : 50.0
    }
    This is a basic example of how to add recipes to the Tier 1.
    Also how you can edit root values such as energy recharge rate. As you can note an overwrite is not necessary - as it will replace the value automatically if one exists.
    ==========

    EXAMPLE OF HOW TO MERGE WEAPONS and TOOLS
    ==
    Code:
    {
      "__merge" : [
      [ "overwrite", "baseDps"],
      [ "overwrite", "rateOfFire"],
      [ "overwrite", "spread"]
      ],
      "baseDps" : [6.5, 7.5],
      "rateOfFire" : [7, 11],
      "recoilTime" : 0.1,
      "spread" : [1, 1],
      "multiplier" : 1.0,
      "classMultiplier" : 0.9,
      "accuracy" : 85
    }
    
    Notice the values - those which have arrays - require you to use an overwrite. Those without arrays [ ] <-- do not require you to use an overwrite. This is an important point to note.
     
    Last edited: Apr 9, 2014
  2. VeggieVampire

    VeggieVampire Space Hobo

    Would you mind going into more detail on the quest merging?
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    Not exactly sure what you want.
    Just copy that code into your quests.config file

    And replace questname.gearup - with the name of the quest you wish to give them initially.
    ==
    If you want some other clarification just ask what you want to do.
    This code "adds" to the initial quests, does not overwrite it.

    So they will have multiple starting quests - including the default one, which you do not need to add
     
  4. VeggieVampire

    VeggieVampire Space Hobo

    Noob question where are the config files located in the Startbound directory? Also thanks for the quick reply to the first question :)
     
  5. The | Suit

    The | Suit Agent S. Forum Moderator

  6. Ramones_fan

    Ramones_fan Pangalactic Porcupine

    is there a way to set the new quests into a variable and merge that into the new quests. that way one could add a group of quests to new races quickly.

    for example could you do something like
    Code:
    newquests : ["questline1.gearup", "questline2.gearup", ... "finalquestline.gearup"] 
    and then merge newquests into each race?
    edited to correct psuedocoding to closer to lua, not really familiar with it.
     
    Last edited: Apr 4, 2014
  7. The | Suit

    The | Suit Agent S. Forum Moderator

    No there are no merge shortcuts.
     
    Last edited: Apr 4, 2014
  8. Ramones_fan

    Ramones_fan Pangalactic Porcupine

    it was worth asking. ty for the quick response.
     
  9. PXLForce

    PXLForce Big Damn Hero

    How would I use merging to remove an item from the player.config file? I know this isn't recommended, but it is for personal/development use only.

    After having a look at this guide, I have tried the following player.config file in my mod:

    Code:
    {
      "_merge" : [],
      "defaultBlueprints" : {
        "_merge" : [
          [ "delete", { "item" : "woodencraftingtable1" } ]
        ]
      }
    }
    I would really appreciate some help with this!

    Thanks in advance,
    PXLForce
     
  10. The | Suit

    The | Suit Agent S. Forum Moderator

    Code:
    {
      "__merge" : [],
      "defaultBlueprints" : {
          "tier1" : { "__merge" : [ "list", [
            [ "delete",  { "item" : "woodencraftingtable1" } ]
        ] ] }
      }
    }
     
    PXLForce likes this.
  11. PXLForce

    PXLForce Big Damn Hero

    Many thanks!
     

Share This Page