Jump to content

[Skyrim] Using BAIN and Archive.exe to Package a Skyrim Mod


Arthmoor

Recommended Posts

It's been awhile since I last wrote up a guide for something, but this one is too good to just let slide by into Oblivion without writing it down somewhere. I'll be posting this as a tutorial for mod distribution via TESA when it's all done.

Packaging a mod for distribution in Skyrim is a pain. The preferred method for doing so is to make a BSA package, but the process for doing this in the CK is error prone due to skipping a lot of things one may not even realize are missing.

Gather Your Tools

You'll need to have the following installed or readily available:

Archive.exe (comes with the CK)
Wrye Bash 297 or higher.
UnFuzer (if you have voice files to convert first)

Look for Wrye Bash's mod installation folder. This will usually be found with your Steam install of Skyrim. Mine is located at C:\Steam\steamapps\common\Skyrim Mods\Bash Installers\

In the Bash Installers folder, create a new folder with the name of your mod.In this new folder, create the subfolders you'll need. Usually meshes, textures, sound, scripts, etc.

BAINTut1.jpg

Below each of the top level folders, you'll need to copy all of the data files your mod uses into their appropriate subfolders. The results will look something like this:

BAINTut2.jpg

Be sure when gathering up the compiled scripts (.pex files) that you remember to copy any of the vanilla Skyrim scripts you may have altered. It isn't necessary to include your source code files (.psc) but they're handy for other people who might want to learn how you did something.

When copying the face texture data, you can leave out the .tga files. The game doesn't use those.

Once you have everything in place, open up Wrye Bash and switch to the installers tab. Your project folder should appear at the top, similar to this:

BAINTut3.jpg

Scroll through the list of files it shows you. If you're familiar with BAIN, this shouldn't feel any different than installing other peoples' mods. The only difference being that your project folder is listed with them. For all intents and purposes, BAIN will treat it just like any other mod on your system.

Aside from neatly organizing things, this also has one huge benefit. You'll immediately know if something you install later has a conflict with it because your project status will change from green to some other color. Usually orange or yellow, just like it does when other mods conflict with each other.

If your mod has voice files, you'll want to convert those into Skyrim's standard format, the .fuz file. This is a combination of .lip and .wxm files. .wxm files start out as .wav files. Skyrim apparently only wants to see .fuz files. Check your voice folder and see what you have. If you have a bunch of .wav files, it's time to open up UnFuzer.

Configure it to look into your project folder. In my example, it would look like this:

BAINTut4.jpg

The checked options are necessary in order to process the entire folder in one easy step. Simply click on the "Refuz" button to process the folder. It will tell you how many files were converted. It shouldn't take very long.

When you're done, close that out and return to Wrye Bash. It may be indicating to you that your project is no longer in a proper state. This is normal since you just switched the data files for your voice content into a new format. Right-click on your project and select "Anneal".

BAINTut5.jpg.png

It should have everything sync'd up properly once that's done. If you end up with it telling you files are missing, right-click your project again and select "Install Missing".

Now it's time to package the results into a BSA you can distribute the mod with.

Locate the Archive.exe utility. It's in the same folder as the CreationKit.exe file. Double click it to open it up. You'll have a somewhat spartan display:

BAINTut6.jpg

The first thing you want to do is go to where it shows "Root Dir" and click the button to the right of the box with "Data" in it.

BAINTut7.jpg

It will ask you to browse to a folder. Find the Bash Installers folder and use the folder for your mod project that's underneath it.

Next, you need to select the appropriate checkboxes at the top. Usually this is one checkbox for each folder type. In my example, meshes, textures, sound, voice, and misc. Misc covers things like scripts and SKSE plugins if you have them. You'll also want to check the two boxes for retaining names. Compressing the file is up to you.

BAINTut8.jpg

Now you want to drag your files in. With Archive.exe still open, switch to Windows Explorer. Navigate to your project folder. Select everything inside of it EXCEPT the .esp file.

BAINTut9.jpg

Drag the selection from there onto the taskbar icon for Archive.exe. When Windows switched to it, drop your cursor in the empty space.

BAINTut10.jpg

If it works you should see something like this:

BAINTut11.jpg

From here, go to File->Save As. It should be displaying your Skyrim Data folder. Give the file a name that matches your .esp file and let it save that in the Data folder.When it's done, you should have a .bsa file in your Data folder to go with your .esp file.

BAINTut12.jpg

You'll also notice a .bsl file there. If you're going to upload to Steam Workshop, leave it there for now. If not, that's safe to delete. The game ignores those.

Congratulations! You've now packaged a working BSA file for you mod without having to trip over the CK doing it!

As you make edits and additions to your mod, don't forget to keep your project folder in BAIN up to date as well. Wrye Bash can detect changes in existing files, but it cannot detect when you add new ones to your Data folder.

When in BAIN, you can right click your project, select "Sync From Data" and it will update all of those for you automatically, leaving only the new stuff you need to track down again. Then it's just a matter of repacking your BSA again to update to the mod hosts.

