Dynamic String Distributor 
Patching for OII
I was just alerted to the existence of Dynamic String Distributor (Huge shout out to SkyHorizon3 and Cutleast! Show them some love!) and after some testing, I've found it perfectly suited for patching mods for Oblivion Interaction Icons. This is because, in practice, my mod functions the same as a translation mod would. I've used, for example, ESP-ESM Translator by Epervier 666 in the past to generate patches.

Generally speaking, for Activator and Flora records, my mod only needs to alter the RNAM - Activate Text Override field. A typical patch entry looks like this:



This has the unfortunate side effect of being overwritten by mods that affect balance by changing any other entry - which is where the Synthesis patcher came in (huge thanks again to iXanza!). It can make changes to specific records, like this one, based on specific criteria (Mushrooms, for example, are determined by sound.) However, this has some limitations (aside from the language issues which are my fault for not taking the time to address) - Synthesis requires the user to launch and run a separate app, can run into load order limitations, etc etc. After some examination, I've found DSD can simply patch this field at runtime reliably enough to replace Synthesis in most cases. I still advise users with English-language games to run Synthesis when possible, but this can change as support is added over time.

How DSD patches work
 

DSD patches entries by FormID. So, for the above example, I would create a folder in SKSE\Plugins\DynamicStringDistributor called skyrim.esm and create a .json text file with the following content:
[
{
"form_id": "0004DA04|Skyrim.esm",
"type": "FLOR RNAM",
"string": "<font face='$Iconographia'>A</font>"
}
]

This will tell DSD to find this record, take its RNAM - Activate Text Override field's default text - Harvest - and change it to <font face='$Iconographia'>A</font>. When you load in game, you see the mushroom picking icon. 

The limitation of this for patching purposes is that every plugin must be patched individually. So, it will take some time (and probably help from users) to achieve coverage comparable to Synthesis for every user's modlist.

However, as of 2.5, base-game and DLC interactions are covered with no compatibility concerns and will work in every language! A plurality of common large-scale quest and flora mods like LOTD, CACO, Bruma, Vigilant, etc are covered as well.

What can DSD patches replace - and what can't they?

As of 2.5, the only strictly required plugin for the mod to function is skymoji.esp - which now includes a quest and perk. Skymojibase.esl is no longer required for basic functionality - however, unfortunately, it is still required for any activators that did not have RNAM records in vanilla (such as Shrines.)

Additionally, any mods that change Flora or Activator records (to attach keywords, change drop items, what have you) in any language will no longer need patching for Interaction Icons to show as intended. 

A complete set of patches for DAK-based mods, which touch the Perk-EPFD field I will not be covering in detail here, are now available. There is an issue, barely noticeable, of alignment. The new prompt will be ~10px to the right of the original prompt. If this also annoys you and you feel like noodling around in these patches, you may well find a fix before I do. Currently I space them like  so;

" <fonttag>X</font> <br> interaction "

which ameliorates the issue slightly but not enough for my tastes. Drop me a line if you figure something out.

A few mods from the original patcher change the perk conditions directly and will remain. There should be a list in the changelog of which these are and why.

Notes on Translation

Several of the new DSD patches are still in English due to the inclusion of text in the replacement string and will require translation. Currently, these consist of the contents of 02 - Patches / DSD / 02 - Perks / SKSE / Plugins / DynamicStringDistributor in the installer archive. They are mixed in with the other language-agnostic plugins upon installation so this is the simplest way to find them.

There are probably fewer than 50 terms across the whole project so it should be simple for native speakers to create patches. PM me or leave a comment if you want to provide a translation, it will go into the installer with credit in future updates. Thank you!

How to create DSD patches

This is the fun part! I have come up with a somewhat automated simplified process that I used for the new base-game patches and while it is infinitely faster than typing out all the JSON yourself it could certainly be improved. I hope to eventually create an xEdit script or something similar to automate the process, once I have simplified the regex. If you have experience with this sort of thing, please PM me or drop a comment! 

So, here is the method as quickly as possible. For this example we will be patching Campfire - and including some fixes compared to the Synthesis patcher while we're at it!

You will need:
SSEEDit by ElminsterAU
Notepad++ by Don Ho (external site link)
Automation Tools for TES5EDIT by matortheeternal
(optional) Synthesis - to automate the icon selection, basically.
Some time and patience.

STEP 1 - Exporting

For this example, we will use the output of the Synthesis patcher to make things faster. You can use this step to export directly from the plugin to be patched, although you won't be able to copy and paste the same commands for every step.

  • Navigate to the records you wish to patch, select each with Alt + LMB, and right click > Apply Scripts.
  • Select AT - QuickDisplay v1.5, and in the next window, enter RNAM - Activate Text Override in the first field.
  • Check 'Export as .txt' and hit OK.



STEP 2 - Formatting

Note: You can do as many of these as you like at one time! Notepad has a button in the Replace dialog to "Replace All in All Open Documents." If you have a mind to do several, I would advise repeating the xEdit export step for every mod beforehand and executing these commands in parallel across all of the QuickDisplay script's output files. Just make sure to copy Exported.txt out of Edit Scripts every time you export...

Navigate to Skyrim Special Edition>Edit Scripts and find Exported.txt. Copy and rename it somewhere else, then open it in Notepad++.
It should look like the below example.




