Jump to content

Automation Tools for TES5Edit - Suggestions Thread


matortheeternal

Recommended Posts

  • 2 weeks later...
  • Replies 446
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...
  • 1 month later...

Suggestion: allow the Re-Evaluator to work for Alchemy or Cooking recipes.

 

I've made a few modifications to my local copy of the Re-Evaluator to fix the prices of my cooked items:

  //if geev(LinksTo(bnam), 'EDID') <> 'CraftingSmithingForge' then
  //  exit;
    
  slCobj.AddObject(geev(e, 'EDID'), TObject(e));
end;

//=========================================================================
// finalize: where all the stuff happens
function Finalize: integer;
var
  cv, value: real;
  i, j, count, yield: integer;
  cobj, items, li, item, cnam: IInterface;
  skip: boolean;
begin
  // options form
  OptionsForm;
 
  // exit if no functions were assigned
  if slFunctions.Count = 0 then
    exit;
    
  // loop through COBJ records
  AddMessage('Re-evaluating item values...');
  for i := 0 to slCobj.Count - 1 do begin
    AddMessage('    Processing '+slCobj[i]);
    cobj := ObjectToElement(slCobj.Objects[i]);
    yield := geev(cobj, 'NAM1');
    items := ElementByPath(cobj, 'Items');
    cnam := LinksTo(ElementByPath(cobj, 'CNAM'));
    if (OverrideCount(MasterOrSelf(cnam)) > 0) then
      cnam := OverrideByIndex(MasterOrSelf(cnam), OverrideCount(MasterOrSelf(cnam)) - 1);
    cv := 0;
    if not Assigned(items) then
      Continue;
    AddMessage('        Creates item: '+geev(cnam, 'EDID'));
    
    // evaluate value of each item, multiply by item count, and add to cv
    for j := 0 to ElementCount(items) - 1 do begin
      li := ElementByIndex(items, j);
      item := LinksTo(ElementByPath(li, 'CNTO - Item\Item'));
      if OverrideCount(item) > 0 then
        item := OverrideByIndex(item, OverrideCount(item) - 1);
      count := geev(li, 'CNTO - Item\Count');
      if Signature(item) = 'ALCH' then
        value := geev(item, 'ENIT\Value')
      else
        value := geev(item, 'DATA\Value');
      AddMessage(geev(item, 'EDID') + ' - ' + IntToStr(value) + '*' + IntToStr(count) + ' = ' + IntToStr(count*value));
      cv := cv + count * value;
    end;
    cv := cv / yield;
    AddMessage('                                   Recalculated item value to be: '+IntToStr(cv) + ' ' + geev(cnam, 'EDID'));

I think it may be useful to other authors as well.

Link to comment
Share on other sites

  • 1 month later...

Hey there! Thanks guys for such an immense and powerful tools as xEdit, and most of all for not being entirely distracted by other interesting projects!

 

