0 of 0

File information

Last updated

Original upload

Created by

Magnusen2

Uploaded by

Magnusen2

Virus scan

Safe to use

Tags for this mod

About this mod

Powershell scripts for automation of .ba2 archive management

Permissions and credits
This is intended to be used with my other mod Pack into ba2


It adds two powershell scripts:

Scan for small BA2s.ps1
this has the purpose of automating the process of finding small mods that don't need to be packed at all and contribute to the .ba2 limit which is 255 active at one time. If the game tries to have more than 255 loaded at once the game will crash. Most people start having this problem at 400-450 archives.

Process:
1. Will scan the $searchPath (your mod organizer mod folder) for folders that contain at least one .ba2 archive
2. If .ba2 found, calculate the directory size
3. If size is smaller than what's set in $minSize (default 10MB), it will move the directory to the $targetPath (the directory that Pack into .ba2 is located)

variables:
$searchPath = mod organizer mod folder
$targetPath = Pack into .ba2 folder
$minSize = if a folder is smaller than this size move it to $targetPath



Scan for folders eligible for packing.ps1:
this has the purpose of automating the process of finding big mods that aren't packed and slow down the game file loading process.

Process:
1. Will scan the $modDirectory (your mod organizer mod folder) for folders that DON'T contain at least one .ba2 archive
2. If no .ba2 is found, check if there's any "textures" "materials" "meshes" folders inside it
3. if any of these folders are present, calculate the directory size
3. If size is bigger than what's set in $minSize (default 250MB), it will move the directory to the $targetDirectory (the directory that Pack into .ba2 is located)

variables:
$modDirectory = mod organizer mod folder
$targetDirectory = Pack into .ba2 folder
$minSize = if a folder is bigger than this size move it to $targetPath



Installation instructions
1. Extract the scripts anywhere in your computer
2. Open then using a text editor and edit the variables
e.g.
$searchPath = mod organizer mod folder
if your mod organizer folder is in "C:\Users\Username\Documents\Mod Organizer\mods"
$searchPath = "C:\Users\Username\Documents\Mod Organizer\mods"

if you want every mod that is smaller than 20MB to be sent to the $targetPath, set $minSize to:
$minSize = 20MB

3. Run them by right clicking on them > Run with powershell
4. If you did everything correctly the folders will be at the pack to ba2 folder and you will be able to run the scripts in there on them.



Current issues
Scan for small BA2s.ps1: will print errors to the console for each folder found but this can be ignored.