Oblivion ESM/ESP Script Dumper

From Oblivion Mod Wiki

Jump to: navigation, search
Author: MofoMojo
Version: 2.8
Last Updated: May 2nd, 2006
Requires: .net Framework 2.0
Download(s): The Elder Scrolls Database

[edit] Description

This application takes an ESM or ESP file and extracts/dumps all of the scripts in it to a \esmfilenameScripts directory in the location where the application is running. So, if the app is run against the oblivion.esm the scripts will be dumped to the \OblivionScripts directory. It then creates an Index of functions and commands with hyperlinks to the script files.

Also supports Drag n Drop. Drag an ESM or ESP onto the OBScriptDumper.exe file and it will automatically parse, create indexes, and dump the scripts in HTML format.

[edit] Usage

OBScriptDumper.EXE <filename> [options]

[edit] Options

-nohtml Disables generation of .HTM formatted scripts -text Enables generation of .TXT scripts -noindex Disables generation of the index files -nowiki Disables linking to wiki WITHIN scripts -parsecomments Parses comments ";" for the occurrence of values -dumpunused Dumps all known functions/commands in the settings.xml file to the indexes instead of just those that occur in the scripts

[edit] Notes

The script dumper should be able to extract scripts from any ESP or ESM file. If you find one that doesn't work please contact me @ the elderscrolls.com forums.

The dumper now uses a settings.xml file which MUST be in the same directory as the OBScriptDumper.exe. The file can be modified to suit your own needs.

A typical entry looks like the following:

<entry location="script" class="Commands" type="general" url="" wiki="true">OnTriggerMob</entry>

location: This tells OBScriptDumper to look specifically in scripts for the occurrence of a word. In this case, OnTriggerMob. For now, all locations must be set to "script".

url: Not used, but this will eventually be implemented to link occurrences of an entry to a different url.

class: Indicates what index the value, if found, should be added under. You can make up your own.

type: Not used, but this will eventually allow an index to group entries with the same type together.

wiki: if true, this will create a hyperlink to the wiki site, for any occurrence of the entry in a script.

I have added several sample entries to show the extensible nature of the settings.xml. One will create an Index-spells.htm which contains a list of any scripts that have the spell Vampirism50 reference. The other two are values, such as GameDay and GameHour will be found in a Index-values.htm file one with wiki links and one without.

Thanks to Grundulum of the elderscrolls.com forums for providing suggestions on fixing the false positive bug, and the idea that lead me to building the index files.

[edit] Changes

[edit] Version 2.8

  • System now checks to see if a stylesheet is in the exported scripts directory. If one doesn't exist, and there is a stylesheet.css in the application directory where obscriptdumper.exe is located, the system will copy it to the exported scripts directory.
  • Moved scripts into a subdirectory below the <module>Scripts\ directory
  • This will likely be the last one for some time...I have moved on to another Oblivion related project and this really addresses most of what it was originally envisioned to do.

[edit] Version 2.7

  • Added Stylesheet support. You must copy the stylesheet.css file into the proper scripts directory, manually, for this to work.
  • Modify the stylesheet to your hearts content :)
  • Added even more variables, functions, skills as retrieved from oblivion.exe

[edit] Version 2.6

  • Updated settings.xml to include other known functions, global variables, stats and skills.
  • Resolved another minor parsing bug.

[edit] Version 2.5

More false negative bugs where hyperlinks weren't occurring properly. Restructured the way the HTML formatting was occurring which introduced the bug when I started checking for commented code

[edit] Version 2.4

Fixed a bug where values that were after comments that occurred after a statement weren't ignored.

[edit] Version 2.3

Fixed a bug introduced with the rewrite of parsing to capture comments where some values weren't being properly parsed in lines where they occurred by themselves.

[edit] Version 2.2

  • Links to wiki within scripts automatically. Replaced -usewiki parameter with -nowiki
  • Now it disregards finding values that are in commented lines unless the -parsecomments parameter is used. One caveat to this is that the line must begin with either a ; or spaces/tabs that lead up to the comment. Coments that begin at the end of a statement (if that's even possible in CS) will still be parsed. Thanks to Tegid on elderscrolls.com for this suggestion.

[edit] Version 2.1

While on vacation, I noticed that the linkage for the Index files in the header of each index was bad. Fixed link generation.

[edit] Version 2.0

Completely re-written for XML supported settings file support and extended hyperlinking.

[edit] Version 1.2

Found more false negatives due to case-sensitivity. This issue has been resolved.

[edit] Version 1.1

Removed fix for false positives since false negatives were introduced (should have done more testing)

[edit] Version 1.0

Fixed false positives from the command and function collecting. This bug has been squashed so long as there are no false negatives. <G>. Because all known bugs have been squashed and the application does exactly what I set out to do, changing version to 1.0

[edit] Version .04

  • Introduces dumping of commands as well as functions.
  • Introduces HTML links of all function/command names at the top with bookmarks to their location in the page.
  • Introduces a count value beside each function/command which displays the number of scripts that use it
  • Introduces -dumpunused option. This will create a dump of all commands/functions regardless of whether they are used or not.

[edit] Version .03

  • Fixed hang with oblivion.esm at BeefTest script. Basically, if it reaches this script in stops doing any further processing. It's a hack.
  • Added HTML generation of function index. This creates a hyperlinked index to the script files.
  • Added NoIndex option to disable generating function index, although it only takes 1 extra second to generate an index.

[edit] Version .02

Now creates a FunctionIndex.txt file which creates a sorted index of all functions that are used by the scripts that are exported. Only the functions used are listed, and below each function name is the list of scripts that use that function.

[edit] TODO

Allow default settings to be added to the settings.xml file. Create a Master Index with hyperlinks to each of the Indexes. I'd like to extend this to include parsing out details about gamesettings, and other scripts. This way, if someone wants to see what's changed in an ESP file, they'll be able to do so.

[edit] Known Bugs

None known at this time, though messing up the formatting of the XML or leaving out something might cause problems. I have not tested.

Personal tools

Toolbox