Feel free to post questions or comment on what sort of refinements this needs.

Link to comment
Share on other sites

I had this posted on the blog too, but I guess nobody visits there :P

Link to comment
Share on other sites

Actually, I did see it on the blog. I'm glad you are doing this. Might also want to post it as a tutorial on DC.

Link to comment
Share on other sites

  • 2 years later...
  • 6 months later...

Excellent tutorial to keep everything neat and tidy. But.... just to be clear..

 

Your "project" LAL in BAIN is a green box with a cross. When I create my project, its a pink box with no cross. I'm assuming that's because you've actually INSTALLED your mod and I haven't yet?

 

So really, at the end of this tutorial, I should go back into BAIN and install it properly?

Link to comment
Share on other sites

Yes, that means BAIN isn't seeing it as "installed" even if the files are present. Usually it's because of some missing piece so I usually just tell it to "install missing" and that fixes everything right up.

Link to comment
Share on other sites

  • 1 year later...

Sorry for the wakeup, but I'm trying the method with the new SSE Archive.exe, except the program crashes while attempting to save to BSA.

 

EDIT: Nevermind, it's working -- I had to move the files to a directory without special characters in its name. More likely due to that Archive.exe doesn't accept punctuations or symbols.

Link to comment
Share on other sites

  • 10 months later...

I thought to share what I do when I need to create a folder in the Bash Installers folder. 

On 2012-06-12 at 12:38 AM, Arthmoor said:

In the Bash Installers folder, create a new folder with the name of your mod.In this new folder, create the subfolders you'll need. Usually meshes, textures, sound, scripts, etc.

There is two ways I can do this;  1) Extract an archive as a project in WB,  2) In WinRAR I often use a "Extract an archive as a <archive name=folder name> folder" command (IIRC can be used in any archiver tool e.g 7zip, WinZip etc).

Link to comment
Share on other sites

If you're starting off with someone else's archive, sure, you can do it that way. This tutorial is designed for people who are creating new mods which won't have preexisting archives to draw from.

Link to comment
Share on other sites

Another thing I think that needs to be mentioned is that some modders are still packing their mods with the following file structure, which are NOT correct for BAIN in WB and any archive that has a similar file structure will be greyed out in BAIN.

 

1st level - <name of the archive.***>

2nd level - Data

3rd level - all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

Link to comment
Share on other sites

  • 3 months later...

 

On 27/09/2017 at 2:12 PM, Leonardo said:

Another thing I think that needs to be mentioned is that some modders are still packing their mods with the following file structure, which are NOT correct for BAIN in WB and any archive that has a similar file structure will be greyed out in BAIN.

 

1st level - <name of the archive.***>

2nd level - Data

3rd level - all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

Actually I think WB is now handling most of those archives correctly, at least the fork I'm using (latest dev at the time I downloaded, some two weeks ago).

I just tested this with "EotW The Dawnguard-69101-1-0.rar" which is the archive from Echthelion's dawnguard retexture mod. It contains the following folder structure:

1st level - EotW The Dawnguard - Textures Re-mastered

2nd level - Data

3rd level - textures

and so forth.

WB does handle it, it doesn't appear greyed out and installs correctly. But another mod by the same author, packed as "EcthelionOtW Mage Equipment Overhaul.rar" has an even more wicked folder structure with a "EcthelionOtW Mage Equipment Overhaul - All in One" folder nested inside another "EcthelionOtW Mage Equipment Overhaul - All in One" folder and then a data folder and all the necessary stuff therein. THAT was too much for WB to chew ;)

I'm not sure but since the earliest WB build I've used is the one currently downloadable at nexusmods (307 beta 2) and I do remember having the same issue as you reported, it should have been addressed since and, therefore, not in the version most people are likely using.

Link to comment
Share on other sites

I tried this for the recent "The Shire Mod" which has a huge archive of loose files (3.6Gb or over 6Gb when unpacked) which WB seemingly can't handle (I get out of memory errors). So I tried to pack the assets into a bsa but archive.exe also can't chew it... It hangs with the progress bar at about 40% and the bottom line reads "Renaming temporary archive." No error message, it just hangs there and the Archive.exe process appears to be running in task manager, although with minimal memory and no disk or CPU usage.

Should this be related with actual memory issues, or maybe my temporary folder has some nasty file access restrictions?

Link to comment
Share on other sites

On 9/27/2017 at 2:12 PM, Leonardo said:

Another thing I think that needs to be mentioned is that some modders are still packing their mods with the following file structure, which are NOT correct for BAIN in WB and any archive that has a similar file structure will be greyed out in BAIN.

 

1st level - <name of the archive.***>

2nd level - Data

3rd level - all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

 

The format you describe there has always been supported by Wrye Bash, that is what is known as a Complex / Simple BAIN

 

Simple Bain =

1st level - <name of the archive.***>

2nd level (Root, or Top-Level) - all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

