Jump to content

[LE] I need a simple TES5edit script to mass convert armour to clothe


Teyris42

Recommended Posts

Hi,

First sorry, but i do not speak very well english.

 

I have lot of armor mod, and i want to convert these armors to clothes. At this time, what i do in tes5edit : under armor i modifiy these value

Armor Type : Light armor -> clothing

KWDA Keyword : ArmorLight->Armorclothing

ArmorCuirass->ClothingBody

VendoritemArmor->Vendoritemclothing

 

And finally Value : absurd number like 4000 to 30.

 

I would like to make a script for that, as modify 50 or 100 armor light this is not really fun.

 

 

A script that i apply for exemple on the armor entry in TES5Edit, so all armor under are converted in a single click. So the script would be like that :

 

Converttocloth()

B = Getnumberot Armor.entry

For i=0 to B

If Armortype <> armorlight or heavyarmor

exit

else

set Armortype to armorclothing

n = GetNumberOf keyword

For i=0 to n

If keyword.n = Armorlight

set keyword.n to Armorclothing

elseIf keyword.n = armorCuirass

set keyword.n to ClothingBody

.... etc for the keyword to change

endIf

i++

endFor

Setvalue to rand(50) + 10

endIf

Go to next armor

i++

Endfor

exit

 

But i really dont know how to actually make that script.

Edited by Teyris42
Link to comment
Share on other sites

I was never touched by this kind of scripting, but google tells us some reference and script samples.

 

database: https://github.com/TES5Edit/xEditScripts/tree/master/Scripts

 

sample1: https://github.com/TES5Edit/xEditScripts/blob/master/Scripts/List%20Armor%20Data.pas
sample2: https://github.com/TES5Edit/xEditScripts/blob/master/Scripts/Form%20COBJ%20-%20Decrease%20Value%2C%20Increase%20Weight.pas

 

tes5edit sample script, that should be adjusted to your purpose

 

{ https://github.com/TES5Edit/xEditScripts/blob/master/Scripts/Reweigh%20Items.pas
    Purpose: Reweigh Items
    Game: The Elder Scrolls V: Skyrim
    Author: fireundubh <[email protected]>
    Version: 0.1, reduced code
}

unit UserScript; // https://forums.nexusmods.com/index.php?/topic/8437228-i-need-a-simple-tes5edit-script-to-mass-convert-armour-to-clothe/

var
  fConfirmation, fWeightless, fArmor, fMisc: boolean;
  fArmorWeight, fMiscWeight: float;


function Initialize: integer;
;------------------
begin
  Result := 0;
 
  fConfirmation := (MessageDlg('Are you sure you want to apply this script?', mtConfirmation, [mbYes, mbNo], 0) = mrYes);
  if (fConfirmation <> TRUE) then begin
    Exit;
  end;
 
  fWeightless := (MessageDlg('Do you want to reduce all item weights to zero?', mtConfirmation, [mbYes, mbNo], 0) = mrYes);

  if (fWeightless = TRUE) then begin
    fArmor := TRUE;
    fMisc := TRUE;
    fArmorWeight := 0.000000;
    fMiscWeight := 0.000000;
  end;

  if (fWeightless = False) then begin
    fArmor := (MessageDlg('Reweigh Armor?', mtConfirmation, [mbYes, mbNo], 0) = mrYes);
    if (fArmor) AND (fWeightless <> TRUE) then begin
      fArmorWeight := (InputBox('Set Weight:', 'Weight:', 0.000000));
    end;
       
    fMisc := (MessageDlg('Reweigh Misc.?', mtConfirmation, [mbYes, mbNo], 0) = mrYes);
    if (fMisc) AND (fWeightless <> TRUE) then begin
      fMiscWeight := (InputBox('Set Weight:', 'Weight:', 0.000000));
    end;
  end;
end;


function Process(e: IInterface): integer;
;---------------
begin
  Result := 0;
 
  AddMessage('Processing: ' + Name(e));
 
  if (fArmor) AND (Signature(e) = 'ARMO') then begin
    SetElementNativeValues(e, 'DATA - Data\Weight', fArmorWeight)
  end;
 
  if (fMisc) AND (Signature(e) = 'MISC') then begin
    SetElementNativeValues(e, 'DATA - Data\Weight', fMiscWeight)
  end;
end;


function Finalize: integer;
;----------------
begin
    Result := 1;
    exit;
end;

end.  // unit ends here

 

 

 

How to install? https://github.com/matortheeternal/TES5EditScripts

- To install scripts you need to put the .pas files and all associated asset files into [skyrim Directory]\TES5Edit\Edit Scripts\

- From there you can execute the scripts from within TES5Edit, or another version of Edit which supports them.
Executing scripts in Edit is easy, if the script has a process function you'll start by selecting the objects
you want to apply the script to, right click on one of the objects, and click apply script.

- Choose the script you want to apply from the dropdown list and click OK.

- If the script doesn't have a process function you can simply right click anywhere and apply it. You can see individual script documentation for further instructions.

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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