Tutorial How to successfully pack and unpack .pak files

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

  1. Kindlol345

    Kindlol345 Space Hobo

    If you could help me, I followed the instructions to a T, but it still left the "Packed.pak" file instead of opening it! (Im on a mac, by the by)
     
    WorldHero likes this.
  2. SpaceApple

    SpaceApple Scruffy Nerf-Herder

    Nothing happened when I tried to unpack packed.pak on Windows 7. I typed the command, pressed enter, and waited 8 hours. I didn't get any errors.

    I also tried using ModPackHelper to do it but it also does nothing.
     
  3. Marxon

    Marxon Supernova

    It requires directory arguments for output, don't know it off the top of my head though.
     
  4. SpaceApple

    SpaceApple Scruffy Nerf-Herder

    I typed this:
    Code:
    "win32\asset_unpacker.exe" "assets\packed.pak" "UnpackedAssets"
    Is there anything else that needs to be added?
     
  5. Marxon

    Marxon Supernova

    The folder must already exist.
     
  6. SpaceApple

    SpaceApple Scruffy Nerf-Herder

    I created the folder and tried to unpack it again. Still nothing.
     
  7. Marxon

    Marxon Supernova

    I got nothing then
     
  8. SpaceApple

    SpaceApple Scruffy Nerf-Herder

    Alright. Thanks for trying though.
     
  9. Peelz

    Peelz Giant Laser Beams

    Did you open the command window inside your Starbound folder?
     
  10. emilytaylorj

    emilytaylorj Void-Bound Voyager

    [​IMG]
    This is what's happening in my terminal. Apparently it's supposed to run, though nothing is happening. Am I entering something wrong? I dragged in the unpacker location, then the packed assets file location, then a new location for the unpacked assets to go. I tried the first method of "repeating step 5" by dragging in the assets file again and replacing the last .pak extension with just a forward slash, but that didn't work either and gave me the same result as this screenshot. Any help would be appreciated!
     
    WorldHero likes this.
  11. Flarp987

    Flarp987 Void-Bound Voyager

    it says ' C:\program' is not recongnized command or internal or external command, operable program or batch file[DOUBLEPOST=1450803229][/DOUBLEPOST]why does it happen!
    and can anyone help?!:cry::oops:D::saywhat::whaaat::lod::p:down: PLEASE REPLY I AM GONNA DIE!
     
  12. chrisgbk

    chrisgbk Subatomic Cosmonaut

    It would be helpful to see the full command line output. One possible problem is you are trying to extract to a folder where you don't have permission to access - in that case, either you need to extract to a folder you do have permission to access, or you need to run cmd.exe as an administrator. Under newer versions of Windows, the Program Files and Program Files (x86) directories require administrator access to make changes.

    Any path with spaces must have double quotes around it, like "this path\has quotes", otherwise it tries to run the command named 'this' with the arguments 'path\has' and 'quotes' .

    So instead of C:\Program Files (x86)\steam\... you want "C:\Program Files (x86)\steam\..."
    and you'll need to do this with any paths to the assets or .pak as well.

    Alternatively, you can use a GUI such as the one I made over here: http://community.playstarbound.com/threads/updated-asset-packaging-unpackaging-gui-frontend.95468/

    It supports drag and drop, and guides you through the process. Still subject to the above limitations on permissions, but I find many people are more familiar with right clicking on an exe and choosing to run as an administrator than trying to launch a command line as an administrator.
    [​IMG]

    No experience with OSX and I don't have a Linux system running that's capable of games (which works similarily) so I can't test in a similar environment, but I'd guess that it's not handling spaces properly due to the shell script passing arguments to the program - the unquoted spaces are escaped, and the escapes are lost once the shell script passes them to the program with $@, so the actual program sees more arguments than it expects - 4 instead of 2, so it throws the usage at you. You may be able to solve by surrounding the paths with quotations, or alternatively I'd suggest changing directory first (and just to be sure, trying to create the output folder manually beforehand - but that's optional):

    Code:
    /Users/emilyjones/Library/Application\ Support/Steam/SteamApps/common/Starbound/osx/asset_unpacker.sh "/Users/emilyjones/Library/Application\ Support/Steam/SteamApps/common/Starbound/assets/packed.pak" "/Users/emilyjones/Library/Application\ Support/Steam/SteamApps/common/Starbound/assets/Unpacked"
    
    - OR -
    
    cd /Users/emilyjones/Library/Application\ Support/Steam/SteamApps/common/Starbound
    mkdir ./assets/Unpacked
    ./osx/asset_unpacker.sh ./assets/packed.pak ./assets/Unpacked
    
    I find the second one more readable, but whichever you find more convenient.
     
  13. emilytaylorj

    emilytaylorj Void-Bound Voyager

    Code:
    Last login: Tue Dec 29 13:15:20 on ttys000
    
    Emilys-iMac:~ emilyjones$ cd /Users/emilyjones/Library/Application\ Support/Steam/SteamApps/common/Starbound
    
    Emilys-iMac:Starbound emilyjones$ mkdir ./assets/Unpacked
    
    mkdir: ./assets/Unpacked: File exists
    
    Emilys-iMac:Starbound emilyjones$ ./osx/asset_unpacker.sh ./assets/packed.pak ./assets/Unpacked
    
    Exception caught: (AssetBackendException) Asset database ./assets/packed.pak is missing
    
    0   asset_unpacker                      0x00000001036eea2d _ZN4Star13StarExceptionC2EPKcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE + 141
    
    1   asset_unpacker                      0x000000010367019f _ZN4Star21AssetsDatabaseBackendC2ERKNS_6StringE + 351
    
    2   asset_unpacker                      0x000000010366b7b2 main + 114
    
    3   asset_unpacker                      0x000000010366b734 start + 52
    
    4   ???                                 0x0000000000000003 0x0 + 3
    
    Emilys-iMac:Starbound emilyjones$ 
    This is the new result as of the second option you gave me to try. It worked up until the last line, which gave me the exception once I pressed enter. Keep in mind that I really don't know what I'm doing here, and just going off of simple directions like "type this, press enter, go to this file" etc. From what I can tell, is it just that terminal isn't finding the packed.pak file? Maybe I should move packed.pak to the same location as the unpacker?
     
  14. chrisgbk

    chrisgbk Subatomic Cosmonaut

    Partially my bad, I didn't notice the shell script they include changes the directory for you, to the directory that contains the script; this means the paths were incorrect (it was trying to find the assets folder in the osx folder) so this modified version of the last line "should" work once you run the "cd" command from my last post. Unless magical gremlins muck things up.

    Code:
    ./osx/asset_unpacker.sh ../assets/packed.pak ../assets/Unpacked
     
  15. emilytaylorj

    emilytaylorj Void-Bound Voyager

    So.. just add two extra periods? Haha. I mean I tried it, and it's either working or it froze. More progress than I've ever made so far, so yay!

    Edit 2: IT WORKED WHAT THE STUFF thank you SO MUCH random stranger. You are a wizard.
     
  16. WorldHero

    WorldHero Scruffy Nerf-Herder

    I was having trouble with this stuff a while back and I couldn't figure out what I was doing wrong, and I wanted to try it again.
    For a while, I was having a similar problem as emilytaylorj with my OS X...Until I realized I just had to create a new folder myself in assets and dragged that to my Terminal and then OMG IT WORKED~ I'm watching it unpack everything into that folder I just created. YES THANK YOU~
     
  17. Mumpfbrapp

    Mumpfbrapp Scruffy Nerf-Herder

    °grins° Let's kick it up a Notch, shall We?

    IF it is possible, HOW do i run the game from the unpacked Files INSTEAD from packed.pak?

    Note:
    I use Windows, all Assets unpacked nicely and i know my Way around a Computer. (Just saying, not bragging)

    Situation:
    It currently resides all in Starbound\Assets\, where the packed.pak lived, which i moved to a fidderent Drive.

    In starbound\giraffe_storage\starbound.config there is a Line

    "checkAssetsDigest" : true,

    I tried setting it to true and false, nothing changed, i always get:

    Error: Fatal Exception caught: (AssetBackendException) Asset database ../assets/packed.pak is missing

    Ideas:
    Do i put packed.pak back into its original Place AND leave the unpacked Assets-Folder-Structure in the same Directory,
    Starbound then reads the Pak-file and overwrites it with the unpacked Files from the same Directory, THEN with the Files in the Modfolder
    or
    Do i put packed.pak back into its original Place and MOVE the unpacked Assets into their own Mod which then lives in the Modfolder?
    or
    [Insertsomeotherwaytodoit]
    or
    Is it simply and totally not possible at all? (IF so, please tell, so i can stop worrying :eek:) )

    Sincerely, Mumpfbrapp
     
  18. Mackinz

    Mackinz The Waste of Time

    Why would you want to run the game from unpacked assets? It would be a far slower game load and woyld not change anything except for the amount of work you'd be doing after every update.

    Just run the game from packed assets like a normal person. If you need to mod something in the vanilla game, make a mod. Simple.
     
  19. sleepy123

    sleepy123 Big Damn Hero

    If I could make it anyone can.
    Thanks for the unpacker.bat
    [​IMG]
     
  20. Mumpfbrapp

    Mumpfbrapp Scruffy Nerf-Herder

    °looks at Mackinz and sighs°
    I am sorry, i came here for help, not to justify my Position or Opinion.
    But i guess, i have to...

    I did not expect to run against a Wall with my first Post and certainly did not and still do not want to
    make any Trouble but if a Question about modding is answered by "Why would you want to do that?",
    such does not appear to me as a healthy Environment.

    I certainly hope, that Your Posting, Mackinz, will not discourage Anyone else who might want to help.

    Because, you know, You are not actually the Thought-Police, no matter how many Posts you generate.

    Should this Reply appear to Anyone on the slightly nasty Side, keep in Mind:
    I asked a simple Question and keeping in Mind this is the Help-section of the Modding-Part of this Forum,
    i find the Answer i got quite rude.

    An Answer which translates more or less to
    "Shut up and do what everyone else does, do not ask, do not want to do Things your Way"

    I strongly suggest that you read the Forumrules, Mackinz, especially the ones about pointless Posts and Thread-derailing.


    And with that, i am done. to all others i apologize for this Incident, but i will not stand by quietly while
    being ridiculed for a simple Question.
     

Share This Page