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

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

  1. The | Suit

    The | Suit Agent S. Forum Moderator

    It isn't "Some reason"
    There is only 1 reason.

    The path is wrong.
     
  2. apinanaivot

    apinanaivot Cosmic Narwhal

    And you are not going to tell me what is wrong with it?
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    This whole guide's purpose is to teach you proper pathing.
    From what you wrote as your path initially it is apparent you do not understand paths at all.
    If i told you the answer - you would not be able to handle more complex paths and always be reliant.

    Give a man a fish, feed him for a day. Teach a man to fish, feed him for a life time.

    I suggest reading the guide again especially the 2nd part which is a pathing guide.
    Understand it and apply.

    I will tell you now, you made 2 major mistakes;
    1. Even if your path was right - it would have replaced an existing item.instead of adding a new one ( which would have worked - but I am sure not what you intended )
    2. The path I am guessing you wrote 0 because there was a 0 in the code snippet. Which is not the purpose of writing a 0 in the path at all.

    1. Re-read the entire tutorial.
    2. Follow and learn the examples
    3. Then try again.
     
  4. apinanaivot

    apinanaivot Cosmic Narwhal

    You can also teach people to fish by showing them how its done.
     
  5. The | Suit

    The | Suit Agent S. Forum Moderator

    Fine
    Code:
    [
     {
      "op": "add",
      "path": "/basicmerchant/0/1/-",
      "value": { "item" : { "name" : "darkwoodmaterial" }, "rarity" : 1 }
     }
    ]
    
    Now you should learn why the 0 and 1 is there.
    Also why it ends in a minus sign.
    That 0 has no relation what so ever to the 0 in the code.

    Re-read the entire tutorial and learn the basics.
     
    apinanaivot likes this.
  6. Alec Valentine

    Alec Valentine Big Damn Hero

    I have a problem and this being my 34 try I think I need help please.

    I'm trying to patch and replace the mmupgradegui.config with a mmupgradegui.config.patch.

    This is the data(with all what I think is unnecessary stuff regarding this removed):
    Code:
    {
      "gui" : {
    
      "upgrades" : {
        "power1" : {
          "button" : "btnPower1",
          "prerequisites" : [],
          "moduleCost" : 8,
          "highlight" : "powergen",
          "icon" : "/interface/scripted/mmupgrade/upgradepower.png",
          "description" : "Increase matter deconstruction rate by 100%",
          "essentialSlot" : "beamaxe",
          "setItemParameters" : {
            "tileDamage" : 2.4,
            "minBeamJitter" : 0.1,
            "maxBeamJitter" : 0.2
          }
        },
        "power2" : {
          "button" : "btnPower2",
          "prerequisites" : ["power1"],
          "moduleCost" : 16,
          "highlight" : "powergen",
          "icon" : "/interface/scripted/mmupgrade/upgradepower.png",
          "description" : "Increase matter deconstruction rate by 200%",
          "essentialSlot" : "beamaxe",
          "setItemParameters" : {
            "tileDamage" : 3.6,
            "minBeamJitter" : 0.15,
            "maxBeamJitter" : 0.25
          }
        },
        "power3" : {
          "button" : "btnPower3",
          "prerequisites" : ["power2"],
          "moduleCost" : 32,
          "highlight" : "powergen",
          "icon" : "/interface/scripted/mmupgrade/upgradepower.png",
          "description" : "Increase matter deconstruction rate by 300%",
          "essentialSlot" : "beamaxe",
          "setItemParameters" : {
            "tileDamage" : 4.8,
            "minBeamJitter" : 0.2,
            "maxBeamJitter" : 0.3
          }
        }
      }
    }
    
    I have tried a series of patch, and so far this is the only one that doesn't crash the game, but doesn't seem to have any effect:
    Code:
    [{
        "op":"replace",
        "path":"gui/upgrades/power3",
        "value":{"description" : "Increase matter deconstruction rate by 1500%"}
       
    },
    {
        "op":"replace",
        "path":"gui/upgrades/power3",
        "value":{ "setItemParameters" :{
                "tileDamage" : 24,
                "minBeamJitter" : 0.2,
                "maxBeamJitter" : 0.3
            }
        }
    }]
       
    
    Now, I don't know how to manage a list of objects, the tutorial only shows list of objects inside array positions. And the patch checker, or I don't know how to use them, or they give me a fatal fail error as result, with patch and data syntax being okay'd by it.

    Plus the lag between updating the mod by the mod uploader tool, test it, tweak the patch, re-upload and repear is making me a tad crazy.
     
  7. The | Suit

    The | Suit Agent S. Forum Moderator

    I got to ask.... why are you "reuploading" and testing it.....
     
  8. Alec Valentine

    Alec Valentine Big Damn Hero

    I know only of two ways of testing modifications, one by using steamcmd, which makes me relog to the Steam desktop client to play and test it, and the other one is the mod uploader tool, which uploads it.

    Is there something else which I don't know?
     
  9. Mackinz

    Mackinz The Waste of Time

    How about a patch validator?
     
  10. Alec Valentine

    Alec Valentine Big Damn Hero

    [​IMG]

    Tried that one and the other on the OP, and one gives me this, which I don't understand beyond the obvious failure, which doesn't seems to indicate it, and if it does I don't know how to read it. And the other one I don't understand how to use it.
     
  11. apinanaivot

    apinanaivot Cosmic Narwhal

    You don't have to install your mods through Steam to test them. You just put the mod into the mods folder and edit it directly there.
     
  12. The | Suit

    The | Suit Agent S. Forum Moderator

    All you do is keep the mod folder inside your starbound / mods
    http://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/

    They never need to be uploaded to steam to test.
    You only upload after you are a 100% finished making your mod.
     
  13. Alec Valentine

    Alec Valentine Big Damn Hero

    Thank for the ebook, the Asset Packaging it's making everything much faster. But regarding patching, the ebook brings me back to this thread for more information and help.

    And thanks to the speed provided by the Asset Packaging I tried a few more patches(with its syntax okey'd by the checkers althou) to try to replace the objects, one of which surprisingly didn't crashed.
    I mean, they are just objects list inside other objects, they are not arrays so I don't need to specify the array position, just the path by following the object nesting order, and being as it isn't crashing the game. So I'm really at my wits end regarding ways to replace the objects.
     
  14. The | Suit

    The | Suit Agent S. Forum Moderator

    I would have thought you would have figured it out by now - if you read this guide.
    The mistake is really basic,

    Code:
    "path":"/gui/upgrades/power3",
    "path":"/gui/

    Also I am hoping you aren't uploading to steam anymore just to test it.
     
  15. Alec Valentine

    Alec Valentine Big Damn Hero

    I'm not uploading to Steam anymore thanks to the guide, and I also tried using that path(and a series of variations of it, because I really don't know what else to do), and it still doesn't seems to work. The text doesn't change from vanilla, same with the tileDamage.

    The mod folder is made as follows: ModName\interface\scripted\mmupgrade\mmupgradegui.config.patch


    Here is the lastest try I did, with the tileDamage set so I

    Code:
    [{
        "op":"replace",
        "path":"/gui/upgrades/power3",
        "value":{"description" : "Increase matter deconstruction rate by 1500%"}
       
    },
    {
        "op":"replace",
        "path":"/gui/upgrades/power3",
        "value":{ "setItemParameters" :{
                "tileDamage" : 1,
                "minBeamJitter" : 0.2,
                "maxBeamJitter" : 0.3
            }
        }
    }]
       


    "path":"/gui/upgrades/power3",

    Being "/" the root of the tree, gui/upgrades/power3 the objects in which it is nested, "description" would point to the name's value inside power3 list of objects changing it. Same with "setItemParameters" althou that's another list of objects, I "thin"k it should work.
     
  16. The | Suit

    The | Suit Agent S. Forum Moderator

    Are you trying with a new character?
    Some changes do not work on existing characters - because the values will be set in the save file and not updated if trying to edit existing values
     
  17. Alec Valentine

    Alec Valentine Big Damn Hero

    Tried with a new one, and it still doesn't work.

    I'm saving the .pak on E:\Steam\steamapps\common\Starbound\mods, with the mod being in ModName\interface\scripted\mmupgrade\mmupgradegui.config.patch before being packed. and it does appear in the mods active in-game.
     
  18. The | Suit

    The | Suit Agent S. Forum Moderator

    You don't need to pak mod to test it either. Pak is only for distribution.
    You can run the mod from the unpacked folder it self - as long as it is in the mod folder ( in its own folder ) .
     
  19. Shadow Wolf TJC

    Shadow Wolf TJC Spaceman Spiff

    @Alec Valentine: Took a quick look at your problem myself, and apparently, you had the path all wrong. I believe that this is what you're looking for:
    Code:
    [
    { "op" : "replace", "path" : "/upgrades/power3/description", "value" : "Increase matter deconstruction rate by 1500%" },
    { "op" : "replace", "path" : "/upgrades/power3/setItemParameters", "value" : {
                "tileDamage" : 24,
                "minBeamJitter" : 0.2,
                "maxBeamJitter" : 0.3
            }
    }
    ]
    I also changed things around so that it would surgically overwrite a select few parts of "power3" instead of the whole thing, which was what it was doing before.
     
  20. Alec Valentine

    Alec Valentine Big Damn Hero

    Thank you for that tip, that will make testing even quicker.

    Thank you very much, it was the path what was wrong all along and I didn't realize. Althou tileDamage doesn't seem to be working, I'm going to fiddle around more to see if I can fix it by myself.
     
    Last edited: Oct 4, 2016

Share This Page