Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

Kazumakuun

Uploaded by

KazumaKuun

Virus scan

Some suspicious files

Tags for this mod

About this mod

A simple Python script to automatically unpack small BA2 files in your mods directory. Fully configurable. For those who found themselves over the BA2 limit.

Requirements
Permissions and credits
Mirrors
Changelogs
New version has just released! Go check it out, it's now 245% easier to use!

Read this first - AV false positives

The AIO (exe) version is known to cause false positive on some antivirus software (MS defender, BitDefender, etc.). Please be assured that the program is totally virus-free, and you can find the source code (linked below) on GitHub. Should you be concerned, you can use the script version of the file, or choose not to use it. 

For total transparency, here is a link to Virustotal page of the exe file. The false positive is likely caused by Nuitka, the software I use to translate .py files into .exe files. Unfortunately there is little I can do to correct this problem.

If you know a way to pack .py files into a standalone exe that has a reasonable file size and is completely standalone, please let me know!

Description


This is a simple Python script that extracts all small non-texture ba2 files so that you won't run over ba2 limit.

In case you don't know, Fallout 4 engine has a hard limit of 256 non-texture BA2 archives that can be loaded in your game (sauce). If you have more, chances are your game will crash on load, behave erratically, and all kinds of fun stuff.

It has been suggested that Buffout users can use a ba2 limit bypass. However, while the trick allows the game to load, sometimes you get broken atlas (texture) regardless. The best solution is to reduce your ba2 count.

For me, that means to manually extract hundreds of small ba2 files and back them up in case something breaks. Yucks! This helper script hopefully frees you from all that manual work. Just 1 minute of easy configuration and it will take care of the rest :)

Usage - AIO Version

The AIO version has all dependencies packed in - no need for manual Python 3 or BSA Browser installs! :D

To run it, unzip the entire folder to a convenient place, like your Desktop.
Then, simply double click unpack.exe to get started.
The program will guide you through the entire unpacking process.

You can edit the ignore.txt in the folder to specify the files that you do not want to extract.

Usage - Script Version

You will need the following dependencies:

  • Python 3
    All recent Python 3 releases should work just fine.
  • BSA Browser
    Both installer and portable version works; however if you use the installer version, make sure "Install CLI executable" is ticked.

First, unzip the entire folder to a convenient place, like your Desktop.

Then, run the following command in cmd/Windows Terminal/whatever terminal in the folder where you extracted the files, and enter:

python3 ./unpack.py

The extraction and backup will then proceed automatically.

You can edit the ignore.txt in the folder to specify the files that you do not want to extract.

By default, the script will proceed in interactive mode (like the exe version). However if you want to automate the process or wish to manually configure the settings, please read the "Manual Configuration" section.

Special Considerations

Extracting small ba2 files should not impact your performance or destabilize your game in a significant way.

However, since loose files always wins conflicts against ba2 files, newly extracted loose files may cause overwriting/conflict issues that did not exist before.

This is why it is recommended to carefully look at your load order and look out for conflicts. Mod managers such as MO2 makes it easy to see file conflicts but it doesn't check against ba2 (by default, you can turn on that option in Settings > Workarounds > Enable archives parsing) (thanks Mimicry for the tip!). You might need manual checks to make sure everything works as expected.

Manual Configuration

You do NOT need to worry about it anymore, unless you specifically want manual configurations.

The following parameters can be configured to suit your needs. Parameters with an asterisk (*) next to it must be changed before running the script.

  • interactive*: you must set it to False for your manual configurations to be effective.
  • mod_path*: this should be the path to the mod folder in your mod manager. In MO2 it's Open > Open Mods folder. In Vortex it's Open > Open Mod Staging Folder. You can technically supply your Fallout 4 root folder (if you don't use any mod manager), but I haven't tested this approach.
  • threshold: this is the maximum size of bsa to extract, in bytes. Thus 5 * 1024 * 1024 gives 5MB, while 200 * 1024 gives 200KB. Any file larger than this will not be touched.
  • postfixes: this is the file postfixes (case-insensitive) that should be extracted. The default should be fine for most cases. For example, "main.ba2" matches all files that ends with "main.ba2" (abcmod - main.ba2, xyzmod - main.ba2, etc.).
    Note: you do not need to extract texture BA2 files, they are exempt from the BSA limit.
  • bsab_exe_path: this should point directly to your bsab.exe from your BSA Browser installation. A copy of bsab.exe is already included in
    the download, and you can leave the default unchanged.
  • ignored: if you have any file that should not be extracted, you can list them here (case-insensitive). Use standard Python string array format.
    Example: ['abcmod - main.ba2', 'xyzmod - main.ba2']

Future Plans

While this script works, it was hastily cobbled together in an hour and lacks some features I want. These areas are being considered if I get time to work on them.
  • Intelligently set the threshold so that "just enough" ba2 are extracted (done! v2.0)
  • More robust code with error handling etc
  • Make it interactive? (done! v2.0)
  • Resolve the false positive problem with AV
  • Graphical interface

Your feedback is welcome and please let me know of any suggestions or bugs.

Source

You can review the source code of this script here on GitHub.

Archived Files

It is recommended NOT to download files in "File Archive". These uploads are either unusable or missing key files.

Credits

AlexxEG for BSA Browser