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

    The paths are right -
    You will need to check by removing all the ores and only have a single ore in the array.

    Go to a never visited before moon and see if only that ore spawns.
    If it does that means the moon can't generate anymore ore.

    If it doesn't well, probably should report it as a bug.
     
  2. Taiine

    Taiine Pangalactic Porcupine

    So I did a test.

    It is working with replace, but it isn't working with add.
    [​IMG]
    My ores the harder to see pink stuff to the right (stupid pink dirt) . This was done via replace

    {
    "op" : "replace",
    "path" : "/moonores",
    "value" : [[0.5, [ [ "erechusshard", 1.3], [ "plutonium", 1.40] ] ]]
    },

    However when I change it to add, edit the path and what not.. nothing spawns but plutonium.

    {
    "op" : "add",
    "path" : "/moonores/0/1/-",
    "value" : [ "erechusshard", 1.3]
    },

    That spawns nothing. I'm running around with /admin /fullbright on scanning an unexplored moon and nada. Something has got to be wrong with this and it's driving me up the wall. I don't want to stick with replace as that'll conflict with any other mods that edit ore spawns on the moon... (or any that work >.>)
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    Then probably it might be a hard coded limit on the number of ores possible based on the block density of the planet
     
  4. Taiine

    Taiine Pangalactic Porcupine

    Well that stinks. Only other place I see this mod idea working is on asteroids and that biome has no ores listed and I wouldn't know how to do the add bit to add it in.
     
  5. Lupus Alifer

    Lupus Alifer Void-Bound Voyager

    "path":"/learnBlueprintsOnPickup", is what made a new function NOT "value":[]

    so,
    "path":"/learnBlueprintsOnPickup",
    "value": "masonrytable"
    would add
    "learnBlueprintsOnPickup" : "manonrytable"

    and

    "path":"/learnBlueprintsOnPickup",
    "value": ["masonrytable"]
    would add a new array called learnBlueprintsOnPickup with the masonrytable value at 0
     
  6. and234

    and234 Scruffy Nerf-Herder

    Hey guys,
    I've got a really stupid question:
    want to change a recipe, lets say Steelbars, to just one Ironbar and one Liquidoil. How exactly do i do that?
    I'll start with

    [
    {
    "op" : "replace",

    What to type in to:

    "path" : "?????",
    "value" : ?????

    Sorry for that nooby question. I'm sitting here since two hours to figure that out.
    I'm sure it's simple but to stupid to understand right now
     
  7. Tofu Mc Dog

    Tofu Mc Dog Starship Captain

    Hiya folks,
    thanks a lot for doing this tutorial in the first place, thanks again for doing it in text format (I guess I am just too old to switch to video learning).

    First Request: Somewhere the OP stated that this thread is in the modding guides, which is not true (anymore?). Please could somebody restore it, if there is not a valid reason for its removal (outdated, incorrect information).

    Second request: I just learned the hard way, that batch-adding still is not possible and that Fruzstrated's code example from page 7:

    [
    {"op": "add", "path": "/defaultBlueprints/tier1/-", "value": { "item": "armor_chest" }},
    {"op": "add", "path": "/defaultBlueprints/tier1/-", "value": { "item": "armor_legs" }}
    ]

    is the way to go.
    And by the way, doing a little creative Find/Replace with your favorite editor makes this a quick fix for lists of whatever length.

    I would have found it helpful if this snippet of code had appeared in the tutorial. So my request is adding it.

    But that is totally secondary to seeing this Tutorial in the modding guides.


    /Edit:

    Can somebody point me to a good tutorial for regular expressions? I was being bigmouthed regarding the quick fix.
    In particular I can't get the line breaks to work (the regex does not find any permutation of \r and \n), everything else is fine.
     
    Last edited: Sep 7, 2015
  8. The | Suit

    The | Suit Agent S. Forum Moderator


    Ya I removed it from modding guides - since I put it in an Ebook format instead.
    http://community.playstarbound.com/resources/unofficial-modding-ebook.2930/

    It was much easier for me to maintain and edit in the long run.
    Since it seemed it was mostly my tutorials populating the entire modding scene, I wanted other users to feel comfortable also to write tutorials to get added.
     
  9. Tofu Mc Dog

    Tofu Mc Dog Starship Captain

    Ah, yes, thanks for that link then.

    My problem with regex is solved, too. I just lowered my ambition a little and did not need the regex at all. Still - a lesson learned.
     
  10. Panthera Pardus

    Panthera Pardus Subatomic Cosmonaut

    Hello Together,

    I have a small Question. Can someone provide a small Sample what I have to Enter on the Test-Page?
    I am asking this, because my Patch failed the Test. But is allready working ingame. So I am a little confused how that Test-Page works.

    In the spoiler is the Patch that failed the Test, but is working ingame.


    [
    {"op" : "add", "path" : "/defaultBlueprints/tier1/-", "value" : { "item" : "additionalhumanshipstorage" } }
    ]


    Joy and Happiness
    Panthera Pardus

    Edit: Oh oh... Sorry, if that Question is allready answered. I had read only the first page, and had not seen the other 10 pages. Sorry, I was a bit hasty.:facepalm:
     
    Last edited: Oct 4, 2015
  11. The | Suit

    The | Suit Agent S. Forum Moderator

    You have to make sure you remove comments from the Vanillia file you copy.
    The JSON test page will not work if comments are there.

    Comments are generally found in the code similar to
    // This is a comment

    I generally use http://tools.krza.de/jscs/JSCodeStripper.html
    to remove comments.

    Ironically the website also adds a comment to the last line, so you will want to manually remove it.
     
  12. Panthera Pardus

    Panthera Pardus Subatomic Cosmonaut

    Hello again,

    and thank you for the quick answer. It helped me to figure out what I made wrong. I Only copied the value in the data-window, instead of the "human.species" file. o_O:facepalm: Brain Lag :mwahaha:

    And befor I forget it. Thank You for the Tutorial. I will remember it to me, and consult it when I am unsure. So have a nice Day and

    Joy and Happiness
    Panthera Pardus

    Edit for the Post below: I threw a short look on it, and what the :speechless: ... . That's a really nice work, thanks for the note. :up:
     
    Last edited: Oct 4, 2015
  13. The | Suit

    The | Suit Agent S. Forum Moderator

    No problem, I also made an offline Ebook version of a full collection of guides made by me
    http://community.playstarbound.com/resources/unofficial-modding-ebook.2930/
     
  14. bk3k

    bk3k Oxygen Tank

    I suppose this thread is as good a place to ask as any. I'm having an issue that has be scratching my head. Basically I am trying to make a mod that will cause ships to have larger capacity fuel tanks as they are upgraded. It is simple enough, or so it would seem.

    If I just edit the vanilla files - for example ships\apex\apext4.structure
    Code:
    {
      "config" : {
      "shipUpgrades" : {
      "capabilities" : ["teleport", "planetTravel", "systemTravel"],
      "maxFuel" : 1000
      }
      },
    
      "backgroundOverlays" : [
      {
      "image" : "humanT4.png",
      "position" : [7, 11.5],
      "fullbright" : true
      },
      {
      "image" : "humanT4lit.png",
      "position" : [7, 11.5]
      }
      ],
    
      "blockKey" : "blockKey.config:blockKey",
      "blockImage" : "humanT4blocks.png"
    }
    
    
    Just change maxFuel to 65000 and the max fuel in game is 65000. The only thing is I want this to work with all ships be they vanilla or mod, so I made this patch instead.

    Code:
    [ {"op" : "replace",  
      "path" : "/config/shipUpgrades/maxFuel",
      "value" : 65000
      } ]
    
    
    The patch test website you linked to says this is valid, and the result after applying is

    Code:
    {
      "config" : {
      "shipUpgrades" : {
      "capabilities" : [ "teleport", "planetTravel", "systemTravel" ],
      "maxFuel" : 65000
      }
      },
      "backgroundOverlays" : [ {
      "image" : "apexT4.png",
      "position" : [ -4, 9 ],
      "fullbright" : true
      }, {
      "image" : "apexT4lit.png",
      "position" : [ -4, 9 ]
      } ],
      "blockKey" : "blockKey.config:blockKey",
      "blockImage" : "apexT4blocks.png"
    }
    
    So all is well except for one tiny detail... it has no effect in game! In the mod it is placed as ships\apex\apext4.structure.patch

    I'm seeing no error nor warnings in stdout.txt. It finds and loads the mod. Everything seems normal... too normal.
    I do not understand what I am doing wrong here! Surely it is a simple/stupid mistake.

    And yes I am creating new characters and upgrading their ships to test this out. I tried this absent all other mods, but that doesn't seem to make a difference.
     
    Last edited: Nov 10, 2015
  15. The | Suit

    The | Suit Agent S. Forum Moderator

    Just to make sure - you are trying it on a new character?
     
  16. bk3k

    bk3k Oxygen Tank

    correct
     
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    In that case you should probably report it as a bug then.
    There are a few config files which doesn't allow you to overwrite.
     
  18. Lexicon-Prime

    Lexicon-Prime Pangalactic Porcupine

    Hello all,
    I have a conundrum and could use any input on how to make something like this work...
    Code:
    { "op" : "replace", "path" : "/beamGunConfig/image", "value" : "/humanoid/<species>/gravgun.png" }
    I know the <species> tag works for other configurations such as client (for respawns) and ai (for tech) but when I use the line above I get this error code
    Code:
    Error: Could not load image asset '/humanoid/<species>/gravgun.png', using placeholder default.
    (AssetException) No such asset '/humanoid/<species>/gravgun.png'
    I suspect that the <species> tag is linked to specific values like "defaultSuitBase" in the "interface/ai/ai.config" file, so how does modify an already existing value to allow for this to function?
     
  19. The | Suit

    The | Suit Agent S. Forum Moderator

    You can't mix and match.
    The image is looking for a relative location of the file
    You can't input place holders in such a fashion, unless that parameter specifically programmed to accept references
     
  20. gregus1234

    gregus1234 Void-Bound Voyager

    Hi, I'm trying to make a translation to my lang using .patch filet but while i'll make my own aicommand which enables my Universal Protection tech, i got always error No such key in Json::("action"). There's a photo my upgradeship8.aicommand.patch in a attachment. I hope you can help me with this,
     

    Attached Files:

Share This Page