I've been looking for something to assist with timelapse video in Skyrim and wondered if I'm looking at an issue someone else may have already found a solution to. The problem I am attempting to solve is that, when using the 'sgtm' command to increase the speed time passes in game in order to more easily record timelapse video of landscapes, physics gets a little funky. You can get an awful lot of noise from moveable statics clonking around, and NPCs will dance on the physics so hard that they die, and will end up floating off into the air (usually across the landscape you're trying to record!)

 

What I was trying to find is something a bit like the Virtual Broom tool, but for Worldspaces that looped through and copied all NPCs and moveable statics into a new esp, and disabled them. That way it can be run once against a setup and the esp just ticked on prior to recording timelapse video.

 

I'm willing to add this to my list of projects and try my hand at solving this later, but it has been about 20 years since I last touched Pascal and I have much to learn about the way xEdit reads/accesses skyrim records. I just wanted to check to make sure I wasn't reinventing the wheel, or launching into something that someone else might be able to do in minutes before I go invest days in trying to get this to work! >.<

 

Thanks again guys!

Link to comment
Share on other sites

it does up to a certain setting, but taking sgtm up to around 30 will see it overcome even that sadly - and in any case the moveable statics will still be flying around.

 

I saw MXPF released and it seems it might be able to help with this. I'll add it to my project list and give it a go later! :)

Link to comment
Share on other sites

  • 1 month later...

I use searth, but i cant find how add Flags with QuickChanger? Plz help i need example.

http://forums.nexusmods.com/index.php?/topic/1038549-automation-tools-for-tes5edit-suggestions-thread/page-30&do=findComment&comment=21549769

 

Now need realy help. I have in some records 4 or 6 chars number, like this:

010001

or

1001

i need add flag in end and need like this:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1

 

unit UserScript;
uses mteFunctions;
var
Records: Array[0..$FFFFFF] of IInterface;
rCount: integer;
function SetChar(const s: string; n: integer; c: string): string;
var
front, back: string;
begin
front := Copy(s, 1, n - 1);
back := Copy(s, n + 1, Length(s));
Result := front + c + back;
end;
function GetChar(const s: string; n: integer): string;
begin
Result := Copy(s, n, 1);
end;
function Toggle(c: string): string;
begin
Result := c;
if c = '1' then
Result := '0'
else if c = '0' then
Result := '1';
end;
function Process(e: IInterface): integer;
begin
Records[rCount] := e;
Inc(rCount);
end;
function Finalize: integer;
var
rec, flags: IInterface;
path, flagsMask, flagsValue, flagsValue2, msg: string;
i, j: integer;
begin
path := InputBox('Input path','Input the path to the flags element you want to modify.','ACBS\Flags');
rec := Records[0];
flags := ElementByIP(rec, path);
flagsValue := GetEditValue(flags);
flagsMask := InputBox('Input mask','Enter a string of length '+IntToStr(Length(flagsValue))+' for the flag mask.'#13
' t = toggle'#13
' x = ignore'#13
' 1 = set to one'#13
' 0 = set to zero',flagsValue);
for i := 0 to rCount - 1 do begin
rec := Records;
flags := ElementByIP(rec, path);
flagsValue := GetEditValue(flags);
msg := 'Changed flags from: '+flagsValue+' to: ';
for j := 1 to Length(flagsValue) do begin
if GetChar(flagsMask, j) = 't' then
flagsValue := SetChar(flagsValue, j, Toggle(GetChar(flagsValue, j)))
else if GetChar(flagsMask, j) = '1' then
flagsValue := SetChar(flagsValue, j, '1')
else if GetChar(flagsMask, j) = '0' then
flagsValue := SetChar(flagsValue, j, '0');
end;
msg := msg + flagsValue;
AddMessage(msg);
SetEditValue(flags, flagsValue);
end;
end;
end.

 

Okey.... i make it me self...

unit UserScript;

uses mteFunctions;

var
  Records: Array[0..$FFFFFF] of IInterface;
  rCount: integer;
 
function SetChar(const s: string; n: integer; c: string): string;
var
  front, back: string;
begin
  front := Copy(s, 1, n - 1);
  back := Copy(s, n + 1, Length(s));
  Result := front + c + back;
end;

function GetChar(const s: string; n: integer): string;
begin
  Result := Copy(s, n, 1);
end;

function Toggle(c: string): string;
begin
  Result := c;
  if c = '1' then
    Result := '0'
  else if c = '0' then
    Result := '1';
end;

function Process(e: IInterface): integer;
begin
  Records[rCount] := e;
  Inc(rCount);
end;

function Finalize: integer;
var
  rec, flags: IInterface;
  path, flagsMask, flagsValue, msg: string;
  i, j: integer;
begin
  path := InputBox('Input path','Input the path to the flags element you want to modify.','ACBS\Flags');
  rec := Records[0];
  flags := ElementByIP(rec, path);
  flagsValue := GetEditValue(flags);
  if Length(flagsValue) < 32 then
  flagsValue:=flagsValue+StringOfChar('0',32-Length(flagsValue));
  flagsMask := InputBox('Input mask','Enter a string of length '+IntToStr(Length(flagsValue))+' for the flag mask.'#13
    '  t = toggle'#13
    '  x = ignore'#13
    '  1 = set to one'#13
    '  0 = set to zero',flagsValue);
  for i := 0 to rCount - 1 do begin
    rec := Records[i];
    flags := ElementByIP(rec, path);
    flagsValue := GetEditValue(flags);
	if Length(flagsValue) < 32 then
	flagsValue:=flagsValue+StringOfChar('0',32-Length(flagsValue));
    msg := 'Changed flags from: '+flagsValue+' to: ';
    for j := 1 to Length(flagsValue) do begin
      if GetChar(flagsMask, j) = 't' then
        flagsValue := SetChar(flagsValue, j, Toggle(GetChar(flagsValue, j)))
      else if GetChar(flagsMask, j) = '1' then
        flagsValue := SetChar(flagsValue, j, '1')
      else if GetChar(flagsMask, j) = '0' then
        flagsValue := SetChar(flagsValue, j, '0');
    end;
    msg := msg + flagsValue;
    AddMessage(msg);
    SetEditValue(flags, flagsValue);
  end;
end;

end.
Edited by Guest
Link to comment
Share on other sites

Hello there!

Let me first thank you for all these wonderful tools you've released. The Renamer came in especially handy for fixing some small immersion breakers for me.

 

I have a suggestion to make. I wish I could say I was looking for pointers in order to make this myself, but I'm really having a hard time getting into scripting for TES5Edit.

Anyway; I just recently tried that wonderful "Tropical Skyrim" mod out, just for the sake of diversity. I came to wonder if it was possible to loop through all of Skyrim's inhabitants and change their race to something suitable for the environment, say Bosmer or Argonians. It would be a pretty interesting experience, but I couldn't be bothered to do the thing everybody else suggested: go through them in the CK and change their races manually.

 

Would it be possible to combine some aspects of the NPC Generator with the Transmogrifier, in order to loop through all humanoid NPC:s, change their races (perhaps just a percentage of them?), and "transmogrify" them to look different?

I think it could be an appreciated script. I hope no-one else has asked for this already - I looked some pages back, but not all of them.

 

Irregardless, thanks again, and thanks in advance!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...