Jump to content

Automation Tools for TES5Edit - Suggestions Thread


matortheeternal

Recommended Posts

So I wanted an xEdit script where you could highlight a group of records, and add those scripts to a formlist. Found this, eventually realized it could work, and (after much frustration) was able to batch add items to an FLST record with QuickChange. But that is not as streamlined as I wanted it. I wanted it to work the way the Powerlist script works (no importing/exporting records). I found a reference in this thread to a "FormList Manager.pas", but it was apparently deleted.


After bashing my face into my keyboard for a while, I eventually got it to work. It's much faster than using QuickChange, but is no good for merging FLST records (unless nested FLSTs work for what you are doing).

 

unit UserScript;

uses mteFunctions;

const
  vs = 'v0.5';
  signature = 'FLST';
  path = 'FormIDs';
  subpath = '';
  hl = '-----------------------------------------------------------------------------';

var
  dstFile, dstRec: IInterface;
  slForms: TStringList;
  cbForm: TComboBox;
  skip: boolean;

procedure LoadForms(Sender: TObject);
var
  forms, form: IInterface;
  i: integer;
begin
  cbForm.Items.Clear;
  cbForm.Items.AddObject('NEW', TObject(nil));
  dstFile := FileByIndex(TComboBox(Sender).ItemIndex);
  forms := GroupBySignature(dstFile, signature);
  if Assigned(forms) then begin
    for i := 0 to ElementCount(forms) - 1 do begin
      form := ElementByIndex(forms, i);
      cbForm.Items.AddObject(Name(form), TObject(form));
    end;
  end;
end;
  
procedure OptionsForm;
var
  frm: TForm;
  cbFile: TComboBox;
  lblFile, lblForm: TLabel;
  btnOk, btnCancel: TButton;
  i: integer;
begin
  skip := true;
  frm := TForm.Create(nil);
  try
    frm.Width := 300;
    frm.Height := 160;
    frm.Position := poScreenCenter;
    frm.Caption := 'Add forms to FormID list';
    
    lblFile := TLabel.Create(frm);
    lblFile.Parent := frm;
    lblFile.Left := 16;
    lblFile.Top := 16;
    lblFile.Caption := 'File: ';
    
    cbFile := TComboBox.Create(frm);
    cbFile.Parent := frm;
    cbFile.Left := 100;
    cbFile.Top := lblFile.Top;
    cbFile.Width := 150;
    for i := 0 to FileCount - 1 do
      cbFile.Items.Add(GetFileName(FileByIndex(i)));
    cbFile.OnSelect := LoadForms;
    
    lblForm := TLabel.Create(frm);
    lblForm.Parent := frm;
    lblForm.Left := lblFile.Left;
    lblForm.Top := lblFile.Top + lblFile.Height + 16;
    lblForm.Caption := 'FormID list: ';
    
    cbForm := TComboBox.Create(frm);
    cbForm.Parent := frm;
    cbForm.Left := cbFile.Left;
    cbForm.Top := lblForm.Top;
    cbForm.Width := 150;
    
    btnOk := TButton.Create(frm);
    btnOk.Parent := frm;
    btnOk.Caption := 'OK';
    btnOk.ModalResult := mrOk;
    btnOk.Left := frm.Width div 2 - btnOk.Width - 8;
    btnOk.Top := lblForm.Top + lblForm.Height + 24;
    
    btnCancel := TButton.Create(frm);
    btnCancel.Parent := frm;
    btnCancel.Caption := 'Cancel';
    btnCancel.ModalResult := mrCancel;
    btnCancel.Left := btnOk.Left + btnOk.Width + 16;
    btnCancel.Top := btnOk.Top;
    
    if frm.ShowModal() = mrOk then begin
      dstRec := ObjectToElement(cbForm.Items.Objects[cbForm.ItemIndex]);
      skip := false
    end;
  finally
    frm.Free;
  end;
end;
  
