Giter VIP home page Giter VIP logo

godotpcktool's Introduction

Godot Pck Tool

A standalone executable for unpacking and packing Godot .pck files.

Command line usage

For these you just need the GodotPckTool executable. Available from the releases page.

Note: if you don't install it on Linux you need to either use the full path or put it in a folder and run it as ./godotpcktool similarly to Windows.

You can view the tool help by running godotpcktool -h

Listing contents

Lists the files inside a pck file.

godotpcktool Thrive.pck

Long form:

godotpcktool --pack Thrive.pck --action list

Extracting contents

Extracts the contents of a pck file.

godotpcktool Thrive.pck -a e -o extracted

Long form:

godotpcktool --pack Thrive.pck --action extract --output extracted

Adding content

Adds content to an existing pck or creates a new pck. When creating a new pck you can specify which Godot version the pck file says it is packed with using the flag set-godot-version.

godotpcktool Thrive.pck -a a extracted --remove-prefix extracted

Long form:

godotpcktool --pack Thrive.pck --action add --remove-prefix extracted --file extracted

Filters

Filters can be used to only act on a subset of files in a pck file, or from the filesystem.

Min size

Specify the minimum size under which files are excluded:

godotpcktool --min-size-filter 1000

This will exclude files with size 999 bytes and below.

Max size

Specify the maximum size above which files are excluded:

godotpcktool --max-size-filter 1000

NOTE: if you use max size to compliment min size extraction, you should subtract one from the size, otherwise you'll operate on the same files twice.

However if you want to work on exactly some size files you can specify the same size twice:

godotpcktool --min-size-filter 1 --max-size-filter 1

Include by name

The option to include files can be given a list of regular expressions that select only files that match at least one of them to be processed. For example, you can list all files containing "po" in their names with:

godotpcktool --include-regex-filter po

Or if you want to require that to be the file extension (note that different shells require different escaping):

godotpcktool -i '\.po'

Multiple regular expressions can be separated by comma, or specified by giving the option multiple times:

godotpcktool -i '\.po,\.txt'
godotpcktool -i '\.po' -i '\.txt'

If no include filter is specified, all files pass through it. So not specifying an include filter means "process all files".

Note that filtering is case-sensitive.

Exclude by name

Files can also be excluded if they match a regular expression:

godotpcktool --exclude-regex-filter txt

If both include and exclude filters are specified, then first the include filter is applied, after that the exclude filter is used to filter out files that passed the first filter. For example to find files containing "po" but no "zh":

godotpcktool -i '\.po' -e 'zh'

Overriding filters

If you need more complex filtering you can specify regular expressions with --include-override-filter which makes any file matching any of those regular expression be included in the operation, even if another filter would cause the file to be excluded. For example you can use this to set file size limits and then override those for specific type:

godotpcktool --min-size-filter 1000 --include-override-filter '\.txt'

Advanced Options

Specifying Engine Version

When creating a .pck file it is possible to specify the Godot engine version the .pck says it is created with:

godotpcktool NewPack.pck -a a some_file.txt --set-godot-version 3.5.0

Note that this approach does not override the engine version number in existing .pck files. This currently only applies to new .pck files.

General info

In the long form multiple files may be included like this:

godotpcktool ... --file firstfile,secondfile

Make sure to use quoting if your files contain spaces, otherwise the files will be interpreted as other options.

In the short form the files can just be listed after the other commands. If your file begins with a - you can prevent it from being interpreted as a parameter by adding -- between the parameters and the list of files.

Building

These are instructions for building this on Fedora, including cross compiling to Windows.

Note that native Linux build uses the glibc of the currently installed system, which may be too new for older distros. For a build that supports those, see the section about podman builds.

Required libraries

sudo dnf install cmake gcc-c++ libstdc++-static mingw32-gcc-c++ mingw32-winpthreads-static

Also don't forget to init git submodules.

Then just:

make

Also if you want to make a folder with the executables and cross compile:

make all-install

Podman build

Podman can be used to build a Linux binary using the oldest supported Ubuntu LTS. This ensures widest compatibility of the resulting binary.

First make sure podman and make are installed, then run the make target:

make compile-podman

Due to the use of C++ 17 and non-ancient cmake version, the oldest working Ubuntu LTS is currently 20.04.

godotpcktool's People

Contributors

hhyyrylainen avatar dependabot[bot] avatar calinou avatar rgson avatar nikitalita avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.