Update! The reason for this update is that I felt we needed something like that, in the Dev of TLD (you know, the Lord of The Ring module).
From the 1st page...
ver 0.0.45 (24 Sept 2010):
- scan the entire module .TXT files (some ten of them) to find out what is actually used in the module (both WB and M&B)
- added "used By" submenu , to navigate from an object (meshes, materials...) to any objects using it
(e.g. from a material to any mesh using it, etc). Find it by right clicking on any object.
- in the same submenu, you can see what TXT file, if any, is using that object (directly or indirectly)
- highlight objects (meshes, materials, ...) which are actually used by the module (F3, or look in Module menu)
(also if an object can be safety removed -- not used by other ob, is lightened)
- warning given when saving common-res files
- Module Menu revamp:
-- command to choose a Brf inside current module (including ones non included in module.ini)
(also shows how many used/unused objects they contain)
-- command to list unreferenced texture-files sitting on disk (e.g. DDS)
-- command to show module statistics
-- added .txt related errors to Error reported by "scan module for errors"
A little more details...:
1- Scanning module txts
Now openbrf will scan (if you ask it) .txts module files to find out what is really used.
Specifically, the scanned files are:
Code:
"actions.txt", "skins.txt", "item_kinds1.txt", "meshes.txt", "map_icons.txt",
"scene_props.txt", "particle_systems.txt", "tableau_materials.txt",
"flora_kinds.txt", "ground_specs.txt", "skyboxes.txt",
that is, anything that contains a mesh, a material, a collision object, a skeleton, etc etc.
In theory that's done both for M&B (ver 1.011 -- last ver) and fro WarBand, but my copy of warband is a little old
so
let me know if it doesn't like it
Warning: if you use Iron Launcher, you know that the last three txt files of that list, and cure_resources, are kept in your mod dir and used only when needed, to substitute hard-coded files. Be sure they are where the games wants them, in order for OpenBRF to find them (not where the Iron Launcher keeps them).
2- Error reporting
Now that OpenBRF knows what is actually required, any missing thing is reported, in the "Scan for Error" dialog (togheter with other internal inconsistencies that were reported also before, like a mesh requiring a non-existing material).
3- Color coding
Also, the item list of the left will be become colorcoded: objects that are actually used have the name displayed in bold and in
dark-blue. The same if the object is used indirectly (e.g. the game uses a mesh, and that mesh uses a material, which uses a shader: that shader is used "indirectly").
On the contrary, objects not used by the module, are displayed in Gray.
Objects that not used by any other object either, are a lighter gray.
To activate the coloring just press F3 (and wait that txt files and all BRF files are scanned).
It is not automatic because, when you don't need that, I wanted to keep the loading very fast.
(btw -- the color coding is active whenever the files have been scanned, for whatever reason)
4- What uses what: "Used By" sub-menu
It is easy to find out why an object has a color: right click on it and check the submenu: "Used By". That shows all other Objects using that object (you can open them by selecting them),
and, in italics, any txt file module file needing that object (in any) -- e.g. you can see the sword is used in the module "items" file.
A good use for that is finding out why you still need a texture that you believed you removed from the game.
Another use is to navigate: go from a Material to any mesh using it, for example.
Another use of that is that you can check that the neat sword mesh you did is actually being used in the mod.
5- Caveats about removing "useless" things
IMPORTANT NOTE: the game scans all objects inside BRF files listed in Module.ini, even if they are not used.
If object A (not used by the module, but listed in module.ini), needs object B (also not used) -- (e.g. a material needing a texture, or a mesh needing a material), and B is removed but A kept, then the game still will not start, complaining about B not being there!
In short: a useless Object that is used by other useless objects, cannot be removed, unless you remove also the objects using it.
Also,
BEWARE: some object (mesh, material) could be used by some hardwired mechanism, so, even if it is shown in gray ("not used"), it is actually needed by the game. For example, I think map materials (e.g. map_ocean, map_plain) are in this category. All objects inside "core_" files are assumed to be used, BTW.
6- Other Options in Module Menu
With
Selet a Brf in Module you can list all module BRFs, and the BRF that are inside module Resource folder but are not listed by module.ini. You can see how many objs are being used inside, e.g. you can identify what "commonRes" stuff you don't need anymore. Clearly clicking of one file opens it.
With another command, you can list "unreferenced" texture files (.dds), i.e. files that are not listed in any BRF files. These files are not loaded by the module, so they don't slow down game loading time, but you want to remove them to slim down your module. Also MadVader module verifier does that, BTW (and much more -- e.g. same for sounds)! But I imagined it would be fine to have that functionality here too.
The "stats" command is useful to doublecheck the global status of the module, and to double check that the txt files were read correctly.