Tes4Mod:BAIN Tutorials

Added randomly...


:''Note: Make use of the local ReadMe, accessible through the   icon in the bottom-right corner of Bash's window.''

Initialize and Configure BAIN

Summary: This tutorial is simply a screenshot-aided set of instructions for initializing and configuring BAIN.

If you want to specify the directory for which BAIN tracks packages...

# Close Bash (if it is open.)
# Copy and rename the   to  . Image:bain_configure_01_c.jpg
# Open the newly-created bash.ini.
# Find the line for 'sOblivionMods', which, by default, points to the directory containing the Oblivion folder (meaning that Oblivion Mods would be created in the same directory as the Oblivion install folder.) Image:bain_configure_02_c.jpg
# For the sake of convenience, create a shortcut pointing to the Bash Installers folder (in Oblivion Mods) which will make it more easiliy accessible when browsing to it from various dialog windows (i.e., the dialog for saving a download) and the Desktop is one of the most accessible locations for the shortcut.
# If BAIN was previously enabled, you can safely merge the two, by copying the contents of your old Oblivion Mods folder into the new one.

"If BAIN is not enabled...

# Launch Wrye Bash.
# Click on the Installers tab in order to initialize BAIN. (If this is the first time this tab has been accessed, Bash should prompt you to to initialize BAIN.) Image:bain_init_00_c.jpg
# In the Installers tab, right-click on the Packages tab, bringing up a context menu containing a number of options for configuring BAIN. Image:bain_configure_00_c.jpg

Package Context Menu Options

#* Sort by Active - groups packages by install/active state
#** This option may be useful when many packages are installed, but activating it while getting used to BAIN may cause confusion as you try to organize packages.
#* (recommended) Projects First - sorts projects (non-compressed folders) at the top
#** Since projects tend to be collections of files that you frequently update or, even more often, mods that have been recently downloaded that you are in the process of repackaging, having these packages sorted first would probably be convenient in many cases.
#* Open... - opens the Bash Installers directory
#** If you are unsure about what folder BAIN has actually detected as the Oblivion Mods directory, this command can show you.
#* Refresh Data - force BAIN to rescan the Data folder
#** This function is useful if you make changes to the Data folder outside of BAIN. If the change actually pertains only to a specific package (or group of packages) right-clicking on the package and choosing 'Refresh' may suffice and will certainly save resources (such as time.)
#* Full Refresh - force BAIN to refresh the states of all packages and rescan the Data folder
#* Add Marker... - add a marker (to help organize packages in the Installers tab)
#* Anneal All - anneals the installation of all packages
#* Unhide... - unhide hidden packages
#** Hidden packages are stored in Oblivion Mods/Bash Mod Data/Hidden.
#* (recommended) Avoid at Startup - prevents BAIN from initializing with Bash
#* (required) Enabled - enables BAIN
#* Show Replacers Tab - shows the Replacers tab (see ReadMe via Bash's help icon for details)
#* (recommended) Auto-Anneal - automatically anneals installed packages (as relevant changes are made to other packages)
#* Auto-Anneal/Install Wizards - after running a wizard the respective package is annealed or installed
#* (recommended) Auto-Refresh Projects - automatically refreshes projects
#* (recommended) BSA Redirection - implements the archive invalidation method BSA redirection
#** This does exactly the same thing as ArchiveInvalidation Invalidated! and OBMM's equivalent. Use only one at a time.
#** The advantage of using OBMM's or BAIN's over ArchiveInvalidation Invalidated! is that OBMM and BAIN will automatically reregister the BSA if they detect that the redirection BSA is no longer present (i.e., in the event the Oblivion.ini is regenerated.)
#* (recommended) Clean Data Directory - makes BAIN clean up empty directories
#** OBMM leaves empty data folders after uninstallation. BAIN would function similarly were this option disabled.
#* Show Inactive Conflicts - show conflicts among uninstalled packages configurations
#** This feature makes initialization and refreshing a bit more resource intensive, but it is very helpful while trying to estabilish a modified setup with BAIN, in which case it is nice to see conflicts before installing anything.
#* Show Lower Conflicts - show conflicts with lower-priority mods
#** Yes, a higher priority mod will overwrite everything in a lower priority mod where the two overlap, but it may be useful to know what those overlaps are. Especially if you are not very familiar with your package list, it is hard to efficiently organize packages without knowing what overlaps are in higher priority and lower priority mods. That knowledge aids in determining which packages should be given higher priority and vice versa.
#* Skip Screenshots - skip files in "Screenshots" (same level as "Textures", "Meshes", "Docs" etc.) folders
#* Skip Images - skip image files (i.e., JPEG, BMP, etc.)
#* Skip Docs - skip files in "Docs" (same level as "Textures", "Menus", etc.)
#** BAIN sweeps top-level doc-type files (i.e., DOC, RTF, PDF, TXT) into Docs automatically, so those would also be skipped.
#* Skip DistantLOD - ignore DistantLOD files
#*:''Note: TES4LODGen users should enable this option, since the files generated by that utility are based upon all plugins in your load order as opposed to those packaged with mods that will normally only reflect that mod's data.

Add a Package to the Installers Tab


Summary: This tutorial is a screenshot-aided set of instructions for adding an archive to BAIN. The mod used as the primary example in this guide is the Unofficial Oblivion Patch v3.2.0. Also, see the Choosing from Multiple Downloads for tips on which version of file BAIN users should download when given multiple download options.

Download the UOP and Supplemental

# Download the manual install version of Unofficial Oblivion Patch (UOP) v3.2.0 to the Bash Installers folder.
#:Note: The manual version is a BAIN-friendly package because it is a simple archive, only containing some docs, a plugin and data files, all at the same (the top) level.''
# Download the Unofficial Oblivion Patch Supplemental to the Bash Installers folder.

If you have UOP v3.2.0 and the UOP Supplemental packed into OMODs...

# Launch OBMM.
# Right-click on the UOP v3.2.0 OMOD and choose convert to archive. Image:obmm_convert_to_archive_00_c.jpg
# Save the archive to the Bash Installers folder. (Keeping the conversion data does not matter.)
# Repeat the three above steps for the UOP Supplemental.

If have UOP v3.2.0 (manual) and the UOP Supplemental downloaded already...

# Move the UOP v3.2.0 archive and the UOP supplemental archive into the Bash Installers folder.

Sort the UOP and Supplemental in Installers

# Launch Wrye Bash.
# Click on the Installers tab. Image:bain_init_00_c.jpg
# BAIN will detect and place the two newly-added archives above the Last marker (if your packages are sorted by ascending order.) Image:bain_last_marker_00.jpg
# Make sure your packages are sorted by Order (by clicking on the 'Order' column header if necessary.)
# Sort the two packages such that the UOP Supplemental has a higher order than the UOP v3.2.0 archive. (If your packages are sorted in ascending order, increasing downward, the UOP Supplemental needs to be lower.) There are three methods by which you can move packages:
#* Right-click on a package (or group of packages), choose 'Move to', and enter a new position number.
#* Select a package (or group of packages), hold CTRL and use the up and down arrow keys to move the package(s).
#* Click an drag package(s) in the package list to new positions. 
#*:Note: If you place packages below the Last marker, they will not be mixed up with newly-added packages, nor will they be overwritten by packages with an order lower than the Last marker (which is the case for all newly-added packages.) This is very useful for those that maintain an organized package list.
# If you have an extensive package list and have trouble finding a package from time to time, just click on the Package column header to sort package alphabetically.

Repackage for BAIN

Summary: This tutorial is illustrates how to go about repackaging archives in a BAIN-friendly format by walking through a repackage of Harvest Flora (HF) v3.0.1. It has a variable configuration, but it is still relatively simple.

Analyze Harvest Flora's Original Structure in BAIN

After putting Harvest Flora in the Installers folder...

