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

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

  1. poster55

    poster55 Scruffy Nerf-Herder

    I'm having a hell of a time with this one.
    Code:
    "stats" : {
          "maxHealth" : {
            "baseValue" : 100.0
          },
          "maxShield" : {
            "baseValue" : 100.0
    I'm trying to get a feel for how paths work, but I've tried every variation I can think of to reference these values to no avail.
    Code:
    [
        { "op": "replace", "path": "/stats/maxHealth/", "value": { "baseValue": 1 } }
    ]
    
    [
        { "op": "replace", "path": "/stats/0/maxHealth/", "value": { "baseValue": 1 } }
    ]
    [
        { "op": "replace", "path": "/stats/maxHealth/baseValue", "value":  1  }
    ]
    These are just a few examples I have attempted with no success.
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    The reason you are having a hard time is because you did not properly follow the brackets.
    Always make sure what you are trying to edit is not encapsulated in another array.

    In your case the full container is

    Code:
      "statusControllerSettings" : {
        "statusProperties" : {
          "targetMaterialKind" : "organic",
          "mouthPosition" : [0, 0.75],
          "breathHealthPenaltyPercentageRate" : 0.05,
          "hitInvulnerabilityThreshold" : 0.01,
          "hitInvulnerabilityTime" : 2.0,
          "hitInvulnerabilityFlash" : 0.1
        },
    
        "appliesEnvironmentStatusEffects" : true,
        "minimumLiquidStatusEffectPercentage" : 0.1,
    
        "primaryAnimationConfig" : "/player/stat_primary.animation",
    
        "primaryScriptSources" : [
          "/scripts/util.lua",
          "/scripts/vec2.lua",
          "/stats/player_primary.lua"
        ],
    
        "primaryScriptDelta" : 1,
    
        "stats" : {
          "maxHealth" : {
            "baseValue" : 100.0
          },
          "maxShield" : {
            "baseValue" : 0.0
          },
          "maxEnergy" : {
            "baseValue" : 100.0
          },
          "maxBreath" : {
            "baseValue" : 100.0
          },
          "breathDepletionRate" : {
            "baseValue" : 4.0
          },
          "breathRegenerationRate" : {
            "baseValue" : 10.0
          },
          "encumberance" : {
            "baseValue" : 0.0
          },
          "fallDamageMultiplier" : {
            "baseValue" : 1.0
          },
          "powerMultiplier" : {
            "baseValue" : 1.0
          },
          "protection" : {
            "baseValue" : 0.0
          },
          "healthRegen" : {
            "baseValue" : 0.0
          },
          "shieldRegen" : {
            "baseValue" : 0.0
          },
          "energyRegenPercentageRate" : {
            "baseValue" : 0.285
          },
          "energyRegenBlockDischarge" : {
            "baseValue" : -1.0
          },
          "nude" : {
            "baseValue" : 0.0
          },
          "shieldSuppressed" : {
            "baseValue" : 0.0
          },
          "invisible" : {
            "baseValue" : 0.0
          },
          "invulnerable" : {
            "baseValue" : 0.0
          }
        },
    
        "resources" : {
          "health" : {
            "maxStat" : "maxHealth",
            "deltaStat" : "healthRegen",
            "initialPercentage" : 1.0
          },
          "shieldHealth" : {
            "maxStat" : "maxShield",
            "deltaStat" : "shieldRegen",
            "initialPercentage" : 1.0
          },
          "energy" : {
            "maxStat" : "maxEnergy",
            "initialPercentage" : 1.0
          },
          "energyRegenBlock" : {
            "maxValue" : 3.0,
            "deltaStat" : "energyRegenBlockDischarge",
            "initialPercentage" : 0.0
          },
          "breath" : {
            "maxStat" : "maxBreath",
            "initialPercentage" : 1.0
          }
        }
      } 


    Code:
    [
        { "op": "replace", "path": "/statusControllerSettings/stats/maxHealth/baseValue", "value":  1 }
    ]
     
  3. poster55

    poster55 Scruffy Nerf-Herder

    Ah, yeah I had thought I tried that before coming here. I'm not sure what I missed before that caused it to fail. I think perhaps I had moved baseValue into the value area. Thanks for the quick response.
     
  4. TrustMeIGotThis

    TrustMeIGotThis Big Damn Hero

    Just wanted to say thanks for this tutorial, it's been very helpful, even if I haven't (yet) been successful.
     
  5. Mackinz

    Mackinz The Waste of Time

    I am currently trying to edit the following pool and I am having intense difficulty for what should be an easy patch.

    Code:
    {
      "mushroomHarvest" : [ [0, { "pool" : [ {"weight" : 1.0, "item" : "shroom"} ],
          "poolRounds" : [
            [0.7, 1],
            [0.3, 2]
          ]
        } ]
      ]
    }
    
    My patch is this:

    Code:
    [
    { "op": "replace", "path": "/mushroomHarvest/0/1/pool/0/1",
    "value": 0.99
    }
    ]
    
    What am I doing wrong, and how can I fix this patch?


    Edit: Never mind
     
    Last edited: Feb 8, 2015
  6. The | Suit

    The | Suit Agent S. Forum Moderator

    Look again at your order after mushroom harvest.
    Compare it to the diagrams in tutorial
     
  7. KateisLost

    KateisLost Cosmic Narwhal

    Hi there:) I am hoping that maybe someone here could help me with a patching question/problem. I have had next to no luck trying to patch my More Saplings mod. I made it mostly for myself and didn't even think of patching it to begin with, but I thought others might like to use it so I posted it. But I know that it should be patched to have better compatibility with other mods. I simply need to make all foliage drop 2 saplings instead of one. I just can't figure out the right patching code to use to make it work. I have tried quite a few variations of the code and nothing works! Even when http://json-schema-validator.herokuapp.com/jsonpatch.jsp says it should.

    These are a few of the codes I have been trying

    Code:
    [
    {"op":"replace","path":"/dropConfig/drops","value":[{"item" : "sapling", "count": 2}]}
    ]
    Code:
    [
    {"op":"replace","path":"/dropConfig/drops","value":["sapling", "count", 2]}
    ]
    Code:
    [
    {"op":"remove","path":"/dropConfig","value":{"item":"sapling"}},
    {"op":"add","path":"/dropConfig","value":{"item":"sapling", "count": 2}}
    ]
    If anyone could help I would be very grateful. I am sure it is a simple fix for some and I am probably just being an idiot and not understanding it right.
     
  8. poweredbygamespy

    poweredbygamespy Phantasmal Quasar

    what file do you want to patch? is it in the same directory in the mod folder? is it named *.patch?
     
  9. KateisLost

    KateisLost Cosmic Narwhal


    The test file I am working with is .patch yes, and by directory you mean the same file location as the original file right?

    I am trying to patch the modularfoliage file under "plants-->trees-->savannahnew-->foliage-->baobab-->baobab.modularfoliage"

    To me the baobab tree is one of the easiest trees to find so I started with it
     
  10. DoomFire

    DoomFire Existential Complex

    I can't figure out why, but none of my remove operations are working...
    Can anyone spot anything wrong with this?

    Code:
    [
    {"op": "remove","path":"/blockKey/23"},
    {"op":"remove","path":"/blockKey/24"},
    {"op":"remove","path":"/blockKey/25"},
    {"op":"remove","path":"/blockKey/26"},
    {"op":"remove","path":"/blockKey/31"}
    ]
    That's taken out of the rest of the file, but all the other operations are replace, and all work... so.
     
  11. The | Suit

    The | Suit Agent S. Forum Moderator

    You will need to provide the file you are editing also
     
    DoomFire likes this.
  12. poweredbygamespy

    poweredbygamespy Phantasmal Quasar

    try this
    [
    {"op":"remove","path":"/dropConfig/drops/1"}
    ]
     
  13. agmoyer

    agmoyer Cosmic Narwhal

    I am trying to create a simple mod to add guns to the anvil crafting system but the player config I can't figure it out. I want to add the file I have Luger but how do I write it? I have created the recipe folder/files and the config I am at a lose. Do I type " [ {"op":"add","path":"/defaultBlueprints/unsorted/-","value":{"item":"Luger"} } ]" or what am I doing?
     
  14. The | Suit

    The | Suit Agent S. Forum Moderator

  15. agmoyer

    agmoyer Cosmic Narwhal

    Okay what I mean is I do not understand the whole code means I understand it is to add an item but it says tier1 does that mean the folder tier1? Because I do not have that... I previously followed an outdated tutorial so my folder structure could be very wrong. Thanks for reply though I really just want to make mods for others enjoyment as I love drawing and this game is great.
     
  16. The | Suit

    The | Suit Agent S. Forum Moderator

    Make sure you unpack your assets again. If you haven't done so recently.

    In that case you better start off with the basics
    http://community.playstarbound.com/index.php?threads/modding-guides.34001/

    All the tutorials in the sticky thread are uptodate. Anything not listed should be considered out of date.
    =
    in player.config blueprints you will see tier1
    all items listed under tier1 is known the player from the start. So by adding to tier1 he will know it.
    Keep in mind you may need to start a new character to see the effect happen.
     
  17. Mackinz

    Mackinz The Waste of Time

  18. KateisLost

    KateisLost Cosmic Narwhal


    That works great for that tree and a few others that have similar dropConfigs, now I just have to figure out the other trees that only drop one sapling or none at all.

    Thank you for your help!
     
  19. Lazy Joe

    Lazy Joe Scruffy Nerf-Herder

    Is there a way to add a whole folder instean of using batch?

    If i wanna ad hundreds of new recipes, will there be no other choice than listing all the name one after the other?
     
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    Nope no lazy way around it.
    If you are good at programming you can probably whip up a batch script to write it for you
     

Share This Page