function Initialize: integer;
begin
  AddMessage(#13#10#13#10+hl);
  AddMessage('FormIDList Script '+vs+': Used for adding FormID references to lists.');
  AddMessage(hl+#13#10);
  slForms := TStringList.Create;
end;

function Process(e: IInterface): integer;
begin
  // AddMessage(Name(e));
  slForms.Add(Name(e));
end;

function Finalize: integer;
var
  a, e, group: IInterface;
  i: integer;
  b: boolean;
begin
  OptionsForm;
  if skip then begin
    AddMessage('Terminating script.');
    exit;
  end;
  b := false;
  if (Name(dstRec) = '') then begin
    // create new record
    AddMessage('Create new record!');
    group := GroupBySignature(dstFile, signature);
    if not Assigned(group) then
      group := Add(dstFile, signature, true);
    dstRec := Add(group, signature, true);
  end;
  
  AddMessage('Adding forms to: '+Name(dstRec)+'\'+path+' at '+subpath);
  a := ElementByPath(dstRec, path);
  if not Assigned(a) then begin
    a := Add(dstRec, path, true);
    b := true;
  end;
  for i := 0 to slForms.Count - 1 do begin
    AddMessage('    adding '+slForms[i]);
    e := ElementAssign(a, HighInteger, nil, false);
    seev(e, subpath, slForms[i]);
  end;
  if b then
    RemoveByIndex(a, 0, true);
  
  AddMessage(#13#10+hl);
  AddMessage('All done.');
  AddMessage(#13#10);
end;

end.

 

 

It probably still has some unnecessary stuff that isn't needed for FormID lists, but it seems to work fine so I'm not gonna bother trying to figure anything else out.

 

Is there a guide anywhere on how to get started with xEdit scripting? If I had a guide (or if this wasn't my first attempt at scripting in Pascal) I probably could have done this in 30 seconds, instead of over an hour.

 

Edit: I was gonna just leave it here do to how much of the code was directly copied from your PowerList code (I just deleted some lines and changed a few values/paths), but would you mind if I posted it as a Fallout 4 modder's utility? It would still require them to download your mod here, since it relies on functions in mteFunctions.pas.

Link to comment
Share on other sites

  • 1 month later...
  • Replies 446
  • Created
  • Last Reply

Top Posters In This Topic

Okay so Suggestions
- Please Add Lootifcation Script (Option for Random Percent or Replace Vanilla (-Enchant) and Option for Working with other Mods like Combining UNP MiniDress Mod with UNP Pattern Leggings Mod so If 1 Item is Found then Another is used like 10 items/type/class of A mod and 5 items/type/class of B mod so 1-5A=1-5B, 6-10=1-5B so 1 & 6 =1B so Leather Helm/Armor=Legging 1=YES vs NO=Leather Armor=Legging 1, Leather Helm=Legging 2 NO vs YES=Leather Helm= Legging 1, Metal Armor=Legging 2...maybe based it on catergory, price range, weight range, etc)...the person who made Lootifcation mod has very hard Instructions to understand

- Breakdown Mod needs to take into account the Value/Priority of Each Material as I tried to Breakdown TERA Weapons and the No.5 to 16 Swords & Lances (Swords) made from Quicksilver, Malachite and Moonstone didn't get the script and I can only think this was because only 1 of each Item was required...therefore (Cause I don't know or can tell what the script is doing) that it couldn't pick which item to use due to low amount cause I'm assuming you based your script on the Highest Amount of the Item Required so I mainly changed 22 weapons (Copy Item to & change Condition > Copy Ingot to Reward > Copy Item to Used > Delete Extra Items)

Link to comment
Share on other sites

  • 4 weeks later...

Mator, VIitS, you are both awesome.

I found Automation Tools awhile ago, but couldn't get my head around the export/import thingie for formlists. Was not looking forward to adding formIDs to Aemer's Refuge formlists by hand from CACO, CCOR and Hunterborn. Coz epic house mod must be more epic.

Then I find VIits modified PowerList script after hours of frustration, and a dance of joy occurs.

 

I like having all my ducks in a row, and stuff not sorting was sending me bonkers.

 

Thanks again,

 

ceilingrat

Link to comment
Share on other sites

  • 4 weeks later...

I recommend the addition of a script that makes creating more complex spells easier. that's my suggestion anyways. so far these's tools are neat and have been helping me fix up some personal patches for my own play through so Kudos on the easy to use tools! - i cant wait to see the future updates and additions to this beautiful set of modding tools.

Link to comment
Share on other sites

  • 1 month later...

I've made modifications to a plugin, and now I'd like to turn my modifications into a patch. Is there a way in TES5Edit to diff the modified plugin against the original and output the difference? How do you guys typically go about doing this?

 

Related: is there a way (while in TES5Edit) to copy to a new plugin all modifications you made to an existing one? The Construction Set has the concept of "active plugin" where your modifications end up, haven't seen anything equivalent in xEdit.

 

Otherwise I think it these would be good suggestions for new automation scripts.

 

Thanks for the great tools!

Link to comment
Share on other sites

I've made modifications to a plugin, and now I'd like to turn my modifications into a patch. Is there a way in TES5Edit to diff the modified plugin against the original and output the difference? How do you guys typically go about doing this?

 

Related: is there a way (while in TES5Edit) to copy to a new plugin all modifications you made to an existing one? The Construction Set has the concept of "active plugin" where your modifications end up, haven't seen anything equivalent in xEdit.

 

Otherwise I think it these would be good suggestions for new automation scripts.

 

Thanks for the great tools!

 

I don't think that's possible without making deep modifications to xEdit codebase to allow reloading a plugin in place.

 

Always make a new file, copy records to it as overrides, and modify the records in the new file.

Edited by matortheeternal
Link to comment
Share on other sites

  • 2 weeks later...

Is it possible to make a script that:

1. copies a existing record into another plugin

2. and then UPDATES all the records that used the original record to using the new record that was created instead?

 

Yes. This could be fairly easily added as an option with the replace formIDs script I provide with AT already.

Link to comment
Share on other sites

  • 1 month later...

I'm wondering if it would be possible to add an overlay of the perk images (helm for heavy armor, bottle for alchemy, fireball for destruction, etc.) that you see in-game to the existing perk tree ui script. Getting perks to align to the images in the skill menu is a pain when you don't have any kind of reference while placing them.

 

If that isn't possible, would you have any suggestions that would simplify the process of aligning them accurately?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...