Tutorial How to successfully pack and unpack .pak files

Discussion in 'Starbound Modding' started by SexualRhinoceros, Jan 26, 2014.

  1. The | Suit

    The | Suit Agent S. Forum Moderator

    The version of unpacker you have - and the version of the packer used to pack that file are different.
    You did nothing wrong - it is simply just a version mismatch.

    You have to use the correct unpacker version - and there really is no way to know what that version is.
     
  2. JUstin17

    JUstin17 Void-Bound Voyager

    where can i get different unpacker versions?
    p.s: ohh, so that's why i keep getting an error
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    As far as I know there is no repository for different versions.
    You will just have to contact the author and see if he has an unpacked version.
     
  4. JUstin17

    JUstin17 Void-Bound Voyager

    ok then....
     
  5. NanoPi

    NanoPi Scruffy Nerf-Herder

    got a sucessful unpack with yesterday's nightly version (didn't finish downloading the current patch yet)
     

    Attached Files:

    Last edited: Nov 27, 2014
  6. JUstin17

    JUstin17 Void-Bound Voyager

    Thank you!
     
  7. domu452

    domu452 Big Damn Hero

    I'm running the unstable on OSX 10.9.5 and trying to unpack using steps 1 to 7 above. I've also used the following code:

    /Users/wilsonr/Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/asset_unpacker /Users/wilsonr/Library/Application\ Support/Steam/SteamApps/common/Starbound/assets/packed.pak /Users/wilsonr/Library/Application\ Support/Steam/SteamApps/common/Starbound/assets/unpacked//Users/wilsonr/Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/asset_unpacker /Users/wilsonr/Library/Application\ Support/Steam/SteamApps/common/Starbound/assets/packed.pak /Users/wilsonr/Library/Application\ Support/Steam/SteamApps/common/Starbound/assets/packed/

    I've been getting the following error:

    dyld: Library not loaded: @executable_path/../Frameworks/Vorbis.framework/Vorbis

    Referenced from: /Users/wilsonr/Library/Application Support/Steam/SteamApps/common/Starbound/osx/asset_unpacker

    Reason: image not found

    Trace/BPT trap: 5
    any suggestions?
     
  8. green3y3

    green3y3 Pangalactic Porcupine

    Exactly the same for me, using the same method, also a WIP script for mac os, but nothing works. it's frustrating because i want to take a look on how new coding works now .. seems to be a BUG in the Mac OS version :down:
     
  9. Olxinos

    Olxinos Scruffy Nerf-Herder

    The problem is that the executable has been moved from ./Starbound.app/Contents/MacOS/ to ./ but needs the Vorbis.framework located in ./Starbound.app/Contents/Frameworks/ and think it is located in ../Frameworks/ (which means, the parent folder, then the Frameworks folder).

    You can simply move the asset packer/unpacker executable inside Starbound.app/Contents/MacOS and use it from there (and make a symbolic link if you want)
    You can also use install_name_tool to replace the dependency.

    [EDIT:
    if you get: "-bash: install_name_tool: command not found" when using solution 2 or 3 then you probably don't have the developer tools installed, and you can only use solution 1
    to know if you can use install_name_tool, type "install_name_tool -h" in a terminal, if you get an error you can't, if you get:
    Code:
    Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input
    or something like that, then you can
    ]

    simple to do and understand:

    open a Terminal (/Application/Utilities/Terminall.app) then type these commands:
    Code:
    cd Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/
    mv asset_packer Starbound.app/Contents/MacOS/
    ln -s Starbound.app/Contents/MacOS/asset_packer asset_packer
    mv asset_unpacker Starbound.app/Contents/MacOS/
    ln -s Starbound.app/Contents/MacOS/asset_unpacker asset_unpacker
    the first one changes the working directory
    the second one moves asset_packer
    the third one creates a symbolic link for asset_packer (an "alias", it's different than the "make an alias" option though; it's optional you can also execute the packer from the MacOS directory)
    the fourth and the third are similar to the second and third (but with asset_unpacker)

    You can now (normally) execute the packer/unpacker from Starbound/Contents/MacOS or ./ (if you made a symbolic links, otherwise, they are just not there)


    avoid that one, it's incomplete (also needs the developer tools):

    Edit: that solution doesn't work well because the vorbis framework also depends on the ogg framework so you'd have to change the dependency of the framework but it would then break the game

    (i recommend you to back up the files before doing it, if you were to mistype something it would make the file totally unusable unless you use the good install_name_tool command)
    open a Terminal (/Application/Utilities/Terminall.app) then type these commands:
    Code:
    cd Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/
    install_name_tool -change @executable_path/../Frameworks/Vorbis.framework/Vorbis @executable_path/Starbound.app/Contents/Frameworks/Vorbis.framework/Vorbis asset_packer
    install_name_tool -change @executable_path/../Frameworks/Ogg.framework/Ogg @executable_path/Starbound.app/Contents/Frameworks/Ogg.framework/Ogg asset_packer
    install_name_tool -change @executable_path/../Frameworks/FreeType.framework/FreeType @executable_path/Starbound.app/Contents/Frameworks/FreeType.framework/FreeType asset_packer
    install_name_tool -change @executable_path/../Frameworks/libpng.framework/Versions/1.5.4/libpng @executable_path/Starbound.app/Contents/Frameworks/libpng.framework/Versions/1.5.4/libpng asset_packer
    install_name_tool -change @executable_path/../Frameworks/Vorbis.framework/Vorbis @executable_path/Starbound.app/Contents/Frameworks/Vorbis.framework/Vorbis asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/Ogg.framework/Ogg @executable_path/Starbound.app/Contents/Frameworks/Ogg.framework/Ogg asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/FreeType.framework/FreeType @executable_path/Starbound.app/Contents/Frameworks/FreeType.framework/FreeType asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/libpng.framework/Versions/1.5.4/libpng @executable_path/Starbound.app/Contents/Frameworks/libpng.framework/Versions/1.5.4/libpng asset_unpacker
    
    You can now (normally) execute the packer/unpacker from ./ (the same location, the files didn't move)
    Edit: no you can't, you'd get that:
    Code:
    dyld: Library not loaded: @executable_path/../Frameworks/Ogg.framework/Versions/A/Ogg
      Referenced from: /Users/[you]/Library/Application Support/Steam/SteamApps/common/Starbound/osx/Starbound.app/Contents/Frameworks/Vorbis.framework/Vorbis
      Reason: image not found
    Trace/BPT trap: 5
    
    you could correct it with an install_name_tool, but it would break the game until you do another install_name_tool to reverse the change


    that one doesn't touch your starbound installation: it copies the packer and dependencies elsewhere, but requires you to have developer tools installed:

    You can also copy the asset_packer/unpacker to another location (say ~/starboundPackers) then copy the Frameworks folder there (or make a link) and use the solution 2 (replace "Starbound.app/Contents/Frameworks/" with "Frameworks/" for each line) on these files if you want to have a clean starbound folder:
    open a Terminal (/Application/Utilities/Terminall.app) then type these commands:
    Code:
    mkdir starboundPackers
    cp Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/asset_packer starboundPackers/asset_packer
    cp Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/asset_unpacker starboundPackers/asset_unpacker
    cd starboundPackers
    cp -r ../Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/Starbound.app/Contents/Frameworks Frameworks
    install_name_tool -change @executable_path/../Frameworks/Vorbis.framework/Vorbis @executable_path/Frameworks/Vorbis.framework/Vorbis asset_packer
    install_name_tool -change @executable_path/../Frameworks/Ogg.framework/Ogg @executable_path/Frameworks/Ogg.framework/Ogg asset_packer
    install_name_tool -change @executable_path/../Frameworks/FreeType.framework/FreeType @executable_path/Frameworks/FreeType.framework/FreeType asset_packer
    install_name_tool -change @executable_path/../Frameworks/libpng.framework/Versions/1.5.4/libpng @executable_path/Frameworks/libpng.framework/Versions/1.5.4/libpng asset_packer
    install_name_tool -change @executable_path/../Frameworks/Vorbis.framework/Vorbis @executable_path/Frameworks/Vorbis.framework/Vorbis asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/Ogg.framework/Ogg @executable_path/Frameworks/Ogg.framework/Ogg asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/FreeType.framework/FreeType @executable_path/Frameworks/FreeType.framework/FreeType asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/libpng.framework/Versions/1.5.4/libpng @executable_path/Frameworks/libpng.framework/Versions/1.5.4/libpng asset_unpacker
    install_name_tool -change @executable_path/../Frameworks/Ogg.framework/Versions/A/Ogg @executable_path/Frameworks/Ogg.framework/Versions/A/Ogg Frameworks/Vorbis.framework/Vorbis
    
    (Edit: the first cd has been removed, it was a remain of a copy/paste from solution 2 but wasn't supposed to be there
    the last install_name_tool is necessary because of the Vorbis framework dependency, so you should copy the Frameworks folder (and not just make a link) otherwise you would break the game)
    You can now (normally) execute the packer/unpacker from ~/starboundPackers (~ means "your home directory")
    if you messed up something simply use "rm -rf ~/starboundPackers" in a terminal, it will delete the new files but not your Starbound installation.


    Edit: the Vorbis framework depends on the OGG framework, this affects the second and third solution, the latter can be corrected, but not the former (unless you break the game in the process, so don't use it)
     
    Last edited: Dec 28, 2014
    domu452 and The | Suit like this.
  10. green3y3

    green3y3 Pangalactic Porcupine

    problem is, there are only 2 folders in the starbound.app/contents folder: /MacOS and /Resources. there is no /Frameworks, and simply moving the asset_packer and asset_unpacker to ..starbound.app/contents/MacOS gives you the same error message:
     
  11. Olxinos

    Olxinos Scruffy Nerf-Herder

    Be careful, there are two Starbound.app (i don't get why but... well... i can deal with it) one in
    Code:
    ~/Library/Application\ Support/Steam/steamapps/common/Starbound/
    and one in
    Code:
    ~/Library/Application\ Support/Steam/steamapps/common/Starbound/osx/
    according to your error message, you moved them in the first one, i was talking of the second one

    Edit: btw, i don't get why the asset packer/unpacker need ogg vorbis freetype and libpng neither (maybe a mistake? i can deal with it too though)

    Edit2: glad it helped!
     
    Last edited: Dec 28, 2014
    green3y3 likes this.
  12. green3y3

    green3y3 Pangalactic Porcupine

    i was in deed not careful, thanks for the suggestion, it works! :up:
     
  13. gelini89

    gelini89 Void-Bound Voyager

    are the unpacker/packer works, if the steam folder linked to D: C\user\myname ???
    because commandprompt shows always C:\users\myname. and if i click enter with the hole D:D\Program files\steam\....etc\packed.pak, commandprompt says D:D\ are wrong(wroted, spell.....)
    argh i hope i said it right here, so you can understand me.......
     
  14. SleepySquidd

    SleepySquidd Tragically Magic Hands

    Just a helpful hint, when you post code and/or batch commands, try surrounding the text with [.CODE] and [./CODE] (without the periods of course) at the end. It prevents emoticons from being placed where they aren't wanted.

    edit: funky code block
     
    Last edited: Dec 28, 2014
  15. gelini89

    gelini89 Void-Bound Voyager

    @FlyingAnonymoose yeah i see this "after" i posted it. i tried to edit the post...... but this isnt very helpful only for my question. im sorry for the silly emoticons but i cant changed it now....
    and all wire-words (like Or/Nor-Gate) ;-) are closed books for me...

    have a good night/day. i go sleep now...
     
  16. ravenvalentine

    ravenvalentine Void-Bound Voyager

    before finding this mod i have been messing with the packed mods and trying to open them with other things like winRAR and such to fix things like did with other mod's missing items or improving the texture etc etc the result of me trying to open the .modpak files left me with soooo many files under the recommended tab forcing me to open it with winrar now is not letting me use it on your mod to unpack it saying (( this is not a PAK file i can only unpack Pak files... try again :zzz:'' )) so any help ?` i'dlike to remove all the recommended programs from its tap but even with the mighty power of Google i didnt know how....fixing the marker item on the quarry from the mod star foundry was all i was after xD
     
  17. SexualRhinoceros

    SexualRhinoceros Existential Complex

    wow this thread is still going, I unsubbed from it so long ago. @Olxinos, you seem to know whats what, is the OP still accurate?
     
  18. NanoPi

    NanoPi Scruffy Nerf-Herder

    the Windows instructions still work, but it could be made a tiny bit easier. (using steam client to open the game folder, opening command prompt already CD'd to the same folder that explorer is displaying, typing relative paths instead of copying and pasting partial file paths)

    Code:
    "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\win32\asset_packer.exe" "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\assets\test" "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\assets\test\packed.pak"
    pasting this whole thing still works for me. if any of that path is different for someone they can use the instructions to build the file paths that are specific to them.

    one way to make it easier: Shift+RightClick to build a file path more easily than copying the folder path from explorer and constructing a file path out of it and having to insert quote marks and backslashes correctly.

    this also applies to Windows Command Prompt but it is an alternative to copying and pasting a complete file path.
     
  19. Olxinos

    Olxinos Scruffy Nerf-Herder

    It's still accurate, except that the mac executables (Edit: i mean packer/unpacker not the game itself) are kind of broken in the latest unstable version (also the "real" Starbound.app is now in an "osx" directory at the root of the starbound directory):
    They must have thought they were a bit too hidden in the Starbound.app bundle, so they tried to move them out of it... which could have been totally fine if they didn't depend on files inside of the bundle (frameworks).

    Anyone who uses your method will find them and certainly figure out they have been moved (then adapt according to their new location). Well, then, figuring out why they don't launch correctly is a bit less obvious but it should be corrected soon anyway, maybe even by simply moving them back in the bundle (because it is the simplest solution, it's also my "solution 1", although the terminal command lines may seem cryptic).

    If you were to add/change anything, just say that in the current unstable version, you should move them back from osx/ to osx/Starbound.app/Contents/MacOS (before step 3, and only once per installation) to use them.
    It's likely to be changed in the next update though (since it's broken).
     
    Last edited: Jan 7, 2015
  20. aMannus

    aMannus Space Kumquat

    My video is still up to date for windows because I followed my own tutorial for unstable and it was still all the same. That's for windows, atleast. Was a bit weird listening to my own voice for a tutorial though.
     
    The | Suit likes this.

Share This Page