Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

  1. #1

    Default Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Hereby I present the first release of the PACK modding tool, and new addition to the growing collection of modding tools created by the Europa Barbarorum team. This tool is the result of me converting johnwhile's research into the PACK file format into a usable little tool which has the following features (usage info):
    Code:
    pack <command> [opts] -- [<PACK> [file...]]
    pack <command> [opts] [<PACK> [file...]]
    
    Where <PACK> is the PACK file to operate on and pack the pack program
    
    Commands:
       -a, --add              :  add files to PACK file. If <pack> does not exist
                                 it will be created.
       -c, --create           :  create a new PACK file, overwriting <pack> if it
                                 already exists. --no-clobber is not supported.
       -h, --help             :  display this help
       -l, --list             :  list files contained by a given PACK file
       -r, --remove           :  remove files from PACK file
       -x, --extract          :  extract files from an existing PACK file
       -v, --version          :  display version information
    
    Options:
    
       -n, --no-clobber       :  do not overwrite existing files. When extracting 
                                 files from a PACK file this option guards against 
                                 overwriting files in the target directory; when 
                                 adding files to an existing PACK it prevents 
                                 overwriting files already present in the PACK file.
       -i, --case-insensitive :  [file...] is case insensitive, this option only 
                                 applies to matching files located in the PACK
                                 file   
       -g, --glob             :  [file...] may contain wildcards ('*' and '?'),
                                 this option only applies to matching files 
                                 located in the PACK file.
       -d, --details          :  list details about the contents of a PACK file
       -t, --text             :  read file names from given text file(s), when 
                                 creating a PACK file
       -0, --xargs            :  read NULL delimited file names from given file(s),
                                 when creating a PACK file
    The program is available as both a source and a binary distribution from our FTP server. Both distributions are packaged as 7zip archives. Programs such as 7-zip can be used to extract these contents. (You can get 7-zip from here: http://www.7-zip.org/ or commandline equivalent p7zip from here: http://p7zip.sourceforge.net/ )

    The program is made available under the GPL v.2 or later, copy of which is provided in licence.txt of either distribution. Below follows the summary:

    Terms of Use
    This software is free and there is no warranty what so ever. Use at your own risk.
    See licence.txt for a copy of the program licence.

    Copyright (C) 2012 The Europa Barbarorum Team <webmaster at europabarbarorum dot com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details at
    http://www.fsf.org/licensing/licenses/gpl.txt

    Comments, criticism, improvements and bug reports are welcome. Regards,

    The Europa Barbarorum Team.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  2. #2
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    So this will repack your mods files? Interesting, very useful for big mods. Have some rep , when I can give it again

  3. #3

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Yep. It will also allow you to edit existing packs.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  4. #4

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    New version, which brings a few code simplifications. Features & behaviour remain the same.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  5. #5
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Another great tool to have, Thanks.

    VB

  6. #6

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    New release. Fixed a crash when creating directories on Windows.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  7. #7

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    New release, this one fixes some inverted logic (if/else) which causes packing certain files to fail. To trigger the bug you would have to have a file for which only the last "chunk" of data is incompressible.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  8. #8
    paradamed's Avatar Praepositus
    Join Date
    Jun 2006
    Location
    Brasνlia, Brasil
    Posts
    5,808

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Will it work with the animation packs?

  9. #9

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    This tool is meant for everything normally part of the packs folder, the files you can also unpack using the CA unpacker tools. I may very well be wrong (haven't checked), but I don't think that animation (or sounds or skeletons or events) IDX/DAT files are part of this.

    If you are looking to generate IDX/DAT files you want to try the XIDX tool (link in my signature), although in case of animations you need to realise that M2TW CAS files (the files generated by the various 3d modelling modding tools) are different from what appears to be written to the animations IDX/DAT archive. Additionally the file format of what goes into the skeletons IDX/DAT files is poorly understood (if at all). Both issues requires more research + tooling support before you can use the tools to generate these types of files. Both are on the (admittedly, long) TODO list.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  10. #10
    paradamed's Avatar Praepositus
    Join Date
    Jun 2006
    Location
    Brasνlia, Brasil
    Posts
    5,808

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Thanks for clarifying.

  11. #11

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    It's really useful tool. Thanks friend.

    Edit: I made a bat file to use this tool and copied it to the packs folder:
    Quote Originally Posted by unpack.bat
    @echo off
    pack_x86.exe -x localized.pack
    It works fine.

    I tried this code:
    pack_x86.exe -l localized.pack

    Yes, I saw the file list in screen. But how can I copy them into a text file?

    Like this:
    Quote Originally Posted by unpacker.exe
    unpacker.exe --source=localized.pack --destination=pack_contents.txt --verbosity=1 --mode=1
    Edit2: How can I use --text option, can you give us some examples of usage ?

  12. #12

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Quote Originally Posted by nedensiz1 View Post
    It's really useful tool. Thanks friend.

    Edit: I made a bat file to use this tool and copied it to the packs folder:


    It works fine.

    I tried this code:
    pack_x86.exe -l localized.pack

    Yes, I saw the file list in screen. But how can I copy them into a text file?
    If you want to save the file listing to a text file, I/O redirection will do. Assuming that "pack" is the pack executable you choose:
    Code:
    pack -l localized.pack > list.txt
    That command will send the output (stdout) to the list.txt file instead of your screen.

    Like this:
    Edit2: How can I use --text option, can you give us some examples of usage ?
    I don't know what the CA unpacker --text option does. If you need to select specific types of files you can use the -g (--glob) option, it will turn on support for the asterisk (*) and question mark (?) wildcards. For example if you want only files from data/text in your file listing as above:
    Code:
    pack -lg localized.pack data/text/* > data_text_list.txt
    Asterisk means any string (0 or more characters), question mark means any character (1). So *.cuf selects any (dot) cuf file.

    You can further distinguish between case sensitive and case insensitive using the -i (--case-insensitive) option. Normally the pack tool treats file names as case sensitive, but the -i option will disable that.

    These glob options are most useful when extracting:
    Code:
    pack -xing localized.pack *.CUF
    Extracts all files ending with (dot) CUF (case insensitive), also prevents the pack tool from overwriting existing files with -n (--no-clobber) option.
    Last edited by Tellos Athenaios; April 01, 2012 at 01:30 PM.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  13. #13

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Update:

    Fixes
    • Fix missing include (stdio.h) in util.h
    • Fix bad handling of the output pointer at slurp(), in util.c. Fortunately, in the case of the PACK tool this bug would not "manifest" itself during runtime.
    • Fix opening sentence in the ReadMe, proving nobody ever reads those.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  14. #14
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,250

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    First of the Europa Barbarorum set of tools I've really found a use/need for.

    Executables were handy and resolved a problem I had been having tied to some decompression as I couldn't get Python bindings to work.

    I was thrown when trying to get back to the same compressed values I started with but that may be just my setup (the offset increased by 1 and the size increased slightly). The results using the tool decompressed back to the same uncompressed file consistently though and so far seem to work fine.

    +rep

  15. #15

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Another update. This one fixes a bug which caused the tool to crash (due to segfault) when unpacking uncompressed data (chunks).
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  16. #16
    AnthoniusII's Avatar XXI ARMORED BRIGADE
    Join Date
    Feb 2007
    Location
    Thessalonike Greece
    Posts
    21,783

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Please explain step by step what OTHER programms i need to install inorder tro make this tool to work.
    I unpacked it but when i press x86 i have NO commands list or anything.
    Only for a second a dos window apears and then NOTHING.
    Please someone make a step by stepo example.
    There are moments (in history), in which a nation owes,
    if it wants to be considered as a great one, to be able to fight.
    Even without hope of winning. Just because it has to.
    Greek War motto.
    XXI Armored Brigade. Proud that served in that unit in 1996!
    "Spartans do not ask how many (enemies are) but where they are"!
    XXI Armored Brigade's motto.
    The Greek Secret (or why they will fight again if it will be necessary or why they do not sell their history).


  17. #17

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    Quote Originally Posted by AnthoniusII View Post
    Please explain step by step what OTHER programms i need to install inorder tro make this tool to work.
    I unpacked it but when i press x86 i have NO commands list or anything.
    Only for a second a dos window apears and then NOTHING.
    Please someone make a step by stepo example.
    It is meant to be used from the command line. If you don't want to use the commandline directly, you could write a batch file with appropriate commands to the pack tool. Please take a look at some of the examples posted in this thread.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  18. #18
    AnthoniusII's Avatar XXI ARMORED BRIGADE
    Join Date
    Feb 2007
    Location
    Thessalonike Greece
    Posts
    21,783

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    I still do not understand...
    Where is the command line ...
    May be i am to stupid...A visual step by step example (with pictures) would help.
    We are not programmers -at least most of us-you know..
    There are moments (in history), in which a nation owes,
    if it wants to be considered as a great one, to be able to fight.
    Even without hope of winning. Just because it has to.
    Greek War motto.
    XXI Armored Brigade. Proud that served in that unit in 1996!
    "Spartans do not ask how many (enemies are) but where they are"!
    XXI Armored Brigade's motto.
    The Greek Secret (or why they will fight again if it will be necessary or why they do not sell their history).


  19. #19

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    This screenshots shows navigation on the commandline (cd), how to set a variable (set pack=) to select the version of the exe and avoid having to type out long paths (%pack% instead of full paths), as well as a few simple commands to pack a file into a test pack and verify results. Explorer window is for context.


    In the official packs which are shipped with the Kingdoms expansion the "root" of the packs is not the mod folder (i.e. not mods/teutonic for example) but the Vanilla root. Additionally the Vanilla packs were generated using the slash (/) as directory separator and not the backslash (\). This is why I deliberately set up the example in a way that mimics the official packs as closely as possible, which requires that I execute the pack command (%pack% -a ...) not from within my mod folder but from two layers up.
    Last edited by Tellos Athenaios; July 13, 2013 at 03:00 PM.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    “ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  20. #20
    AnthoniusII's Avatar XXI ARMORED BRIGADE
    Join Date
    Feb 2007
    Location
    Thessalonike Greece
    Posts
    21,783

    Default Re: Release of the PACK tool (for packing/unpacking/repacking M2TW PACK files)

    I will try again....
    But i believe a tool command list like those there are in GOAT or in IWTE tools would make modders life easier.
    For computing noobs like me dos command pannel is not the friendliest one...
    Last edited by AnthoniusII; July 15, 2013 at 09:52 AM.
    There are moments (in history), in which a nation owes,
    if it wants to be considered as a great one, to be able to fight.
    Even without hope of winning. Just because it has to.
    Greek War motto.
    XXI Armored Brigade. Proud that served in that unit in 1996!
    "Spartans do not ask how many (enemies are) but where they are"!
    XXI Armored Brigade's motto.
    The Greek Secret (or why they will fight again if it will be necessary or why they do not sell their history).


Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •