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

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

  1. Tuesday's Eyebrow

    Tuesday's Eyebrow Phantasmal Quasar

    is there a way to patch all biomes at once, or do I just need to make individual .patch files for each biome?
     
  2. ColonolNutty

    ColonolNutty Ketchup Robot

    I made note of how to use test in a different form than what is listed in the OP. Looking through the comments it looks like people know of it, but for now I added it to the wiki here: http://starbounder.org/Modding:Advanced_Modding
     
    bk3k, xaliber and cpeosphoros like this.
  3. cpeosphoros

    cpeosphoros Orbital Explorer

    @ColonolNutty Very nice. It was on my backlog making a tutorial about the test+add thing. Thank you.
     
  4. ColonolNutty

    ColonolNutty Ketchup Robot

    Eh, it woulda been done eventually, just hadn't seen it yet, so I figured I would help out. Make any corrections you'd like, I don't mind
     
  5. cpeosphoros

    cpeosphoros Orbital Explorer

    One by one, but you can make an script to automatize their creation.
     
  6. cin979

    cin979 Void-Bound Voyager

    Is there any initialization that I have to do to get my patch working. Because I've manually patched the original code from mod I'm trying to patch with my .patch file and it works fine, however when I try to get it running with just the patch file it does nothing
     
  7. ColonolNutty

    ColonolNutty Ketchup Robot

    Have you checked the Starbound/storage/starbound.log file?
     
  8. davoker

    davoker Scruffy Nerf-Herder

    One doubt, I'm with a translation, I'm directly translating the original files, which I then package in a .pak file, or just in a folder (to do in-game tests).

    If I use this .patch method, and update the game, and this update "adds" new content to several files that I have modified, how do I update "that new content" to my file? I do not know if I explain myself xD

    Let's suppose that the file:

    Interface \ cockpit \ cockpit.config

    I have translated it, but in an update this file "has new texts", is there a quick or easy way to update my file with the new additions? Any way to compare them to know what's new?

    Another doubt: Is there any way to automate this method? for example, putting all my files modified with some GUI and processing them and creating the files already converted into .patch files, I do not know if I explain myself, it's not my mother tongue hehe
     
  9. ColonolNutty

    ColonolNutty Ketchup Robot

    The property names should still be the same, otherwise Starbound won't be able to read the file. So you'd just update it the same way you would with the original file.
     
    lazarus78 likes this.
  10. davoker

    davoker Scruffy Nerf-Herder

    Question short version:

    How can I know what files have been modified or added once the game is updated?

    And how is my file updated if the original has been updated? If I have modified texts in a version 1.3.3 file of the game, and this is updated to 1.4, and makes changes in that same file, I have to know what changes I have suffered to put them in my file, as I'm supposed to do that?

    Question long version:

    That is precisely the part that I do not understand, how I update my file to the new changes that the game has when updated.

    If I have a modified file that says this:

    AAAAA (modified)
    BBBBB (modified)
    CCCC (modified)

    And the game is updated and "adds" changes in that same file, thus remaining:

    AAAA (unmodified, original)
    BBBB (unmodified, original)
    CCCC (unmodified, original)
    DDDD (unmodified, original)

    My question is, what is the way to update my file to be the same as the updated ?, I would have to add the new change to my file, which would be the line "DDDD" in this case, I have to look at "ALL" files of the game that I modified to know if there is something new when the game is updated? We are talking a translation, that can take weeks.

    Right now the game is in version 1.3.3, if they update to 1.4 the files change, there will be new files, and other files that were already could have new things, if my translation is based on the current 1.3.3 and updated the game to 1.4, some files could have new changes, there are many files to look at 1 to 1 which of them has suffered some change, no?

    I do not know if I explain myself well, is there any easier way to do this?

    ______________________________

    Another question, in the file already in .patch format we can see something like this:

    "op": "replace",
    "path": "/ gui / windowtitle / title",
    "value": "AAAA"

    "op": "replace",
    "path": "/ gui / windowtitle / title",
    "value": "BBBB"

    "op": "replace",
    "path": "/ gui / windowtitle / title",
    "value": "CCCC"

    Is there a specific order or order can be altered? that is, instead of looking like above, it looks like this:

    "op": "replace",
    "path": "/ gui / windowtitle / title",
    "value": "BBBB"

    "op": "replace",
    "path": "/ gui / windowtitle / title",
    "value": "CCCC"

    "op": "replace",
    "path": "/ gui / windowtitle / title",
    "value": "AAAA"

    Does order affect or in this case it does not matter because it modifies specific lines?
     
    Last edited: Jan 11, 2018
  11. ColonolNutty

    ColonolNutty Ketchup Robot

    I am still unsure of what you're are talking of
    If I have a file that looks like the below

    Code:
    {
      "AAAAA" : "One"
    }
    The game should still read it like this even if the property were updated to:
    Code:
    {
      "AAAAA" : "Three"
    }
    Unless you are referring to the property name changing, such as
    Code:
    {
      "AAAA" : "One"
    }
    Then you'd patch it like this instead:
    Code:
    {
      "op" : "replace",
      "path" : "/AAAA",
      "value" : "blah"
    }
    Then you'd just refer to the new property.

    For your second question:

    It is read from top down, so the bottom one will replace anything above it that changes the same properties.
    In your first example, the resulting value will be CCCC
    In your second example, the resulting value will be AAAA
     
    Last edited: Jan 11, 2018
  12. davoker

    davoker Scruffy Nerf-Herder

    But if you see this in a file:

    {
    "op": "replace",
    "route": "/ AAAA",
    "value": "blah"
    }

    And when you update the game you see this "in that same file":

    {
    "op": "replace",
    "route": "/ AAAA",
    "value": "blah"
    }

    {
    "op": "replace",
    "route": "/ BBBB",
    "value": "blah"
    }

    BBBB is a new addition in the same file when updated, before the file only had AAAA, now it has AAAA and BBBB, if I have translated from the AAAA file, since AAAA will be translated, but BBBB "is new", the file now has new text

    That's what I mean, if in an existing file of version 1.3.3, when updated to 1.4 that same file "has new texts", I have to modify my file to put that new text, to implement BBBB.

    If this case happens with more files, I have to know a way to locate the files that have been modified, and find a way to update my files without having to copy everything translated from my files to the new ones.

    Maybe I'm not understanding it well xD

    I also can not patch everything, there are files that I do not take the online patch that, for example, I'm not able to patch it:

    {
    "id": "avianhistory1",
    "species": "avian",
    "title": "Avoscript: Verse 1: 1: 1",
    "description": "An excerpt from the Avian holy book.",
    "icon": "aviancover5.png",
    "contentPages": [
    "Avos was eleven tethered beyond the stars - This much is known.

    There was no beginning, for the Avian kindly lived eternally beyond the mortal realm.

    In the Aether they dwelt within the embrace of Kluex, the winged one above all.

    Kluex gifted them with true wings, and they worshiped in kind. "
    ],
    "itemConfig": {
    "rarity": "common",
    "price": 25
    }
    }

    I receive this error:

    Invalid JSON: Unexpected token \ n in JSON at position 264

    And I do not know why, other files if I can but that for example and all those in the "codex" folder give that error, it only changes the position but it is the same error.

    I walk a little lost xD
     
    Last edited: Jan 11, 2018
  13. lazarus78

    lazarus78 The Waste of Time

    Well if your mod still works, then there is no need to worry. If something doesn't work, then you can assume it changed.

    But outside of that, this site is a great help in this regard: http://helmet.kafuka.org/sbmods/diffs/

    Just open the new updated version of the file and compare. See what has changed in it, then update your patch accordingly.


    Order can sometimes be an issue, but usually not. In your example, it does matter because it is one patch altering the same thing, so in the first example, the end result will be the title being "CCCC", and in the latter example, it will be "AAAA". If you are altering different things, then order does not matter, unless you do something like remove a chuink of code, then try to modify something that was within that chunk of code, then it would fail, but this is rarely an issue you will encounter.
     
  14. davoker

    davoker Scruffy Nerf-Herder

    Oops, the example I put was bad, this example would be more correct to my question:

    [
    {
    "op": "replace",
    "path": "/ speciesText / default / buttonText",
    "value": "AAAA"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / repeatButtonText",
    "value": "BBBB"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / selectSpeech / text",
    "value": "CCCC"
    }
    ]

    If we see that in a file, version of the game 1.3.3, and then it is updated to 1.4 and "that same file adds new text", like this:

    [
    {
    "op": "replace",
    "path": "/ speciesText / default / buttonText",
    "value": "AAAA"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / repeatButtonText",
    "value": "BBBB"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / selectSpeech / text",
    "value": "CCCC"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / example / text",
    "value": "DDDD"
    }
    ]

    That's where I need to know what files have added new text in case it was added, so I can copy that new text to my patched file.

    In this case, the order would be the same because it modifies different things, does not it?

    This page you have given me: http://helmet.kafuka.org/sbmods/diffs/

    Tells you what files have changed when the game is updated? Do you see all the changes? because that would be just what I need.
     
  15. lazarus78

    lazarus78 The Waste of Time

    Yeah, just compare the new with the old and update accordingly. Not much of an issue.
     
  16. davoker

    davoker Scruffy Nerf-Herder

    Ok thank you, in the example that psue above, more correct, the order if it would not like it? Modify different texts so the order should not matter, right?

    For example, see this:

    [
    {
    "op": "replace",
    "path": "/ speciesText / default / buttonText",
    "value": "AAAA"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / repeatButtonText",
    "value": "BBBB"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / selectSpeech / text",
    "value": "CCCC"
    }
    ]

    And change the order like this:

    [
    {
    "op": "replace",
    "path": "/ speciesText / default / buttonText",
    "value": "CCCC"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / repeatButtonText",
    "value": "AAAA"
    },
    {
    "op": "replace",
    "path": "/ speciesText / default / selectSpeech / text",
    "value": "BBBB"
    }
    ]

    It would be the same, would not it? when modifying texts with different properties, the result would be the same, right? even that the order has changed.
     
  17. lazarus78

    lazarus78 The Waste of Time

    Yes, the results would be the same in that case.

    This site is helpful for making patches: http://chbrown.github.io/rfc6902/

    Just copy the original JSON into the yellow box, then copy what you want it to look like on the green box, then it will automatically generate the necessary patch below.
     
  18. davoker

    davoker Scruffy Nerf-Herder

    Yes, that's what I'm using, also this:

    http://trinithis.awardspace.com/commentStripper/stripper.html

    To remove the comments and leave the files clean, some files give an error if they are not cleaned first.

    It would be ideal to have an application with GUI where you choose the original file and on the other side the modified file, give a button and create the file with the name and already patched hehe
     
    Last edited: Jan 11, 2018
  19. davoker

    davoker Scruffy Nerf-Herder

    Is there any way to use this online application in bulk? process many files at once? When you have to make use of this application with hundreds of files it becomes very heavy, would it be possible?
     
  20. sayter

    sayter The Waste of Time

    not really, no. its more practical to do it one at a time.
     

Share This Page