Jump to content

Automation Tools for TES5Edit - Suggestions Thread


matortheeternal

Recommended Posts

I have a suggestion. Since you're doing a lot of record related coding maybe you can manage to do this?

Tes4Gecko was probably one of the most important tools in my workflow for Oblivion. It had a bunch of features which I can list below.

 

Link here: http://www.nexusmods.com/oblivion/mods/8665/?

TES4Gecko has a wide variety of useful functions, such as merging two or more plugins into a single plugin or removing data that doesn't need to be in a plugin (accidental changes). It can convert a plugin file to a master file or a master file to a plugin file, move worldspaces, generate silent dialog MP3s, and a ton of other useful stuff. Selected plugin records can be removed from a plugin or copied to another plugin. It will also split a single plugin file into master/plugin components and compare two plugins, highlighting the differences between them.

But the main thing I wanted to request was this feature:

 

"It will also split a single plugin into master/plugin components"

 

This feature worked by comparing "new data", (ie: data that was completely new and didn't overlap with vanilla skyrim data in any way) to the data that affected vanilla records and put the new data in the master and the rest in the plugin. I believe if the master already existed, then it would append the new data to the master.

 

It was incredibly efficient as it allowed me to use masters as libraries and make multiple small esps using that library as a base, and if I made a mistake and added new data to my plugins, it would just as easily merge the changes. This is the main thing I want to request.

Moreso, I want to request the basic form: Split a plugin into master:plugin format. The rest I think can be achieved in tes5edit normally. But as it is, Master/Plugin splitting has to be done manually.

Edited by shingouki2002
Link to comment
Share on other sites

  • Replies 446
  • Created
  • Last Reply

Top Posters In This Topic

Hi shingouki,

That should be fairly easy to do, I think.

 

All I have to do is iterate through all the records in a file, copy the ones that are overrides to one file and the ones that are not to a different file, and then I'm done. It won't handle asset copying though.

 

 

unit UserScript;
 
uses mteFunctions;
 
const
  groupsToSkip = 'TES4'#13'CELL'#13'WRLD';
 
var
  sourceFile, newMaster, newPlugin: IInterface;
 
function Finalize: integer;
var
  i: integer;
  e, dstFile, masters: IInterface;
  slMasters: TStringList;
  sourceFileName, masterFileName: string;
begin
  slMasters := TStringList.Create;
 
  sourceFile := FileSelect('Select a file to split into master/plugin components:');
  if not Assigned(sourceFile) then exit;
  newMaster := FileSelect('Create a new file for the master plugin:');
  if not Assigned(newMaster) then exit;
  newPlugin := FileSelect('Create a new file for the overrides plugin:');
  if not Assigned(newPlugin) then exit;
 
  // prepare masters so we can deep copy records
  masters := ElementByPath(ElementByIndex(sourceFile, 0), 'Master files');
  slMasters.Add(GetFileName(sourceFile));
  for i := 0 to ElementCount(masters) - 1 do
    slMasters.Add(genv(ElementByIndex(masters, i), 'MAST'));
  AddMessage(slMasters.Text);
  AddMastersToFile(newMaster, slMasters, false);
  slMasters.Add(GetFileName(newMaster));
  AddMastersToFile(newPlugin, slMasters, false);
 
  // perform record copying
  AddMessage('Copying records.');
  for i := 0 to RecordCount(sourceFile) - 1 do begin
    e := RecordByIndex(sourceFile, i);
    if Pos(Signature(e), groupsToSkip) > 0 then continue;
    // move overrides to newPlugin
    if not Equals(MasterOrSelf(e), e) then dstFile := newPlugin
    else dstFile := newMaster;
    try
      wbCopyElementToFile(e, dstFile, False, True);
      AddMessage('        Copying '+SmallName(e)+' to '+GetFileName(dstFile));
    except
      on Exception do begin
       AddMessage('        Failed to copy '+SmallName(e));
      end;
    end;
  end;
 
  // remove unnecessary masters
  AddMessage(#13#10+'Removing unnecessary masters.');
  masters := ElementByPath(ElementByIndex(newMaster, 0), 'Master files');
  sourceFileName := GetFileName(sourceFile);
  for i := ElementCount(masters) - 1 downto 0 do begin
    masterFileName := genv(ElementByIndex(masters, i), 'MAST');
    if masterFileName = sourceFileName then
      RemoveElement(masters, ElementByIndex(masters, i));
  end;
  masters := ElementByPath(ElementByIndex(newPlugin, 0), 'Master files');
  for i := ElementCount(masters) - 1 downto 0 do begin
    masterFileName := genv(ElementByIndex(masters, i), 'MAST');
    if masterFileName = sourceFileName then
      RemoveElement(masters, ElementByIndex(masters, i));
  end;
 
  // all done
  AddMessage(#13#10+'All done!');
end;
 
end.

 

Seems to work from what I've seen, but it's of course an entirely new script that does something that's never been tested before, so there are probably some issues.

Link to comment
Share on other sites

This is f***ing awesome. That perk tree editor has helped me lots, it's AMAZING.

 

I would suggest a script that would add perks/abilities to any Actor Templates and/or Actors of your choice. Would save a lot of time for some modders :x.
I want your babies.

 

OR

 

Adding keywords to magic effects of your choice.

Edited by Kerberus14
Link to comment
Share on other sites

  • 3 weeks later...

Been messing around with the Perk Tree Editor and I had a thought: Would it be possible to display the "image" of the constellation for the skill's tree in the background? For example, the Archery tree uses this image: http://images.uesp.net/archive/e/e9/20111218050418!SR-skill-Archery.png

 

In game, when you stop at a perk tree, the image of the constellation shows up underneath the perks and connections. Those connections form a rough outline corresponding to the skill's iconic image. If I'm remaking the Archery tree, it's be cool to be able to see how well the perk points and connection lines I'm making correspond to that bow and arrow image.

Edited by LittleRaskols
Link to comment
Share on other sites

Been messing around with the Perk Tree Editor and I had a thought: Would it be possible to display the "image" of the constellation for the skill's tree in the background? For example, the Archery tree uses this image: http://images.uesp.net/archive/e/e9/20111218050418!SR-skill-Archery.png

 

In game, when you stop at a perk tree, the image of the constellation shows up underneath the perks and connections. Those connections form a rough outline corresponding to the skill's iconic image. If I'm remaking the Archery tree, it's be cool to be able to see how well the perk points and connection lines I'm making correspond to that bow and arrow image.

 

Yeah, someone else suggested that awhile ago. It's on my todos, I just haven't gotten around to working on AutomationTools scripts for awhile (been focusing on Merge Plugins and Mator Smash).

Link to comment
Share on other sites

This might be absolutely, completely impossible, and I sort of imagine it is.

 

A generator for voice file implementation - "listens" to the voice files and names them properly, then exports them to an output folder?

 

Like I said. Pretty much definitely impossible.

Link to comment
Share on other sites

This might be absolutely, completely impossible, and I sort of imagine it is.

 

A generator for voice file implementation - "listens" to the voice files and names them properly, then exports them to an output folder?

 

Like I said. Pretty much definitely impossible.

 

Possible but would require one of the following-

 

Machine Learning

Using a Voice to Text API

Link to comment
Share on other sites

 

 

This might be absolutely, completely impossible, and I sort of imagine it is.

 

A generator for voice file implementation - "listens" to the voice files and names them properly, then exports them to an output folder?

 

Like I said. Pretty much definitely impossible.

Possible but would require one of the following-

 

Machine Learning

Using a Voice to Text API

Okay. :) Thanks for telling me.

Link to comment
Share on other sites

Hi shingouki,

 

That should be fairly easy to do, I think.

 

All I have to do is iterate through all the records in a file, copy the ones that are overrides to one file and the ones that are not to a different file, and then I'm done. It won't handle asset copying though.

 

 

unit UserScript;
 
uses mteFunctions;
 
const
  groupsToSkip = 'TES4'#13'CELL'#13'WRLD';
 
var
  sourceFile, newMaster, newPlugin: IInterface;
 
function Finalize: integer;
var
  i: integer;
  e, dstFile, masters: IInterface;
  slMasters: TStringList;
  sourceFileName, masterFileName: string;
begin
  slMasters := TStringList.Create;
 
  sourceFile := FileSelect('Select a file to split into master/plugin components:');
  if not Assigned(sourceFile) then exit;
  newMaster := FileSelect('Create a new file for the master plugin:');
  if not Assigned(newMaster) then exit;
  newPlugin := FileSelect('Create a new file for the overrides plugin:');
  if not Assigned(newPlugin) then exit;
 
  // prepare masters so we can deep copy records
  masters := ElementByPath(ElementByIndex(sourceFile, 0), 'Master files');
  slMasters.Add(GetFileName(sourceFile));
  for i := 0 to ElementCount(masters) - 1 do
    slMasters.Add(genv(ElementByIndex(masters, i), 'MAST'));
  AddMessage(slMasters.Text);
  AddMastersToFile(newMaster, slMasters, false);
  slMasters.Add(GetFileName(newMaster));
  AddMastersToFile(newPlugin, slMasters, false);
 
  // perform record copying
  AddMessage('Copying records.');
  for i := 0 to RecordCount(sourceFile) - 1 do begin
    e := RecordByIndex(sourceFile, i);
    if Pos(Signature(e), groupsToSkip) > 0 then continue;
    // move overrides to newPlugin
    if not Equals(MasterOrSelf(e), e) then dstFile := newPlugin
    else dstFile := newMaster;
    try
      wbCopyElementToFile(e, dstFile, False, True);
      AddMessage('        Copying '+SmallName(e)+' to '+GetFileName(dstFile));
    except
      on Exception do begin
       AddMessage('        Failed to copy '+SmallName(e));
      end;
    end;
  end;
 
  // remove unnecessary masters
  AddMessage(#13#10+'Removing unnecessary masters.');
  masters := ElementByPath(ElementByIndex(newMaster, 0), 'Master files');
  sourceFileName := GetFileName(sourceFile);
  for i := ElementCount(masters) - 1 downto 0 do begin
    masterFileName := genv(ElementByIndex(masters, i), 'MAST');
    if masterFileName = sourceFileName then
      RemoveElement(masters, ElementByIndex(masters, i));
  end;
  masters := ElementByPath(ElementByIndex(newPlugin, 0), 'Master files');
  for i := ElementCount(masters) - 1 downto 0 do begin
    masterFileName := genv(ElementByIndex(masters, i), 'MAST');
    if masterFileName = sourceFileName then
      RemoveElement(masters, ElementByIndex(masters, i));
  end;
 
  // all done
  AddMessage(#13#10+'All done!');
end;
 
end.

Seems to work from what I've seen, but it's of course an entirely new script that does something that's never been tested before, so there are probably some issues.

 

This is pretty incredible, but how would I go about using this code? I'm literally blown away by this already, but I'm super curious about how to go about using it.

Link to comment
Share on other sites

This is pretty incredible, but how would I go about using this code? I'm literally blown away by this already, but I'm super curious about how to go about using it.

 

1. Copy and paste the code into a Notepad document.

2. Save it as a new file in xEdit's Edit Scripts folder with the .pas extension.

3. Load xEdit, select some files to load, right click a file -> click apply script -> choose the script you just saved from the dropdown menu.

4. Do what it tells you to do.

Edited by matortheeternal
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...