MySModAlice Posted April 15 Share Posted April 15 Hello Does anyone know what is the proper way to save larger arrays of string into files ( from papyrus scripts) /read them from files into string arrays in Papyrus scripts , in a way that works consistently on OG and NG? I am trying to build a friendly infrastructure for localization for my mod. As far as I can tell, the type of assets to be localized are: A - Classic Dialogue lines in the ESP, complete with making sure the translated ones point to the new (corresponding) audio voice files (and ofc the audio files themselves). B - Text Message type assets (MSG forms) in the ESP C - The text strings in the MCM menu of the respective mod. D - Text strings defined and used in the mod scripts themselves. Categories A, B - I understand have pretty straightforward procedures and tools already, like tool that can directly edit an ESP file, and folks doing localizations are already familiar with those tools. For category C I can look at examples in the config.json on other mods that have translated MCM entries, and see how they handled localizations there (I see they use reference string variables that they load from Interface\Translations text files) However, for D, things can get a bit more hairy. The way I started to do that was in two stages. Stage 1: I am migrating all user-displayable strings (that were initially scattered across all scripts) into one singular String Manger Script. All the other scripts draw their strings from this script's string arrays. This allows the one big script to use its own update functions, and prompt a refresh/reloading of all string arrays if needed. This makes management more palatable, since all the spellchecks and whatnot stay just in one script. However, it still means someone wanting to make edits would have to edit and recompile this papyrus script, which is not ideal. Stage 2: To take this a step further, I would want this script to be able to load and populate its string arrays from an external, humanly editable file on disk,(txt, or JSON) Does anyone know what's the best practice on that, which script extender function would do that? Initially, I was looking at functions from SUP F4SE JSON Functions Tutorial at Fallout 4 Nexus - Mods and community , which seemed that would do the trick. However, they depend on SUP F4SE at Fallout 4 Nexus - Mods and community , and it lists as broken in next gen update. Link to comment Share on other sites More sharing options...
LarannKiar Posted April 16 Share Posted April 16 Garden of Eden SE has an INI parser and a few file operators you might be able to use for this; WriteIni, ReadIni, DoesIniExist, DoesFileExist, GetLineFromFile, GetLinesFromFile, GetCommaDelimitedStringAsArray, GetWordsInStringAsArray etc. (Garden of Eden SE supports both v1.10.163 and v1.10.984). As far as I remember the string buffer is 10k characters. I can add WriteToFile in an update if .txt is necessary. 2 Link to comment Share on other sites More sharing options...
NeinGaming Posted April 16 Share Posted April 16 On 4/16/2025 at 3:14 PM, LarannKiar said: I can add WriteToFile in an update if .txt is necessary. Expand Oh yes, that would be so cool! Link to comment Share on other sites More sharing options...
Recommended Posts