Modding Help In patches, how do you know what the path is?

Discussion in 'Starbound Modding' started by BlueLeafeon, Jan 1, 2017.

  1. BlueLeafeon

    BlueLeafeon Cosmic Narwhal

    I want to make a patch to replace the glitch pig with a bunny, but I don't actually know how to do it. I have never been able to figure out the "path" system. What path do I use to replace the ship pet with another one?

    I ask because purchasable pets stopped removing the ship pet, and now I have this pig on my ship. I'd rather it be replaced with one I want, but I don't want to change the tech station, either.
     
  2. Antyrus

    Antyrus Pangalactic Porcupine

    Take a look at the file you want to patch. Basically, everything is enclosed in different levels of brackets, similar to how files work on your computer. For example:

    Code:
    {
      "objectName" : "apexarmchair",
      "colonyTags" : ["apex","apexvillage"],
      "rarity" : "Common",
      "category" : "furniture",
      "price" : 95,
      "description" : "This upholstery is bananas.",
      "shortdescription" : "Standard Issue Armchair",
      "race" : "apex",
    
      "apexDescription" : "Apex fashions have evolved since this chair was made; sadly, Apex freedoms have not.",
      "avianDescription" : "Such a comfortable seat. Is this an Apex nest?",
      "floranDescription" : "Sssickening.",
      "glitchDescription" : "Displeased. This chair offends my optics.",
      "humanDescription" : "A depressing armchair. Comfortable though!",
      "hylotlDescription" : "What effect must such.. inelegance have on the mind?",
      "novakidDescription" : "It ain't pretty, but it's comfortable.",
    
      "inventoryIcon" : "apexarmchairicon.png",
    
      "objectType" : "loungeable",
      "sitFlipDirection" : false,
    
      "orientations" : [
        {
          "image" : "apexarmchair.png:<color>",
          "imagePosition" : [-16, 0],
          "flipImages" : true,
          "direction" : "left",
          "frames" : 1,
          "animationCycle" : 0.5,
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ],
          "sitPosition" : [4, 20]
        },
        {
          "image" : "apexarmchair.png:<color>",
          "imagePosition" : [-16, 0],
          "direction" : "right",
          "frames" : 1,
          "animationCycle" : 0.5,
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ],
          "sitPosition" : [4, 20]
        }
      ]
    }
    

    You see that first bracket at the very top? That's your first /. If you wanted to change rarity, the path would be "/rarity". Occasionally you'll hit a series of brackets without names(look at orientations). These are generally contained within square brackets. You will refer to these by number as they appear, starting with zero. If you wanted to patch "image" for both subsections, your paths would look something like "/orientation/0/image" and "/orientation/1/image".

    Check out the patching guide here to read a tutorial written by somebody who knows what they're talking about
     
    bk3k likes this.
  3. BlueLeafeon

    BlueLeafeon Cosmic Narwhal

    Honestly, you explained it a lot better than the guide did, imo. I've tried that one before, and never got anywhere. Hopefully I'll be able to use this and change some pets around. :)
     

Share This Page