=================================================================
TESFILES V3.06, USE AT YOUR OWN RISK!

A tool for packaging all files in a Morrowind Mod, or
uninstalling a Morrowind Mod.  To automate the tedius
work of tracking what files belong to a mod.  Now you
can add files to your working Morrowind area with
abandon, and know that when it's time to package your
work, only those files actually required by the mod
will be included in the released archive.

Note that the stored information in TESFILES for the
system data is Morrowind/Tribunal/Bloodmoon 1.6.1820.
Therefore this should be the working environment of
your Morrowind area.

MentalElf (Barney Blankenship) 4/2/2005
Email: blankensb001@hawaii.rr.com
Web: http://mentalelfz.com

Thanks to the Beta Testers:
Nigedo
ReganInFrance
TommyKhajiit
OverrideB1
=================================================================

INSTRUCTIONS:

Put TESFILES in a directory of your choosing, somewhere you
can get to and want the output of TESFILES to go.  Run
TESFILES.exe, click the FIND button and locate your
Morrowind.ini file, this will more than likely be at:
C:/Program Files/Bethesda Softworks/Morrowind/Morrowind.ini

Left click the mod you want to export/uninstall in the mod
list, so that the "[ ]" becomes "[X]" indicating it is
selected.  Right click any mods you wish to exclude, so that
the "( )" becomes "(e)" indicating it's to be excluded.

Click the MOVE(UNINSTALL) check box if you wish the files to
be erased after they have been copied to the subfolder
package. This is the "uninstall" mode of operation.  Note
that no files are deleted until after all files are copied.

Click EXPORT, and wait for the "EXPORT DONE" message box.

Clicking on NOTEPAD will bring up the message display in
notepad (this is simply the file MODNAME_log.txt).

Open the file manager at the directory that TESFILES is
located.  There will be a subdirectory for the mod
exported/uninstalled.  In that directory is the subdirectory
"Data Files" with all the mod content, as well as
"MODNAME_log.txt" and "MODNAME_error.txt" (this should be
looked at, to verify any problems are inconsequential.

NOTES:

1. You will need to erase package subfolder prior to running
TESFILES and exporting the same mod.  TESFILES will not
update an already existing package subfolder, it will abort.

2. You do not specify the output area... it's wherever
TESFILES was installed to. So I suggest putting TESFILES in
it's own folder somewhere, where there is plenty of room.

3. As a feature, TESFILES lists all keyed doors and
containers in the output window / log file.

4. As a feature TESFILES lists all objects that normally
require an inventory icon that are missing that icon, it
shows as a [WARNING] in the output window / log file and
error file.  Exception: carryable lights will not show
WARNING if they are missing their icon.

5. Another feature, TESFILES will copy/move the file
"MODNAME.txt" as well as the "MODNAME.esm" or "MODNAME.esp"
file.  So make the readme.txt name "MODNAME.txt" instead.
This will also ensure your readme.txt won't get overwritten
by some other mod.

6. Yet another feature, if you click VERBOSE LOG, it will
enable extra debug output to the "MODNAME_log.txt" file.  A
LOT of extra debug output.  This may aid in locating a
problem in the ESP(s) or ESM(s) being excluded or exported
as it includes the byte offset of the location of things
noted in the ESP or ESM file being operated on.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Interpreting the LOG file.
//////////////////////////////////////////

1) If there is a mod name to the left of the info (such as
"[OK] blah blah") then it's a mod being excluded.

2) If there is a "^" before the "[OK]" then the file in
question belongs to the above object.  In addition, graphic
files such as a NIF's texture are enclosed in curly
braces... e.g. {nif_texture.dds}, and inventory icon graphic
files are enclosed in angle brackets e.g. "<icon-file.dds>".
Note that the owning model may be one or more lines above,
depending on how many "^[OK]" files there are.  The owning
object is typically an object with an ID that will be named,
as well as it's ID text and actual file name, e.g.

  [OK] Static ID:"furn_sltw_rg_pitchfork" <Baal/baal_pitchfork.NIF>

...or something that has a in-game name as well (as opposed
to a Static)...

  [OK] Clothing ID:"bonebiter charm" (Bonebiter Charm) <_ig_da_ammy24.nif>


3) [MISSING] indicates the mod object calls out an item that
does not exist.  These generally appear in the error log as
"Cannot find file" errors, but not always (if the file is
being excluded then these [MISSING] files are not marked in
the LOG).  Be sure to check the LOG file, searching for
"[MISSING]" text.

4) General searching information...

   a) Search for "###" to find keys.

   b) Search for "*" to find "Say" operations (typically ".mp3"
   files).

   c) Search for "+" to find "StreamMusic" operations
   (typically ".mp3" files).

   d) Search for "}}}}}}" to find files excluded from the
   mod due to mods marked "(e)" (exclude).

   e) Search for "[WARNING]" to find instances of objects that
   have no icon specified.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Interpreting the ERROR file.
//////////////////////////////////////////