The 2nd Level in the above example is known in the Wrye Bash documentation as the Top, or Root level within the compressed archive (ie when you double click a Zip, and the Archiver opens it, you are looking at the contents of the Root of the archive .. Typically in a Complex Installer which has a wizard.txt script file, the wizard would be in the root of the archive)

Have a look at the Wrye Bash Documenatation here http://wrye-bash.github.io/docs/Wrye Bash General Readme.html#bain-structure

Scroll down a bit to the Boxes that have the description for Simple, Complex, Complex / Simple

 

Complex / Simple =

1st level - <name of the archive.***>

2nd level - Data\

3rd level (inside Data\) - all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

Complex Bain =

1st level - <name of the archive.***>

2nd level - Data1\

2nd Level - Data2\

2nd Level - Data3\

3rd level (Inside Data1\)- all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

3rd level (Inside Data2\)- all necessary or optional replacers for Data1 folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

3rd level (Inside Data3\)- all necessary or optional replacers for Data1 or Data2 folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

What has not been allowed previously (but is now allowed in the latest Wrye Bash) was a Complex BAIN (or Complex / Simple Bain) which was one folder too deep, which people usually create when using Archivers, or making fomods (and which other mod managers just accepted because far too many people made the same mistake, hence why Wrye Bash has now changed to accommodate them aswell)

So a Complex / Simple Bain one folder too deep used to look like this =

1st level - <name of the archive.***>

2nd level - Mymodname\

3rd Level - Data\

4th level (inside Data\) - all necessary folders and files e.g meshes, textures, <mod name>.esm/esp, mod - readme

 

.. But is now accepted by the latest version of Wrye Bash, as will be any Complex Bain which is also constructed one folder too deep.

 

A Simple Bain could never be made one folder too deep, because Wrye Bash would just consider it to be a Complex / Simple Bain.

 

How deep can a too deep folder structure go for Wrye Bash these days ? .. I dont know to be honest, I am pretty sure Utumno just made it allow one folder too deep, but the other restriction would be the 256 character path name restriction on path lengths (which is an operating system restriction).

Anyone has any issues with newer version of Wrye Bash and its new abilities in this regard do not make sense for some reason .. Please bring it up in the Wrye Bash Dev topic.

Link to comment
Share on other sites

1 hour ago, godescalcus said:

I tried this for the recent "The Shire Mod" which has a huge archive of loose files (3.6Gb or over 6Gb when unpacked) which WB seemingly can't handle (I get out of memory errors). So I tried to pack the assets into a bsa but archive.exe also can't chew it... It hangs with the progress bar at about 40% and the bottom line reads "Renaming temporary archive." No error message, it just hangs there and the Archive.exe process appears to be running in task manager, although with minimal memory and no disk or CPU usage.

Should this be related with actual memory issues, or maybe my temporary folder has some nasty file access restrictions?

I'm also reporting my progress with this mod in the WB topic, because I'm not being able to install it. Thus my trying to archive the assets as a bsa file. As I mentioned above, Archive.exe froze while trying to crunch 45k files (almost 10Gb of data). So now I'm trying to make two archives, one containing only the textures (which alone represent 6.5Gb and can't be further optimized without lossy compression, I tried DDSOpt with lossless and 8kx8k constraints and couldn't take more than 5% off the total size) and the other containing the rest of the assets.

One archive will be called he textures bsa will be called TheBawbsShire.bsa (same as the original mod's esp) and the other will be called something like TheBawbsShire - Textures.bsa. How can I make a dummy TheBawbsShire - Textures.esp just to load the archive?

Edit: can't even finish the textures bsa. Here's a picture about 10 minutes after the progress bar was full.

Edit2: Forget the above. The bsa saved and I unpacked it and all the files were there, archive.exe simply "forgot" to display some message stating that it had run successfully to completion. Duh - So how can I make the dummy esp to load it?

Link to comment
Share on other sites

  • 2 months later...

Very helpful! Thanks for posting this. I learned in 5 minutes what would have taken a whole lot of trial and error to figure out on my own, about both WB's projects feature and how to use Archive.exe.  I had no idea how to [re]build a Skyrim BSA until now (though I could do it with third-party tools in Oblivion already).

One tidbit worth mentioning: Archive.exe has confusing "user-hateful" behavior: During the BSA build process it may just show an incomplete progress bar as if the app has hung, when in reality it's simply finished.  I ended up going to bed and hoping it would finish what it was doing, and still found it in same state the next day.  Closed it, trashed the presumably broken BSA, and re-did it, only to have the same thing happened.  So I moved all the original file folders to TEMP/ and then used a BSA extractor to dump a copy from the new BSA to TEMP2/, then checked Properties on each temp folder and they're identical, so the BSA creation actually works fine. It just looks like it's hung. :-)

Now, if I could just get MergePlugins to work ...

Link to comment
Share on other sites

You'd be better off learning how to handle setting the ESL flag on a .esp file if you think you need to merge stuff. What Bash can merge is one thing, but the ESL flagging opens up a whole new world if you do it right.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...