Modding Help Printable freedom

Discussion in 'Starbound Modding' started by MelOzone, Mar 26, 2017.

  1. MelOzone

    MelOzone Pangalactic Porcupine

    Yep, that's the whole title. I'm lazy as a brick.
    Probably everyone stumbled upon a situation when you find a nice decoration, scan it thinking "Oh, it's cool, gonna print it later" only to find out you can't because of a one small line in the object's file. Well, perhaps, not "everyone", but some people do.
    I feel like I'm reinventing the wheel, but...

    > Printable mod

    Why is it posted under "help"?
    There are currently more than a thousand non-printable items, and that's only what the wiki knows about. Not all of these items should be printable - some are craftable, some are limited to missions, some are outdated and exist only in the game files but not in the game itself. There are also some items that probably should not be printable, but that's up to discussion (like land mines, saw blades or bushes). Still, it's quite a pile to sift through alone.
    But then again, why should someone do it alone?

    Please tell me what you think. And if by chance someone already did that (a quick search brought me nothing), better learn about it early on. I guess.
     
    xaliber likes this.
  2. Cyel

    Cyel Scruffy Nerf-Herder

    I've made something quite similar for another project; but it's not finished. Not sure if you want, but here's my list of unprintable ones; I might be missing some tho.
    I've used a few bash scripts to make use of it; if you don't know how you could automate it (if you want to, but doing all that manually will probably take ages IMO), I could look back at how I did it

    (most of the objects in /biome/ are smashable stuff, things in /farmables/ shouldn't be printable, etc

    Also, mods these days don't need the pak.modinfo file, only the _metadata one
     

    Attached Files:

    xaliber and MelOzone like this.
  3. MelOzone

    MelOzone Pangalactic Porcupine

    Thanks for the info. I - personally - don't think it will take ages, especially if done collectively. As for automatization... it's tempting but I have my doubts. Some people would probably want to make things that are not printable now (like bushes or smashables - some are already printable even now, like hylotl liquor bottles). Ideally I see the resulting mod as the most suited for the majority of players, with several additional download "modules" to modify the package for the rest. Every item more or less needs human judgement, so I doubt automatization is a good solution (but if you happen to still have the script, feel free to post it here).

    Speaking of which. If anyone cares to join it's quite easy:

    1. Find the thing that's not printable (by using the wiki or Cyel's file - thanks Cyel!)
    2. Preferred: check if it's still not printable in the game (or through game files if you know how to do it)
    3. Create a copy of the mod's repository from Github with any Git client (for example, Tortoise Git)
    4. Create a folder at the exact path for this item, copy an *.object.patch file here (take the one I did for Red Light) and rename it to match the item in question
    5. Commit (save) changes in Git and Push (upload) the result to Github.
    6. ...
    7. Profit!

    If there will be any volunteers, we'll need a list of what's already done. Aaand that's probably it.
     
    Cyel likes this.
  4. Cyel

    Cyel Scruffy Nerf-Herder

    Here's one I've hacked together
    Code:
    #!/usr/bin/env bash
    #takes a file as argument, expect one file path per line, create path, write $text in file, append $ext
    listfile="$1"
    text='[ { "op" : "replace", "path" : "/printable", "value" : true} ]'
    ext=".patch"
    
    while read -r line
    do
      echo $line
      mkdir -p "$(dirname "$line")" && echo -n $text > "$line$ext"
    done < "$listfile"
    Windows messed up my list file above by appending ^M at the end of each lines; using this script on something else with that list would result in invalid file names. I've used dos2unix to fix it, and also changed all antislashes \ to slashes /.

    Note also that i've got that list out of assets unpacked a while ago (read: 1~2 months). If you want to diff it with your own, here's what I used to get it:
    Code:
    cd <assetpath/objects/>; grep -Elr '^( )*"printable"( )*:( )*false'
    replace <assetpath> with your path to the unpacked assets; /objects/ isn't required but omitting it would result in grep parsing the whole assets file, which is unnecessary
    -E: extended regexp
    -l: only show filenames, remove it to see matches
    -r: recursive
    (Note that grep might not handle whitespaces)

    Obviously I've also used the script on my list, so here's a folder of patches for (supposedly, pre-1.3) all (literally all, even farmable plants, don't use as-is probably) unprintable objects. 7zip offered a better compression ratio than zip

    Regarding what should be printable and what shouldn't, I think it'd be easier to remove them from a list rather than manually find & add them, but I agree with your take on it too. Having multiple "modules" would probably help everyone to get what they want out of it
    There are some other problems too, for example, "primers" (things that make ground-level cloud-like things in eg. swamps or mountains) are casually hidden as other assets (eg. a root, a rock) and offer no cues toward their true nature
     

    Attached Files:

    Last edited: Mar 28, 2017
    MelOzone likes this.

Share This Page