Tutorial Basic Patching Now With Path Guide [v1.9]

Discussion in 'Starbound Modding' started by The | Suit, Sep 19, 2014.

  1. NeoslayerX

    NeoslayerX Big Damn Hero

    ... This is for modders; right?
     
  2. Silent Strider

    Silent Strider Pangalactic Porcupine

    Yep, though you can make great use of it as a player if you want to tweak things. I maintain a few small personal mods with my personal tweaks, for example, and making them into patches means they should hardly, if ever, conflict with other mods or need updating.
     
    apinanaivot likes this.
  3. Ashirat

    Ashirat Seal Broken

    I'm having trouble adding race specific default blueprints.

    I've tried using a [race].species.patch
    Code:
    [
      {"op":"add","path":"/defaultBlueprints/tier1/-","value":{"item":"[itemname]"}}
    ]
    
    But the blueprint is still available to every race even though only one race has it's species file patched with that item.
     
  4. Mackinz

    Mackinz The Waste of Time

    If you want only one species to know a certain recipe, you patch the item into the species file. Make sure that admin mode is not on and that player.config does not have the same item (patched) in it.
     
    Ashirat likes this.
  5. Ashirat

    Ashirat Seal Broken

    I was about to give an annoyed reply that that was exactly what I'd done but I decided to double check and it turns out my character knew the recipe anyway because she had crafted it while I was testing before I made it race specific.

    So I did patch it correctly I just didn't realize it worked like that, thank you anyway for helping me figure it out.
     
  6. Tamamo89

    Tamamo89 Pangalactic Porcupine

    So to add to the vanilla blueprints i would do this?

    Code:
    [
      {"op":"add","path":"/learnBlueprintsOnPickup","value": "vine"  }
    ]
     
  7. Mackinz

    Mackinz The Waste of Time

    What file are you patching?
     
  8. Tamamo89

    Tamamo89 Pangalactic Porcupine

    Code:
    {
      "itemName" : "vine",
      "price" : 0,
      "category" : "block",
      "rarity" : "Common",
      "inventoryIcon" : "vineicon.png",
      "shortdescription" : "Vine",
      "description" : "A thick coil of vines. They look strong.",
      "glitchdescription" : "Fascinated. It appears these strong vines were woven together as they were grown.",
      "florandescription" : "Viness grow sstrong just like Floran.",
      "novakiddescription" : "These vines are massive lookin'.",
    
      "materialId" : 171
    }
    -Nope: just tested it, it doesn't work :/
    I went into admin mode to make sure the recipe was available. And it's there. So I'm not sure what I'm doing wrong?
     
    Last edited: Aug 27, 2016
  9. The | Suit

    The | Suit Agent S. Forum Moderator

    You got it 50% right.
    You are missing some brackets.

    Put your patch code in the patcher and see what you get.
    What you need to get should look like this.
    Code:
      "learnBlueprintsOnPickup" : [ "platinumblock" ],
    
    What you did will look like this

    Code:
      "learnBlueprintsOnPickup" : "platinumblock",
    
     
  10. Tamamo89

    Tamamo89 Pangalactic Porcupine

    Code:
    [
      {"op":"add","path":"/learnBlueprintsOnPickup","value": [ "vine" ]  }
    ]
    And that gives me the exact result I wanted.

    edit: Oh I forgot to mention. I was patching the wrong file. It's vine.matitem not vine.material lol.
     
    Last edited: Aug 28, 2016
  11. Forcedminer

    Forcedminer Scruffy Nerf-Herder

    what's the coding difference between ".species.patch" and "player.patch" ?

    I've made a shotgun mod that adds two shotguns all races know at the start but im having trouble making say the apex know their own type.
    I have apex.species.patch inside the...........i......eh...
    excuse me i have to go scream into a pillow
    **DISREGARD**
    moral of the story.....as always code won't work even if you little comma is out of place. :p
     
    foxtails likes this.
  12. RagnaWolf999

    RagnaWolf999 Subatomic Cosmonaut

    how do i go about adding outfits to character creation?
     
  13. Mackinz

    Mackinz The Waste of Time

    Patch species files.
     
  14. RagnaWolf999

    RagnaWolf999 Subatomic Cosmonaut

    i know that i just don't know the paths
     
  15. Mackinz

    Mackinz The Waste of Time

    You are supposed to learn by experimentation but I just copied and edited patch files from one of Kawa's mods:

    Code:
    [
        { "op": "add", "path": "/genders/0/shirt/-", "value": "blah" },
        { "op": "add", "path": "/genders/1/shirt/-", "value": "blah" },
        { "op": "add", "path": "/genders/0/pants/-", "value": "blah" },
        { "op": "add", "path": "/genders/1/pants/-", "value": "blah" }
    ]
    
     
  16. apinanaivot

    apinanaivot Cosmic Narwhal

    What is wrong with this code:

    [
    {
    "op": "add",
    "path": "/basicmerchant/0",
    "value": { "item" : { "name" : "darkwoodmaterial" }, "rarity" : 1 }
    }
    ]
    I am trying to make every merchant sell wood (just as a experiment). This is the code i am trying to add the patch to:

    "basicmerchant" : [
    [0, [
    { "item" : { "name" : "torch" }, "rarity" : 0.3 },
    { "item" : { "name" : "flare" }, "rarity" : 0.3 },
    { "item" : { "name" : "climbingrope" }, "rarity" : 0.3 },
    { "item" : { "name" : "redstim" }, "rarity" : 0.05 },
    { "item" : { "name" : "bluestim" }, "rarity" : 0.05 },
    { "item" : { "name" : "yellowstim" }, "rarity" : 0.05 },
    { "item" : { "name" : "paperplane" }, "rarity" : 0.0001 },
    { "item" : { "name" : "beachball" }, "rarity" : 0.0001 },
    { "item" : { "name" : "bowlingball" }, "rarity" : 0.0003 },
    { "item" : { "name" : "bowlingpin" }, "rarity" : 0.0003 },
    { "item" : { "name" : "firework" }, "rarity" : 0.0002 },
    { "item" : { "name" : "fireworkblue" }, "rarity" : 0.0002 },
    { "item" : { "name" : "fireworkgreen" }, "rarity" : 0.0002 },
    { "item" : { "name" : "noveltybanana" }, "rarity" : 0.00005 }
    ]]
    ],​
     
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    Check your code here,
    http://json-schema-validator.herokuapp.com/jsonpatch.jsp

    And see what happens when you use that patch.

    Don't let the "success" Fool you.
    Actually look at the result.
     
  18. apinanaivot

    apinanaivot Cosmic Narwhal

    It just says "Invalid JSON: parse error."
     
  19. The | Suit

    The | Suit Agent S. Forum Moderator

    That is because you have to make the bottom one valid first - before you can test it.

    Code:
     {
    "basicmerchant" : [
    [0, [
    { "item" : { "name" : "torch" }, "rarity" : 0.3 },
    { "item" : { "name" : "flare" }, "rarity" : 0.3 },
    { "item" : { "name" : "climbingrope" }, "rarity" : 0.3 },
    { "item" : { "name" : "redstim" }, "rarity" : 0.05 },
    { "item" : { "name" : "bluestim" }, "rarity" : 0.05 },
    { "item" : { "name" : "yellowstim" }, "rarity" : 0.05 },
    { "item" : { "name" : "paperplane" }, "rarity" : 0.0001 },
    { "item" : { "name" : "beachball" }, "rarity" : 0.0001 },
    { "item" : { "name" : "bowlingball" }, "rarity" : 0.0003 },
    { "item" : { "name" : "bowlingpin" }, "rarity" : 0.0003 },
    { "item" : { "name" : "firework" }, "rarity" : 0.0002 },
    { "item" : { "name" : "fireworkblue" }, "rarity" : 0.0002 },
    { "item" : { "name" : "fireworkgreen" }, "rarity" : 0.0002 },
    { "item" : { "name" : "noveltybanana" }, "rarity" : 0.00005 }
    ]]
    ] }
    
     
  20. apinanaivot

    apinanaivot Cosmic Narwhal

    Ok, here is the result:

    It creates a weird "[ 0, [" In there. I don't know what is causing it.

    EDIT: Seems like the patch is supposed to go under the [ 0, [ but for some reason, doesn't
     
    Last edited: Sep 25, 2016

Share This Page