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

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

  1. sayter

    sayter The Waste of Time

    devs: sticky this post please!
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    https://support.microsoft.com/kb/865219?wa=wsignin1.0

    You can find this thread in modding guides
    -
    Otherwise there just would be so many stickies it would clutter the first page.
     
  3. sayter

    sayter The Waste of Time

    Fair enough. Didn't realize it was in there (my own fault for not checking) :)
     
  4. shardshunt

    shardshunt Cosmic Narwhal

    yeah lol normally im pretty good at things like that (just had a brain fart)
     
  5. Holgast

    Holgast Scruffy Nerf-Herder

    I'm having difficulty adding a fuelamount parameter to items that don't have it. I'm using

    Code:
    [
      {
        "op": "add",
        "value": [
        "fuelAmount" : 1
        ]
      }
    ]
    but the jsonpatch website says there should be a comma somewhere, which doesn't make any sense because there is only one thing I'm changing. What am I doing wrong?
     
  6. The | Suit

    The | Suit Agent S. Forum Moderator

    You always need a path - otherwise how is the program to know where it goes?

    Code:
    [
      {
        "op": "add",
        "path" : "/fuelAmount",
        "value": 1
      }
    ]
     
    SilhouetteXD likes this.
  7. Holgast

    Holgast Scruffy Nerf-Herder

    Thanks, I assumed that because there were no sub-categories that it would not need a path. I was clearly misguided.
     
  8. Velornar

    Velornar Pangalactic Porcupine

    Hello again...I have got a problem for the universe_server.config.patch I'm trying to make.
    The way to make sure all the .structure I made for each tier of the ship
    But obviously there is a problem at line 7 (trusting the JSON schema validator).
    I quote: "code 93"; " expecting double quote to start field name."
    I'm completly confused, I'm not gonna introduce any name between comma at this place of the file. is there somthing I have missed to close this scheme part ? any space missing ?
    Even with a translator I cant figure out what is the problem, I have tried to understand the full tutorial but...really, seems thats still not it (yes my english is awfull).

    Code:
    [
     {
    "op": "replace",
    "path": "/universe_server/speciesShips"
      "value" : { "human" : ["/ships/human/usspolarisT0.structure", "/ships/human/usspolarisT1.structure", "/ships/human/usspolarisT2.structure", "/ships/human/usspolarisT3.structure", "/ships/human/usspolarisT4.structure", "/ships/human/usspolarisT5.structure", "/ships/human/usspolarisT6.structure", "/ships/human/usspolarisT6.structure", "/ships/human/usspolarisT7.structure", "/ships/human/usspolarisT8.structure" ]
      },
    ]
    
    If you could help me again, thank you again in advance ^^
     
  9. Motionless

    Motionless Pangalactic Porcupine

    Velornar

    "path": "/speciesShips/human"
    "value" : ["/ships/human/usspolarisT0.structure",
    etc etc
    remove comma from last "}"
     
  10. Olxinos

    Olxinos Scruffy Nerf-Herder

    That's not all, you also have an unmatched opened (curly) bracket, and there's a missing comma after "/universe_server/speciesShips".
    Replacing that comma (the one Motionless pointed out) by a "}" and adding a comma after the path property will solve the error and make the patch correct.
    However, this patch will make unusable all the other races (if it doesn't crash the game at startup). What you want is probably this:
    Code:
    [
      {
        "op": "replace",
        "path": "/universe_server/speciesShips/human",
        "value":
        [
          "/ships/human/usspolarisT0.structure",
          "/ships/human/usspolarisT1.structure",
          "/ships/human/usspolarisT2.structure",
          "/ships/human/usspolarisT3.structure",
          "/ships/human/usspolarisT4.structure",
          "/ships/human/usspolarisT5.structure",
          "/ships/human/usspolarisT6.structure",
          "/ships/human/usspolarisT6.structure",
          "/ships/human/usspolarisT7.structure",
          "/ships/human/usspolarisT8.structure"
        ]
      }
    ]
    This patch only replace the "human" object inside speciesShips whereas yours replaced the whole speciesShips object with another which contained only the human object.

    Also, I have seen poorly indented files several times on this section, not that they won't work, but indenting files helps you correcting your mistakes; you should really indent your files (there are multiple styles choose your favourite, but be consistent, that's the only thing that matters when indenting).
    You can perfectly make an incredible mod with non-indented files, but I insist, that will help you (especially when dealing with big files). You'll spot the unmatched brackets and other small syntax errors more easily, and it will also help anyone who is reading your mod.
     
  11. Velornar

    Velornar Pangalactic Porcupine

    Ah...ok...I see know how work the path scheme I must indicate. This shouldnt be a problem anymore.
    Thank you everyone...
    The file work as intended, thats is to say, on the crash log, universe_server.config inst mentionned as containing an error, what a cruel syntax ^^
    I didnt knew it was possible to write the values in a "indented position" like this without breaking the file. In fact, I always copy the scheme very preciselly because I have no way to know, as coding usually mean to be extremly precise in the syntax (a blank there, or a simple comma misplaced and everything become incomprehensible for the software). Without these link, I could have tried to launch/crash Starbound, examinate countless crashlog to find the precise structure for a single file.
    I'll try to apply these advices to at least finish this ship mod, but i'll probably dont make many more things, Its been a year I work on simply the design of the ship, from existing art, but I will probably never be able to release it for everyone because of copyright ( In fact, seems that I have used some art from file without author consent, despite of their original belonging to starbound). That almsot not my work, I have just been trying to make a ship from the different art existing. Istill have got to fix the lombax race, apparently abandonned by it author (add dialogs, guns, crafting table, different object related to the lore...) I'll certainly never have the time to practice much more.

    I have got just a question (maybe the last one, hoping I will be able to finally load the ship in the game and fix collision myself); its about the blockKey.config file.
    Firstly I thought it was simply possible to overwrite it and replace the vanilla one. This is of course hardly lost with this patch system.
    So I must add the object that I need to make it work (custom thrusters, doors etc...), but to define the object, i have got a problem to make everything work with te patch.
    There is not actually one value, like in the tutorial, each object need to be precisely defined: color value, comment, background mat, foreground or background block...
    Should I separate every object ? or is there a way to put everything under a "single banner"....
    Here is the exemple.

    Code:
    [
    {
    "op": "add",
    "path" : "/blockKey"
      ,"value" : "
        {
          "value": [222, 222, 22, 255]
          "comment": "apexshipdetails  fluorescentlight",
          "foregroundBlock": false,
          "backgroundBlock": false,
          "backgroundMat": "apexshipdetails",
          "object": "fluorescentlight",
        },
       
        {
          "value": [255, 255, 0, 255],
          "comment": "apexshipdetails  apexshiplight",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipdetails",
          "object": "apexshiplight",
        },
       
        {
          "value" : [167, 167, 250, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "boosterflamedread",
          "objectParameters" : {
            "unbreakable" : false
          }
        },
       
        {
          "value": [156, 81, 255, 255]
          "comment": "humanwarpdrive",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "humanwarpdrive",
          "objectParameters": {
            "unbreakable": false
          },
        },
       
        {
          "value": [171, 117, 171, 255]
          "comment": "bigboosterflame",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "object": "bigboosterflame1",
          "objectParameters": {
            "unbreakable": true
          }
        },
       
        {
          "value": [255, 122, 0, 255],
          "comment": "apexslidingdoor2",
          "foregroundBlock": false,
          "backgroundBlock": false,
          "object": "apexslidingdoor2",
        },
       
        {
          "value": [175, 175, 75, 255],
          "comment": "wreckplatform",
          "foregroundBlock": true,
          "backgroundBlock": false,
          "foregroundMat": "wreckplatform",
        },
           
        {
          "value": [257, 87, 82, 255],
          "comment": "apexshipwall  analysisscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "analysisscreen",
          "objectParameters": {
            "unbreakable": false
          }
        },
       
        {
          "value": [255, 87, 83, 255],
          "comment": "apexshipwall  barscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "barscreen",
          "objectParameters": {
            "unbreakable": false
          }
        },
       
        {
          "value": [255, 87, 84, 255],
          "comment": "apexshipwall  mapscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "mapscreen",
          "objectParameters": {
            "unbreakable": false
          }
        },
       
        {
          "value": [255, 87, 85, 255],
          "comment": "apexshipwall  textscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "textscreen",
          "objectParameters": {
            "unbreakable": false
          }
        },
        "
      ]
    }
    


    Still got endless mistake with the JSON patch verificator, the more I fix errors detected, the more I get ones. At some point that the file at a moment almost didnt look like anymore to the original one.
     
  12. The | Suit

    The | Suit Agent S. Forum Moderator

    The best practice is to always run your code through Json patcher or json lint.
    Both provided in the guide - that way you decreases the chances of crashing from simple syntax errors by 95%
     
  13. Velornar

    Velornar Pangalactic Porcupine

    Ok...I have practiced a bit, and this was the result of a blockKey.config.patch corrected with th JSON verificator. Trusting this software, their is no more mistake.
    But do you see how messy is the file ? None of the corrections done seemed to have any sense. Like there were no order instead of my first version "audited as wrong".
    Sometime I feel like some programms are going mad :p
    I will need a miracle to make it recognized and used correctly by the game.

    Code:
    [
    {
    "op": "add",
    "path" : "/blockKey"
      ,"value" :
          {
        "value" : "222, 222, 22, 255" ,
          "comment": "apexshipdetails  fluorescentlight",
          "foregroundBlock": false
          ,"backgroundBlock": false
          ,"backgroundMat": "apexshipdetails"
          ,"object": "fluorescentlight" },
        
        "value": "255, 255, 0, 255",
          "comment": "apexshipdetails  apexshiplight",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipdetails",
          "object": "apexshiplight" },
      
        {
          "value" : [167, 167, 250, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "boosterflamedread",
          "objectParameters" : {
            "unbreakable" : false
          }
        },
      
          "value" , "156, 81, 255, 255"
          ,"comment" , "humanwarpdrive",
          "foregroundBlock" ,  false,
          "backgroundBlock" , true,
          "backgroundMat" , "apexshipwall",
          "object" , "humanwarpdrive",
          "objectParameters" , {
            "unbreakable": false
          },
      
        {
          "value": [171, 117, 171, 255]
          ,"comment": "bigboosterflame",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "object": "bigboosterflame1",
          "objectParameters": {
            "unbreakable": true
          }
        },
      
        {
          "value": [255, 122, 0, 255],
          "comment": "apexslidingdoor2",
          "foregroundBlock": false,
          "backgroundBlock": false,
          "object": "apexslidingdoor2",
      
          "value": [175, 175, 75, 255],
          "comment": "wreckplatform",
          "foregroundBlock": true,
          "backgroundBlock": false,
          "foregroundMat": "wreckplatform",
          
          "value": [257, 87, 82, 255],
          "comment": "apexshipwall  analysisscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "analysisscreen",
          "objectParameters": {
            "unbreakable": false
          }
        },
      
        {
          "value": [255, 87, 83, 255],
          "comment": "apexshipwall  barscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "barscreen",
          "objectParameters": {
            "unbreakable": false
          }
        },
    
            {
          "value" : "255, 87, 85, 255",
          "comment": "apexshipwall  textscreen",
          "foregroundBlock": false,
          "backgroundBlock": true,
          "backgroundMat": "apexshipwall",
          "object": "textscreen",
          "objectParameters" :
            "unbreakable" , "false"
      
      
        :"value" , "255, 87, 84, 255":
          "comment" , "apexshipwall  mapscreen"
          :"foregroundBlock" , "false"
          :"backgroundBlock" , "true"
          :"backgroundMat" , "apexshipwall"
          :"object" , "mapscreen"
          :"objectParameters" ,
            "unbreakable": false
          }
        ]
    
     
  14. The | Suit

    The | Suit Agent S. Forum Moderator


    If you are trying to overwrite an already existing file using add.
    I suggest you read the Giant Red and Yellow text on the bottom of the tutorial.
     
  15. Velornar

    Velornar Pangalactic Porcupine

    But I'm not overwriting values, I'm adding ones, right ? I'm not replacing any existing value of the original blockKey.file via patching, I'm adding values.
    How coul I proceed otherwise rather than patching with "add" fonctionality ?
    All I do is adding different objects to be used in the different tiers of my ship, each of one supposed to be recognized by on shipblock.png there shouldnt be any issue with Upbeat Giraffe-Update 2 ?
    I clearly dont understand where is the problem with a patch.
    Is there still any way to make a simple ship tiering without getting alls the sticks in the wheel possible by the game, the coding syntax and patch file ?
     
  16. The | Suit

    The | Suit Agent S. Forum Moderator

    If its a completely different ship - it would have its own block key.
    What exactly are you trying to do? Because from your earlier post you are creating 8 tiers of a new ship.
    In that case this file would not require patching you can simply write it in without patching at all.

    Patching is only required when editing a vanillia file.
     
  17. Velornar

    Velornar Pangalactic Porcupine

    I have already been trying to make a completely different blockKey...but I had many problem. I have never been able to launch it, I corrected many time the syntax but nothing happens. The game was always crashing because of my own blockKey file.
    So I came to realize that blockKey must be a vanilla file and I maybe had to patch it with the new values, non-existing in the file, thats why I came on this thread, because I'm a total noob in coding, even ones thats would seems basic for people having studied even a bit informatic technologies.
    Yes, the ship is almost completly different from vanialla, its a beta version, I have got actually a single hull design (divided in tow part due to his lengh) for every 9 .structure file tiers. But I will add probably a wrecked one (for the tutorial quest) and lock different rooms, getting disponible at each tier. At the release of the first version of Starbound beta, I have just modified an existing mod, the gilgamesh cruiser, already very good, but not enough for me. I just would like to make a massive frigate for mod requiring a lot of space, but still keeping it in the lore of human (USCM etc...) story...
    And after month and month of casual work on it, I completely modified the orginal design, size etc...
    In fact, I just would add a ship but not by leaving completely the tutorial quest, tiering update and all missions tieds to it, wich make one of the most important part of the game's content.
    I wouldnt skip that content or play with the default vanilla ship because I hate to construc fixed base on planets block by block (since there is also only one button home, and no way in game to save multiple coordinates)...all design seems only beautifull seen by far. And due to the technic limitations of my computer, I'm forced to play with an minimal view radius, wich make me see block too close, and every construction rather ugly. Thats why I would work on png files rather than block by block ship constuction file.
    Its been a year I'm trying to make this mod work, and every time, I cant even launch it because there is ALWAYS a mistake somewhere wich make the game crash, alway because of syntax problem...I'm really tired of this, I dont master modding enough to make me expecting me to finsih the mod one day. Sorry if sometime, this shipmod I cant fnish get me a bit nervous and I'm saturating the forum with "help required threads/messages". because I cant fix problems myself
    By the way: I share here the mod in its actual state, then you will probably understand what its about:
     
  18. The | Suit

    The | Suit Agent S. Forum Moderator

    If is a new ship - you don't patch. You just write in the blockkey manually as if a completely new file
    Use Json lint to find syntax errors
    http://jsonlint.com/


    Don't try and add in so many items in at once.
    Add in one item in at a time, check if it works add more and check again.
    Biggest mistake early modders make is thinking what they do is infallible. Once you know what you are doing you can add in large swathes of code.
     
  19. Velornar

    Velornar Pangalactic Porcupine

    The files of the mod have been corrected with the link, really usefull (hanks ^^)...the files are "valid JSON"...all of them.
    And then I have got this when lauching the game (with no oter mods, only vanilla asset, packed of course):

    Code:
    [14:58:49.504] Error: Exception caught loading asset: /universe_server.config, (AssetException) Could not read variant asset /universe_server.config
      StarException::StarException(string, exception)
      AssetException::AssetException(string, exception)
      _Function_handler<shared_ptr<Assets::AssetData> (), Assets::loadVariant(String)::{lambda()#1}>::(_Any_data)
    ...This game is just playing with my nerves. Nothing...absolutly nothing is supposed to be wrong, there is no logical reason. I have checked, compared all the file to the original one, the structures are strictly identical...
    That means that the previous patch for universe_server.config dont work anymore. I have been able able to launch it once, the patch have been loaded, executed, and the crash came after a fraction of seconds in game, while loading the design.
    I have no idear, no qualifications and absolutly no way to find what is going wrong, despite of all tutorial. the file are good...but the game is like refusing to understand and load its...
    Then my only option is to wait for someone who will sucessfully be able to make a mods of tiered ship.
    Thanks you for all your advices, you very fast answers, your brillant tutorial, but the problem seems to be elsewhere apparently.
     
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    As I said - do it 1 at a time.
    Only replace the first human ship. Use the same naming convention as humans so you don't need to patch universe.
    Once the ship is done - worry about changing names and patching
     

Share This Page