I tried using this script to replace the chem lab workbench keyword with AEC_ck_ArmorsmithCraftingKey, but it doesn't do anything. Is there any other script that can do this since your mod is the only result I can get when I try to search for a particular script to do this job
Thank you so much for this script. With some minor edits, I was able to use this to batch edit a bunch of filenames for a music manager mod.
For the curious, what I did was comment out the EDID, FULL and other editor fields because they had the same partial strings as the file name and the script would just edit those instead of the file names. Then I added the "ANAM - Track FileName" editor field because that was what I was editing. It worked like a charm!
I was beginning to lose hope until I found this script as there's literally thousands of entries and counting, and doing it by hand would've taken weeks.
Wondering if you can provide any advice on how to edit this script to make bulk part changes to the TTET paths in a RACE record? For context, I am editing tint layers and don't want to override the originals.
I have created a new RACE record from HumanRace and essentially want to: - Use 4k assets for Looks Menu Customization Compendium for NPCs overriden to use this different RACE record - Keep all other elements the same - Not override the usual 2k assets for every other member of HumanRace - so only these NPCs use 4k assets but they do so without breaking every other NPCs face textures (lol)
But there are like one million fields to change - so I am trying to automate this by either using a script like this one or exporting the data to an external program and importing it back in with edits. Basically what I need to do is replace the usual directory listed in each TTET form within the copied Human Race: eg: actors\character\Character Assets\FaceDetails\AGCP Blood Spatter 3_d.dds
So I can then move the 4k assets to the other directory and avoid overwriting LMCC2k in the load order - but also correctly reference the added FaceDetails and TintMasks.
I would figure that a slight variation could be made to addsuffix or replaceall in order to achieve this, but am a beginner as far as coding goes. I've added the TTET field to the script per the description's instructions, so it is currently displaying in the GUI in FO4edit - just need to know how to instruct it to do specifically this.
Any help appreciated.
Finally - your work on this game is also much appreciated. I never run a modlist without it these days. Many thanks.
Thanks for the upload! As far as I can tell, it seems like you know your way around FO4Edit scripting. As such, I figured I'd ask...
I'd need a FO4Edit script that changes certain biped slots in 'Armor Addon' and 'Armor'. It should iterate over each 'Armor Addon' and 'Armor' record in selected plugin and if the record's biped slot is 41, it should change it to 36. Likewise, if the record's biped slot is 36, it should change it to 41.
Basically, it's reversing the slots; all the slots that were 41 should now be 36, and all the slots that were 36 should now be 41.
Is this possible? I've never worked with Pascal before and the I'm only using a single FO4Edit script (the one for finding all the ESPs which could be ESLified).
I did some digging and as I'm very familiar with coding (though not Pascal, mind you), I came up with the following code that doesn't work:
unit UserScript;
var ArmorAddonGroup: IInterface; ArmorGroup: IInterface; i: Integer;
function Initialize: integer; begin ArmorAddonGroup := GroupBySignature(FileByLoadOrder(0), 'ARMA'); ArmorGroup := GroupBySignature(FileByLoadOrder(0), 'ARMO');
for i := 0 to Pred(ElementCount(ArmorAddonGroup)) do InvertBipedSlot(ElementByIndex(ArmorAddonGroup, i));
for i := 0 to Pred(ElementCount(ArmorGroup)) do InvertBipedSlot(ElementByIndex(ArmorGroup, i));
Result := 0; end;
procedure InvertBipedSlot(rec: IInterface); var BipedSlot: Integer; begin BipedSlot := GetElementNativeValues(rec, 'BOD2\First Person Flags\Armor Type');
if BipedSlot = 41 then SetElementNativeValues(rec, 'BOD2\First Person Flags\Armor Type', 36) else if BipedSlot = 36 then SetElementNativeValues(rec, 'BOD2\First Person Flags\Armor Type', 41); end;
end.
Any help is much appreciated, and thanks in advance!
Record flags are usually part of an array. That would require the use of recursion in order to process them within the script. Unfortunately, that's not available right now.
47 comments
Thank you so much.
For the curious, what I did was comment out the EDID, FULL and other editor fields because they had the same partial strings as the file name and the script would just edit those instead of the file names. Then I added the "ANAM - Track FileName" editor field because that was what I was editing. It worked like a charm!
I was beginning to lose hope until I found this script as there's literally thousands of entries and counting, and doing it by hand would've taken weeks.
Wondering if you can provide any advice on how to edit this script to make bulk part changes to the TTET paths in a RACE record?
For context, I am editing tint layers and don't want to override the originals.
I have created a new RACE record from HumanRace and essentially want to:
- Use 4k assets for Looks Menu Customization Compendium for NPCs overriden to use this different RACE record
- Keep all other elements the same
- Not override the usual 2k assets for every other member of HumanRace - so only these NPCs use 4k assets but they do so without breaking every other NPCs face textures (lol)
But there are like one million fields to change - so I am trying to automate this by either using a script like this one or exporting the data to an external program and importing it back in with edits.
Basically what I need to do is replace the usual directory listed in each TTET form within the copied Human Race:
eg: actors\character\Character Assets\FaceDetails\AGCP Blood Spatter 3_d.dds
with
eg: actors\character\Character Assets\FaceDetails\OTHER DIRECTORY\AGCP Blood Spatter 3_d.dds
So I can then move the 4k assets to the other directory and avoid overwriting LMCC2k in the load order - but also correctly reference the added FaceDetails and TintMasks.
I would figure that a slight variation could be made to addsuffix or replaceall in order to achieve this, but am a beginner as far as coding goes.
I've added the TTET field to the script per the description's instructions, so it is currently displaying in the GUI in FO4edit - just need to know how to instruct it to do specifically this.
Any help appreciated.
Finally - your work on this game is also much appreciated.
I never run a modlist without it these days. Many thanks.
https://forums.nexusmods.com/index.php?/topic/7891838-xedit-scripts-add-and-replace-strings-in-editorid-and-name/page-2#entry82403143
You could also use my other script ECO Quick Mod Menu Creator - FO4Edit Automation Script for reference, it makes use of recursion.
Thanks :)
I'd need a FO4Edit script that changes certain biped slots in 'Armor Addon' and 'Armor'. It should iterate over each 'Armor Addon' and 'Armor' record in selected plugin and if the record's biped slot is 41, it should change it to 36. Likewise, if the record's biped slot is 36, it should change it to 41.
Basically, it's reversing the slots; all the slots that were 41 should now be 36, and all the slots that were 36 should now be 41.
Is this possible? I've never worked with Pascal before and the I'm only using a single FO4Edit script (the one for finding all the ESPs which could be ESLified).
I did some digging and as I'm very familiar with coding (though not Pascal, mind you), I came up with the following code that doesn't work:
unit UserScript;
var
ArmorAddonGroup: IInterface;
ArmorGroup: IInterface;
i: Integer;
function Initialize: integer;
begin
ArmorAddonGroup := GroupBySignature(FileByLoadOrder(0), 'ARMA');
ArmorGroup := GroupBySignature(FileByLoadOrder(0), 'ARMO');
for i := 0 to Pred(ElementCount(ArmorAddonGroup)) do
InvertBipedSlot(ElementByIndex(ArmorAddonGroup, i));
for i := 0 to Pred(ElementCount(ArmorGroup)) do
InvertBipedSlot(ElementByIndex(ArmorGroup, i));
Result := 0;
end;
procedure InvertBipedSlot(rec: IInterface);
var
BipedSlot: Integer;
begin
BipedSlot := GetElementNativeValues(rec, 'BOD2\First Person Flags\Armor Type');
if BipedSlot = 41 then
SetElementNativeValues(rec, 'BOD2\First Person Flags\Armor Type', 36)
else if BipedSlot = 36 then
SetElementNativeValues(rec, 'BOD2\First Person Flags\Armor Type', 41);
end;
end.
Any help is much appreciated, and thanks in advance!
I would love to know myself.
This is so helpful, and I use it all the time in my mod development.