Press Ctrl + H to open the Replace dialog and enter the following commands in the following order (yes, I know these could be improved, but they work for now. Apologies to anyone who used the convoluted method I had here before, lol.)

All commands require the Regular expression box in the lower left ticked. Copy the whole line with spaces for each, or the end result may be misaligned or display the wrong icon. Additionally, make sure ". matches newline" is disabled.

Notes are indented, commands are not. The first line is Find, the second is Replace. Let me know if this is unclear.


Selects from the end of the FormID > end of font tag.
Adds "type" line and reformats HTML tag. Make sure to include the last space after ">"!
For Flora records, use "FLOR RNAM".
\]([^\>])*.
|plugin",\r\n"type": "ACTI RNAM",\r\n"string": "<font face='$Iconographia'> 

Cleans font tag, inserts statement separations.
Make sure to include initial space.
<\/font\>([^\[])*
 </font>"\r\n},\r\n{\r\n

Adds the "form_id" tag. Use FLOR instead of ACTI for flora records.
^.*ACTI:
"form_id": "

Adds the name of the plugin. In this case, Campfire.esm.
plugin
Campfire.esm

The file should now look like this:



Add these two lines to the beginning of the file;

[
{

And change the last two to

}
]

to fix the JSON syntax. 


STEP 3 - Testing

Save the file to Data/SKSE/Plugins/DynamicStringDistributor/Campfire.esm as whatever-you-like.json and fire up the game to the start menu.

You can check Documents/My Games/Skyrim Special Edition/SKSE/DynamicStringDistributor.log to see if any bugs were found (missing FormIDs, plugins, or JSON exceptions).



STEP 4 (OPTIONAL) - Colors

If you want to match the Dear Diary Dark Mode color scheme, just find and replace the following across any open files.
Don't use Regular Expressions for these, run them as Normal find and replace operations.

Optional - If you want to color specific icons, do it first. This will make 'Sleep' a dreamy blue anywhere it appears.
<font face='$Iconographia'> a </font>
<font face='$Iconographia' color='#3F8ABB'> a </font>

Recolors icons without pre-existing colors in beige.
<font face='$Iconographia'>
<font face='$Iconographia' color='#E5C7aa'>

Changes the pure red for 'Steal' to a lighter tone.
#FF0000
#C44739

Changes grey for 'Close' and some others to a muted beige.
#DDDDDD
#D65059

If you want to make your own color scheme, you can recolor all existing patches at once using the following:
  • Open the .7z.
  • Copy the entire SKSE folder from [main] to a new location.
  • Use Explorer to search ".json" in that folder. 
  • Ctrl+A to select all, right click > open in Notepad++ (making sure you don't have any open tabs already!) 
  • Run Replace All in All Open Files for these commands. 
  • Go to File > Save All and File > Close All. 
  • Place the new SKSE folder in an empty mod in your mod organizer and test it out.


STEP 5

Open up the game and see if it works. If it doesn't, check the log.




STEP 6

Share! You can host patches yourself, that's 100% OK and always encouraged if you want to, or you can share them with me and they will be added to the installer with full credits every time. Hopefully, with enough of these patches, we can get to 90%+ coverage of mod-added interactions with full compatibility across languages and zero user-end patching needed. Thanks for reading and I hope this guide was helpful if only to explain how these things work.

Any questions, comments, complaints about my sloppy regex, etc. all welcome here or on the main page. Happy modding!

Article information

Added on

Edited on

Written by

rbtRvlt

4 comments

  1. DemongelRex
    DemongelRex
    • premium
    • 17 kudos
    For the first command you have to put in notepad++, it's incorrect.

    It is stated as: 

    \]([^\>])*.

    When it should be:

    \]([^\>]).*

    Just a minor fix, otherwise you'll get an invalid expression error.
    1. rbtRvlt
      rbtRvlt
      • premium
      • 217 kudos
      Could you pastebin the file you're starting with? I suspect the problem is there and possibly something to do with the export process.

      That said, here is what they do.
      The first Find selects from a right bracket ] to the first instance of a right caret > and adds one character (the caret itself) - like so. https://ibb.co/T4Hsq4d
      Changing it to .* either selects nothing at all or, with . matches newline enabled, selects the entire document (at least on NP++ version 8.6.9) https://ibb.co/vd05zHZ

      The second Find command selects from any instance of the text </font> to the first instance of a left bracket [ which is found before ACTI:XX in each new record. If the font tag has been 'damaged' by changes to the first step or by a faulty initial file this command would probably not work either.

      The third command will fail if . matches newline is enabled, so I will make a note of that.
    2. DemongelRex
      DemongelRex
      • premium
      • 17 kudos
      Here you go. The mod I'm using is called Rock Salt and it edits something like 300 records.  I'll try to give to another go in the meantime.
    3. rbtRvlt
      rbtRvlt
      • premium
      • 217 kudos
      Hmm, two things I see here.

      First, that mod doesn't need a separate patch at all, those are all vanilla records from skyrim.esm. Using DSD they are already covered, unless I just missed some.

      Second, the commands won't work without the HTML font tags present. you'd have to do one of two things first;

      • Run the synthesis patcher and run the QuickDisplay script from its output, or
      •  Run exactly this F&R command before the other steps and they'll work fine (same goes for every type of interaction, in other patches).

      Mine
      <font face="Iconographia">G</font>