BG(2)EE introduced the new PVRZ file format and their associated format variants TIS, MOS and BAM. Unlike with the old and known file formats there is no way to specifically define the names of the associated PVRZ files.
The new TIS format variant requires the PVRZ filenames to consist of the first letter of the TIS filename followed by the four-digits area code (or whatever characters happen to be at those positions) and the optional 'N' character of night tilesets. This restriction can still be handled by the modder without additional help from WeiDU.
The new BAM and MOS files however use an even more restrictive rule to define filenames for the associated PVRZ files. Each MOS/BAM file references PVRZ files that have to be addressed by a decimal number. The resulting PVRZ filename is composed of a fixed prefix 'MOS' and a zero-padded decimal number of at least four digits (although 5 digits are supported as well), which limits the range to 0...99999.
The main problem is how to determine which decimal number is still unused in the user's game installation and update the MOS/BAM accordingly, as other mods or game updates might add PVRZ files on their own. Since you have to prepare the BAM/MOS files beforehand with fixed PVRZ index references, there is no (easy) way to update the files to match the current configuration of the user's game installation.
That's why I request a new WeiDU function that handles all this stuff internally. It should:
- only work in games that support the new PVRZ-based file formats
- work on BAM V2 or MOS V2 files only
- copy a specified BAM or MOS file from source to target
- detect how many PVRZ indices are required
- detect the next (contiguous?) block of free PVRZ indices in the game's installation
- copy and rename the associated PVRZ files from source to target
- update the new PVRZ indices in the BAM or MOS file
- (optionally) providing a way to add more than one search path for source PVRZ files (in case the modder wants to spread the files over different directories)
Since the game developers may provide more PVRZ files in future updates, it might be a good idea to use a minimum index for PVRZ files that is guaranteed not to be used officially.
The next official version of NearInfinity will definitely contain
various conversion routines to create PVRZ-based TIS, MOS and BAM files, so it is likely that modders want to make use of it.
Any thoughts or suggestions?