Jump to content
  • 0
Sign in to follow this  
azzendix

[SSEedit Script] How to skip over record that I'm not interested?

Question

Problem:

I want to reduce script execution time. Is there any way to skip over records that I'm not interested? 

 

Detail:

I want to create SSEedit Script to check old form version(43). I modified "ApplyCustomScriptedFilter.pas" file.

The script is working as intended but it takes a long time to run through all records from ESP files. 

 

Here is the script.(only modified part)

function Filter(e: IInterface): Boolean;
begin
  if (Signature(e) <> 'TES4') or (GetFormVersion(e) <> '43') then 
	Exit;
  
  Result := 1;
end;

Just in case someone want to see it. Here is the original ApplyCustomScriptedFilter.pas file.(in spoiler) 

 

 

 

{
  Apply custom scripted filter for female NPC characters
}
unit ApplyCustomScriptedFilter;

function Filter(e: IInterface): Boolean;
begin
  if Signature(e) <> 'NPC_' then
    Exit;
  
  // Female flag
  Result := GetElementNativeValues(e, 'ACBS\Flags') and 1 > 0;
end;

function Initialize: Integer;
begin
  FilterConflictAll := False;
  FilterConflictThis := False;
  FilterByInjectStatus := False;
  FilterInjectStatus := False;
  FilterByNotReachableStatus := False;
  FilterNotReachableStatus := False;
  FilterByReferencesInjectedStatus := False;
  FilterReferencesInjectedStatus := False;
  FilterByEditorID := False;
  FilterEditorID := '';
  FilterByName := False;
  FilterName := '';
  FilterByBaseEditorID := False;
  FilterBaseEditorID := '';
  FilterByBaseName := False;
  FilterBaseName := '';
  FilterScaledActors := False;
  FilterByPersistent := False;
  FilterPersistent := False;
  FilterUnnecessaryPersistent := False;
  FilterMasterIsTemporary := False;
  FilterIsMaster := False;
  FilterPersistentPosChanged := False;
  FilterDeleted := False;
  FilterByVWD := False;
  FilterVWD := False;
  FilterByHasVWDMesh := False;
  FilterHasVWDMesh := False;
  FilterBySignature := False;
  FilterSignatures := '';
  FilterByBaseSignature := False;
  FilterBaseSignatures := '';
  FlattenBlocks := False;
  FlattenCellChilds := False;
  AssignPersWrldChild := False;
  InheritConflictByParent := True; // color conflicts
  FilterScripted := True; // use custom Filter() function

  ApplyFilter;

  Result := 1;
end;

end. 

 

 

 

I found the information about Group from Tes5Mod:Mod File Format but I don't know how to use it. I can't find any example or tutorial about it.

 

Groups

GRUPs are collections of records, and are used to improve scanning of files to make it easier to skip over records that the reading program is not interested in.

In addition to this, subgroups for WRLD and CELLS provide some useful structural information (e.g., the division of cell data into persistent and non-persistent references.)

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Filter is not the best approach here since you want to check only TES4 header of each plugin

{
  Check form version of TES4 header in loaded plugins
}
unit UserScript;

const
  CheckFormVersion = 44;

function Initialize: integer;
var
  i: integer;
  plugin: IInterface;
begin
  for i := 0 to Pred(FileCount) do begin
    plugin := FileByIndex(i);
    if GetFormVersion(ElementByIndex(plugin, 0)) < CheckFormVersion then
      if Pos('.Hardcoded.', GetFileName(plugin)) = 0 then
        AddMessage('Old version plugin: ' + GetFileName(plugin));
  end;
  Result := 1;
end;

end.

Share this post


Link to post
Share on other sites
  • 0

Wow. Thank you so much, zilav.

I should ask here before start reading basic pascal tutorial, old script file and end up making nothing work.

(But I don't regret it because at least I tried ::D: )

 

Can I upload this script on Nexusmods?

I think it might useful for other people. I will give all credit to you.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Similar Content

    • By KillingMachine1914
      Greetings, 
       
      As it was stated in the title, it seems DynDOLOD is not applying modded statue of Azura (Sexy Statues Skyrim v2 NSFW Warning) when generating LODs. When I launch the game, vanilla Azura appears instead of the modded variant. The modded statue of Azura will only appear once I get close enough to it. Also, I installed a mod which resize the statue 2x its normal to make it visible all across Skyrim (Elizabeths Tower - Azura Shrine SSE).
       
      I have checked SSEEdit to see what defines the conflict and it turns out DynDOLOD.esp set the statue as persistent only and removed "is full lod" definition which was there in Elizabeth's Tower. I have very little idea of what those terms mean but my gut tells me that it has something to do with the trouble I am facing currently. Hence, is there a method to overcome this matter? 
       
      Thank you very much in advance.
    • By Midig
      Last time I tried to clean mods with Tes4edit for Oblivion I got CTD and had to Verify the integrity of the cache after deleting the edited DLCs. I followed the guide here: 
       
      https://wiki.step-project.com/TES5Edit/TES5Edit_Cleaning_Instructions 
       
      Which was provided from here: 
       
      https://wiki.step-project.com/User:Hishutup/OblivionGuide#TES4Edit
       
      However, the latter does not use MO at all and might just have been used as a referral. Something makes me think there is some problem with Tes4edit and MO, but I just wanted to check here before I got a headache through multiple attempts. Have people here made it work just fine, how did you do it? 
       
       
    • By yuser
      First, sorry for my English.
       
      I want to merge some ESP's without renumbering FormID's. Is there any way to (semi)automatically determine, if these given ESP's have crossing FormID's? I had looked into TES5Edit scripts directory but hadn't found anything apropiate.
       
      Or maybe there is a script, which just list all FormID's from given ESP?
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.