Jump to content
  • 0

How do I create a script to do a custom patch with TES5Edit?


Question

Posted

I looked at the source code for definitions but I don't see any methods to create new records for a patch or import a record from a mod to current patch.

 

Or did I just misse it?

 

Some help on this would be nice since SkyProc doesn't support some of the record types.

 

Thanks.

2 answers to this question

Recommended Posts

  • 0
Posted

TES5Edit does have some useful scripts; I regularly use the one that suggests Wrye Bash bash tags for mods. There is a script for creating a patch between Climates of Tamriel and Sounds of Skyrim that you might be able to use as an example for creating your own script. I've never seen any tutorial descriptions of how to build scripts for TES5Edit; all the ones I know of were created by the TES5Edit development group. You can check in the official thread for TES5Edit, but I've not seen discussion of script building in that thread.

 

For my game I build patches manually. I use a TES5Edit Merge Patch, but that (and the WB bashed patch) only cover a few record types (unlike TES4 and Fallout NV; both the WB bashed patch and FNVedit/TES4Edit Merge Patch cover almost all record types for these games).

 

There has periodically been discussion of building SkyProc patchers that cover the Skyrim record types that the WB bashed patch doesn't, but nothing has emerged yet. You might want to post on the TES5Edit official thread that you are interested in doing this and see what response you get.

  • 0
Posted

Thank you. I still don't know how to add a new record that. I can, however, copy another record as a new record to the file. Then maybe set the form ID and EDID later.

 

This is one of the functions I've got. Comment above a line of space are codes I need help with implementing.

function ProcessCellRecord(e: IInterface): integer;
var
XLCN, XEZN: string; //location and encounter zone element value
newzone: IInterface;
begin
if OverrideCount(e) = 0 then begin
  XLCN := GetElementEditValues(e, 'XLCN');
  XEZN := GetElementEditValues(e, 'XEZN');
  if (XEZN = '') then begin
   if (XLCN <> '') then begin
    npccount := 0;
    CellNPCExists(e);
    if npccount > 0 then begin
     AddMasterIfMissing(Master(e), f_ncz);
     // Element, File, AsNew, DeepCopy
     e := wbCopyElementToFile(e, f_ncz, False, False);
     //check if encounter zone hash set contains word from it's location's name
     XLCN := StringReplace(GetElementEditValues(e, 'FULL - Name'), ' ', '', [rfReplaceAll]);
     XEZN := GetEncounterZone(XLCN);
     if ( XEZN = '') then begin
      //add encounter zone with ref to it's location record
      newzone := wbCopyElementToFile(f_ezn, f_ncz, True, False);
      SetElementEditValues(newzone, 'EDID', Concat(XLCN, 'Zone');
      //add encounter zone to the cell override
      SetElementEditValues(e, 'XEZN', FormID(newzone));
     end
     else begin
     //add that encounter zone directly to the cell
      SetElementEditValues(e, 'XEZN', XEZN);
     end
    end;
   end;
   //else then
     //Add encounter zone without LCN
  end;
end;
end;

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.