What you will see here are [MISSING], [WARNING], and "Cannot
find file" messsages.  The [MISSING] and "Cannot find file"
go together, just being separated by the different phases of
TESFILES, where it initial looks to see if the file exists
([MISSING] message if it does not) and later when it
attempts to copy the file ("Cannot find file" message here).
Note that "^[MISSING]" with a "^" in front indicates that
you should look in the log file for the owning object.
Again, inventory icon files are indicated with angle
braces...  e.g. "^[MISSING] <Silgrad/QF_toadstool.tga>" and
model textures (NIF included graphics) are indicated by
curly braces... e.g. "^[MISSING] {junk/teddylilac.dds}".
Lastly, [WARNING] messages are for objects that have blank
(unspecified) iventory icons.

_________
MentalElf

---------------------------------------------------
REVISON LOG
---------------------------------------------------
1.04: Added detecting missing icons, discovered
that potion icons were not being seen and therefore
were not being included in the archive!  Fixed.

1.07: MGEF Magical Effect was fixed, in addition,
TESFILES now maintains the upper and lower case
of files, along with deleting empty directories
when uninstalling.

1.08: A bug was fixed where icons needed to
be automatically recognized as dds if the
tga or bmp was not there.

1.09: Made it possible to have Morrowind installed
at the root of a drive.

2.00 460% faster due to optimizing NIF scanning,
supports "Say" and "StreamMusic" script operators
that call out "wav" or "mp3" files, in addition
to supporting Book Art graphic files.

2.01 Added statistics and made the output log
and error files go to the MODNAME subdirectory
with MODNAME file names.

3.00 a) Added "exclude" for excluding a mod from
the packaging or uninstall process.  This makes
the operation take longer, however.  The excluded
files are marked with "}}}}" in the log file.
b) Made certain that a "dds" file, if it exists,
gets used even if a "bmp" or "tga" is called out
in the ESP or ESM.  This is how morrowind works.

3.01 Made "exclude" a bit faster.  Made script
missing end quote not quit the program.

3.02 Made selecting mod left click, selecting
exclude, right click (on mouse).

3.03 Added Verbose checkbox, fixed "mod: ?"
problem.

3.04 Now detects "sound file" for dialog as
a "Say" operation.

3.05 Fixed running an export after already
having run an export, you can run as many
as you like without restarting TESFILES.
Fixed not recognizing BSA (Bethesda) graphic
files due to not substituting .dds suffix
when that was not present on disk.

3.06 Got the mouse wheel working for the mod
select window.  Made all errors NOT exit
the program, either give a message, log output,
or both.  Made "NOTEPAD" button bring up the
help readme instead of causing a script error
before anything is exported.


====================================================
PACKAGING WALK-THROUGH
====================================================
Ok here's a layman's terms how to use TESFILES
to package a mod:

1) Have TESFILES installed in some directory
you know how to get to and has enough room
for the output mod.

2) Go there and make sure there is no subdirectory
of your mod name, if there is, TESFILES will not
overwrite it, it will abort. When TESFILES runs it
will write to and or create the following things:
"MODNAME" subdirectory. This is the name of
the mod you package without the "esm" or "esp"
suffix. In that subdirectoy, "MODNAME_log.txt"
(what you see in the output window)
"MODNAME_error.txt" (any problems... missing
textures, NIFs, what not).

3) Fire up TESFILES, find your Morrowind.ini file.
This little exercise is to locate the directory above
the "Data Files" directory where your "esm" and
"esp" files reside. Click the "FIND" button to
browse to the file. This location is typically
"c:/Program Files/Bethesda Softworks/Morrowind"

4) After "FIND" is used, your "esm" and "esp"
files should appear in the list beneath the
Morrowind.ini path. Select one "esm"
or "esp" file to "package" (extract into a
subdirectory) by clicking on one, "[X]" is
selected for packaging, "[ ]" is NOT selected
for packaging.

5) Prepare for a short wait, this can take
some time depending on how big your "esm"
or "esp" is and how much file data must
be copied or moved.

6) There's nothing that goes to the "output
window" that isn't saved in the log file, so
you DON'T have to watch the output window
the whole time. Just look at it periodically,
looking for the "DONE" message.

7) First thing is to go to the TESFILES
directory area, go into the subdirectory
"MODNAME" and open "MODNAME_error.txt"
in your favorite editor (notepad?).
Look for the text "MISSING" to find
what was considered missing stuff. Look
for the text "WARNING" to find what was
considered an icon missing problem.

Note that at the end of the "MODNAME_log.txt",
all the keyed doors / containers are listed
with their respective keys and cell location.

8) Lastly, create an archive of "Data Files".
This will create an archive that is ready to
be extracted directly to "Morrowind". Note
that in addition to the selected "esm"
or "esp" file being copied in during
packaging, "MODNAME".txt is also copied,
so if you wish to use this feature, make
your "read me" with the name "MODNAME".txt
(such as "armormod.txt" for "armormod.esp").
