Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

Dank Rafft

Uploaded by

DankRafft

Virus scan

Safe to use

44 comments

  1. Slithea
    Slithea
    • member
    • 3 kudos
    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
  2. MichikoUnknownFox
    MichikoUnknownFox
    • premium
    • 101 kudos
    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.
  3. DirgePsy
    DirgePsy
    • premium
    • 3 kudos
    Hey Dank,

    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.
    1. DankRafft
      DankRafft
      • premium
      • 1,154 kudos
      The TTET field is part of a nested data structure. You'd have to add recursion to the code so that the script can iterate over all the entries within a given structure of that kind. The user ID8879488948574 covered the basics of that a couple of posts below yours three years ago. Here's the forums link in case you can't find it:
      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.

      Finally - your work on this game is also much appreciated.
      I never run a modlist without it these days. Many thanks.
      Thanks for the kind words. :)
    2. DirgePsy
      DirgePsy
      • premium
      • 3 kudos
      Sweet man - I appreciate the prompt response and the advice, I'll have a look and see what I can dig up.

      Thanks :)
  4. RubberDuck001
    RubberDuck001
    • member
    • 36 kudos
    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!
  5. drevviken
    drevviken
    • premium
    • 29 kudos
    Is there a way to add flags to NPC records via script...? 
    1. Yourboizach
      Yourboizach
      • supporter
      • 14 kudos
      Did you by chance, figure that out mate?

      I would love to know myself.
    2. drevviken
      drevviken
      • premium
      • 29 kudos
      Unfortunately not :/
    3. DankRafft
      DankRafft
      • premium
      • 1,154 kudos
      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.
  6. PhoenixKnight13
    PhoenixKnight13
    • member
    • 19 kudos
    The replace text script is one of the most amazing time savers for batch-editing plugins, I can't even! Thank you!
    1. RetroDaddy
      RetroDaddy
      • premium
      • 55 kudos
      Ditto!
      This is so helpful, and I use it all the time in my mod development.
    2. DankRafft
      DankRafft
      • premium
      • 1,154 kudos
      Thank you for the kind words. You're welcome.
  7. Maicol0815
    Maicol0815
    • supporter
    • 2 kudos
    Would this work for Skyrim SE too? There is a food item I want to entirely erradicate and replace with another newer version of the same item.
  8. IKobi
    IKobi
    • member
    • 8 kudos
    Thank you for this, very useful.
  9. Luridum
    Luridum
    • premium
    • 74 kudos
    This is the greatest thing ever.
  10. ID8879488948574
    ID8879488948574
    • premium
    • 16 kudos
    Nice one, but unfortunately will not work with more complicated records (like menus). Luckily, this can be easily fixed. Just add recursion to your process method:

    {of course, declare the vars first}
    for eIndex := ElementCount(e) - 1 downto 0 do begin
    current := ElementByIndex(e, eIndex);
    Process(current)
    end;

    Works well for me and allows to replace nested structures easily. (Note that on large record bulks this might be very slow, so use carefully)
    1. chrisj165
      chrisj165
      • supporter
      • 0 kudos
      Could you be more specific where to put this, i'm unable to get this to work myself or upload into a codeblock?

      i'm clueless in what i'm doing so it's most likely me doing it wrong, just trying to auto add a prefix to "NNAM - Display Text" which is the misc text on the quest page for skyrim, i want to add a prefix before all the strings so i can more easily identify what quests are coming from what mods, just a little QoL for when i'm drowning in quests haha