Jump to content

Extracting All Scripts Or Their Referenced Formids From An .esp


Odessa

Recommended Posts

I want to extract a list of all the references and forms inside the scripts contained in an .esp or .esm file.

 

Example:

Begin GameMode
 
    SunnyREF.AddItem Vodka 1
 
End

Would extract 'SunnyREF' and 'Vodka'. Just their formIDs, or just getting the full text of the scripts is fine.

 

TES5Dump does not seem to have an option for this.

 

Does anyone know of a way?

Link to comment

believe this is used with fomm. hope it helps, as i am not that good with these things. but i believe the games should be similar enough for this to get you going in the right direction.

 

 

Oblivion - Export all scripts in xml format.pas

 

 

 

 

{
  Export SCPT records to XML file (for Oblivion, Fallout 3 and New Vegas)
}
unit UserScript;

var
  sl: TStringList;

function Initialize: integer;
begin
  sl := TStringList.Create;
  sl.Add('<?xml version="1.0" encoding="Windows-1252"?>');
  sl.Add('<scripts>');
  AddMessage('Building scripts list, please wait');
end;

function Process(e: IInterface): integer;
begin
  if Signature(e) <> 'SCPT' then Exit;
  sl.Add(Format('<script formid="%s" edid="%s" plugin="%s"><source><![CDATA[%s]]></source></script>', [
    IntToHex(GetLoadOrderFormID(e), 8),
    GetElementEditValues(e, 'EDID'),
    GetFileName(GetFile(e)),
    GetElementEditValues(e, 'SCTX')
  ]));
end;

function Finalize: integer;
var
  dlgSave: TSaveDialog;
begin
  sl.Add('</scripts>');
  dlgSave := TSaveDialog.Create(nil);
  dlgSave.Options := dlgSave.Options + [ofOverwritePrompt];
  dlgSave.Filter := 'XML files (*.xml)|*.xml';
  dlgSave.InitialDir := DataPath;
  dlgSave.FileName := 'scripts.xml';
  if dlgSave.Execute then begin
    AddMessage('Saving ' + dlgSave.FileName);
    sl.SaveToFile(dlgSave.FileName);
  end;
  dlgSave.Free;
  sl.Free;
end;

end.

 

 

 

Link to comment

You run it on the mod via FNVEdit 'Apply Script', and it saves a single .xml file with all of the mod's contained scripts in it.

 

I can then write a little Python program to scan that data and an FNVDump for the mod against my database of known problem forms/refs and immediately know if a mod will have issues for people with a different game localization.

Link to comment
  • 1 month later...
Guest carywinton

Now you are getting somewhere Odessa, well done! Kudos to you for your continued work on this. I have not received any contact back from some of my Far Eastern Brothers and Sisters to get you a "dump" from their languages. This would be invaluable to me because I run mods and work on mods from all over the globe, I just recently ran into problems with a French Developer and their work not behaving well in an "English" environment.

 

I am also fairly certain Bethesda knew about all of this, yet did nothing.

Kind Regards,

CaryWinton.

Link to comment

I have the full (..or at least sufficiently comprehensive, I think) info from English/Italian comparison. Partial info from a German version suggests the problem formIDs are the same as in the Italian, although I wouldn't be surprised if Asian versions differ from European.

 

I wrote a python program that found the problem IDs in one of my mods, but I haven't gotten around to uploading a general version of it that anyone could easily use. If someone bugs me about that, I might be quicker ;).

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use