# Locate the original HF ZIP in the Installers tab just above the Last marker (unless you already had in the Installers folder or it was no the most recently added archive.)Image:bain_harvest_flora_added.jpg
# The first step of adding a package to BAIN (if you intend to use it) is to analyze the state of the package. The first level of analysis is simply to look at the color of the checkbox and the package highlight. Observe that the original Harvest Flora archive has a red checkbox and grey highlight. That probably does not mean much to new user, so here is a quick summary of the physical identifiers:
#* square check box - package (archive)
#* diamond check box - project (directory)
#* empty check box - uninstalled
#* "+" check - installed
#* "x" check - invalid file (archive)
#* red check box - some files configured to be installed are not installed>> note: Red is not an alarm. Docs at the top level of a package always meet this requirement (unless yout tell BAIN to skip Docs.) Therefore, most uninstalled packages have share this indicator.
#* green check box - all configured files are installed, and all installed versions of the files match
#* yellow check box - all configured files are installed, but some of the installed files do not match those in the package's configuration
#** The package's mismatched files are listed "Mismatched" tab. You can then figure out why by looking in Conflicts (with the relevant settings enabled) if another package is responsible for the override or underride.
#* orange check box - all configured files are installed, but some of the installed plugins (and possible data files) do not match
#** This coloration is incurred when another installed package overwrites the plugin or the user tweaks the plugin in some way. In the latter case, BAIN semi-disowns the file. Therefore, if you accidentally uninstall the package before backing up your tweaked plugin, your tweaked plugin will not be lost.
#** his indicator has priority over mismatched files (yellow).
#* dark grey check box - not a BAIN friendly file (which is fine for markers such as Last because they are not real files)
#** These files have to be restructured in a BAIN-friendly format in order to be installed by BAIN.
#* white check box - no files configured for installation 
#*:''Note: Only BAIN-Ready packages with all docs in subpackages or simple packages where all contained files are skipped by BAIN's settings can meet the criteria for this indicator.
#* grayed text - invalid file (nothing to be installed contained in the file)
#* blue text - BAIN-Ready package
#* black text - simple package
#* grey highlight - package contains skipped (not ignored) files 
#*:Note: 1) Ignored files have no indicator. 2) Skipped files are either of files types BAIN does not install or files that make the BAIN-friendly structure of the package inconsistent.''
#* orange highlight - dirty install (package needs to be annealed)
#** If an installed package is modified such that any of the configured files do not match the installed files, the install is considered "dirty", as the configuration no longer represents the package's install. Of course, the package might only be "altered" in BAIN's view if the user, for example, has actually overwritten the old package with a new one (i.e., an updated version.) Just remember to use 'Anneal'.
#* yellow highlight - underriden files (a higher order packages install config contains files that "should" override files in this package) or the package is not completely uninstalled>> note: Underriden files in an install are either from a higher order package being moved to a higher position after already it was installed (in a lower order position) or because the user did not want the higher order package to overwrite this package entirely and only chose to 'Install Missing' instead of a regular, full install. Taking the latter action is nice when you want to keep your texture replacers sorted semi-alphabetically, while maintaining a certain overall configuration.
#* files beginning and ending with "==" - markers (for organizational purposes)
#** "Last" is a special marker, being the marker after which newly-added files are placed.
# Looking at the Harvest Flora archive again: It has a red check box because it has configured files (as listed in the "General" tab of the package.) BAIN is treating as a simple package, without subpackages, but BAIN has also highlighted with light grey, indicating skipped files.Image:bain_harvest_flora_skipped.jpg
# Technically, for some, HF might be quite usable in this state; however, if you want the option of using the alternate NoMushroomStalks meshes or simply do not like having grey-highlighted packages, a repackage is in order.

Repackage Harvest Flora into a BAIN-Ready Archive

In order to repackage Harvest Flora...

# Right-click on the Package column header, and choose 'Open...' to open the Installers folder. Image:bain_harvest_flora_open.jpg
# Locate and right-click on the archive to extract the contents to a folder of the corresponding name. Image:bain_harvest_flora_extract.jpg
# Looking at the archive, the source of BAIN's confusion are the two levels of install-ready files. The BSA and plugins are top-level files at the top level of the archive, but the Meshes folder in the "NoMushroomStalks" subfolder is also a top-level folder. For BAIN, either the whole archive needs to be install-ready or the package needs to be split into install-ready subpackages. Image:bain_harvest_flora_extracted.jpg
# After determining what the problem is with the current structure, a new structure has to be decided upon. That decision relies largely on making a design that would enable the user to achieve all desired install configurations. For Harvest Flora, that at least means makingn the alternate meshes an option, and this requires subpackages. The plugins can be checked or unchecked freely, but subfolders (i.e., Meshes) cannot. How would that be manageable if the core files were loose in their own Meshes folder, instead of being packaged in a BSA? It would not even be possible to keep the two Meshes folders separate.
# BAIN-ready (subpackage-split) packages can be as complex as you want to make them, but having fewer subpackages is sometimes nicer. For simplicity's sake, just copy the plugins and the BSA into a new folder named "Core Files", give HF two install-ready subpackages in addition to a couple of docs. Image:bain_harvest_flora_new.jpg 
#:''Note: After destroying the original structure the omod's script will not work. It can be deleted, but BAIN will ignore the folder anyway (if you wish to keep it around for some reason.)''
# Back in the Installers tab, you can see the project now with two subpackages and no skipped files, as indicated by the lack of highlight. Image:bain_harvest_flora_project_00.jpg Image:bain_harvest_flora_project_01.jpg
# Pack the project into an archive by either right-clicking on the project in the Installers tab and choosing 'Pack to Archive' or highlighting the contents in explorer and using 7-zip to pack the contents to " ". Image:bain_harvest_flora_pack_installers.jpg Image:bain_harvest_flora_pack_7-zip.jpg
#* Using the latter method is often convenient, especially when you do not need to open BAIN.
#* If there were only one file in the HF folder, that 7-zip option would instead be 'Add to " ".7z', which is often not a desirable name. In that case, use 'Add to archive...' and give the archive a more helpful name.

Correct and Refine the HF BAIN-Ready Archive
That was an okay first attempt, but...

# If you are familiar with Harvest Flora (or you read the ReadMe) you would have learned that the optional plugins actually depend on the main plugin. A common installation mistake is to install the SI version of something when it is not stand alone or to install a stand-alone version that either does not require the Cyrodiil version or contains the Cyrodiil changes as well. Read mods' ReadMes to avoid such mistakes, and you can futher help yourself by packaging your BAIN archives in a way that tells you some of that information.Image:bain_harvest_flora_dependencies.jpg
# A common naming scheme is to use "Core Files" to indicate required base files. Another common scheme is to use prepended numbers to order the packages, giving the packager free rein with the subpackage names. Therefore, a more comprehensive repackage would have the optional plugins in a separate subpackage and only the required files in the Core Files folder. Image:bain_harvest_flora_project_final.jpg
#* More complex packages use the indices to group related packages, and still more complex packages (i.e., AWLS) will use the inner digit to describe relations. For example, in AWLS the packages with tens digit "1" belong to the QTP3 (base) group. Within a group, the subpackage with inner digit "0" is the base, and the subpackages within that group with higher (innder) digits may or may not be required. In the QTP3 group, 10 and one 11 are required.
#* In general, if packages have the same index and the same naming shema (i.e., QTP3 - XX), they should be used exclusively.Image:bain_awls_qtp3.jpg
# The other helpful practice illustrated with these repackages are that the main docs for the mod are at the top. For a BAIN-Ready archive, this allows the user to install the package to gain access to the documention without installing other files. If you wanted to make a subpackage for the documentation, which is nice when compilation mods include docs for included components (as Better Cities does) they have to be put into a folder labeled "Docs". The Docs folder is a top-level folder, so it would have to be put inside a subpackage if the mod archive is not a simple package. If the documentation is not at the top level of a BAIN-Ready package, the user would have to install the entire subpackage that contains the files.
Image:bain_harvest_flora_no_docs.jpg
#* BAIN also recognizes Screenshots as a top-level folder.
#* Also, take advantage of the Comments frame to add reminders for yourself about various aspects of the mod or favorite configurations, etc.
# Now, go ahead and sort and configure and install (if you want) your BAIN-ready package. As your list grows you may want to spend time thinking about the overall organization of the package list. (Some on-site references are Mod Installation and My BAIN Package List.)

How to Apply a BCF for Harvest Flora (easy)

Of course, all of the above repackaging work has already been done already, and those restructuring instructions for BAIN have been conveniently uploaded on this site. If you downloaded the BCF (which stands for "BAIN Conversion File") for HF v3.0.1 from BCF and OMOD Info Downloads to the Bash Converters folder (sub to Bash Installers) and applied it to the original archive BAIN would use the contained instructions to repackage Harvest Flora for BAIN. Keep in mind that BCFs can only be applied to the exact contents for which they were made. BAIN identifies files by CRC data (which is shown for each package in the General tab.) The name and the compression format do not matter, only the contents are relevant...

Image:bain_harvest_flora_bcf_converters.jpgImage:bain_harvest_flora_bcf_apply.jpg

See Also
BAIN Installation
Wrye Bash
BCF and OMOD Info Downloads
External Links
alt3rn1ty's Wrye Bash Pictorial Guide for Newbies --The unofficial official guide to using Wrye Bash
Wrye Bash Project Page and ReadMe
BAIN Mod Installation Projects - BethSoft Mod Forum <-- written by Psymon
BAIN Mods - TESNexus <-- a few BAIN-converted mods uploaded by the monkey god himself
BAIN vs. OBMM - UESPWiki
I Need Help! - BethSoft thread <-- much explicit help with BAIN here
Martigen's Monster Mod + OOO? - BethSoft thread <-- MMMforOOO setup with BAIN